From 49cc1af2b8ca45da36f7de49585f02fd653e3b97 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 30 Oct 2008 22:33:38 +0100 Subject: [PATCH] LibUCW: Entrust generation of ucw/autoconf.h to the configure machinery. This is much nicer than the sed script invoked from ucw/Makefile. --- ucw/Makefile | 9 +++------ ucw/filter-autoconf.sed | 12 ------------ ucw/perl/UCW/Configure/LibUCW.pm | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 ucw/filter-autoconf.sed diff --git a/ucw/Makefile b/ucw/Makefile index 0af1d71d..e536663f 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -137,12 +137,9 @@ $(o)/ucw/.include-stamp: $(addprefix $(s)/ucw/,$(LIBUCW_INCLUDES)) $(o)/ucw/auto run/lib/pkgconfig/libucw.pc: $(o)/ucw/libucw.pc # The version of autoconf.h that is a part of the public API needs to have -# the internal symbols filtered out. -$(o)/ucw/autoconf.h: $(o)/autoconf.h - $(M)"FILTER $< -> $@" - $(Q)sed -f $(s)/ucw/filter-autoconf.sed <$< >$@ - -# Also, public config.h needs to refer to instead of "autoconf.h" +# the internal symbols filtered out, so we generate ucw/autoconf.h in the +# configure script and let the public config.h refer to +# instead of plain "autoconf.h". $(o)/ucw/config.h: $(s)/ucw/config.h $(M)"FILTER $< -> $@" $(Q)sed -e 's/^#include "autoconf\.h"/#include /' <$< >$@ diff --git a/ucw/filter-autoconf.sed b/ucw/filter-autoconf.sed deleted file mode 100644 index f6b598e5..00000000 --- a/ucw/filter-autoconf.sed +++ /dev/null @@ -1,12 +0,0 @@ -# A sed script to weed out private symbols from - -/^\//n - -# Excluded symbols (danger of collision) -/^#define CONFIG_DEBUG$/d - -# Included symbols -/^#define CONFIG_/n -/^#define CPU_/n - -d diff --git a/ucw/perl/UCW/Configure/LibUCW.pm b/ucw/perl/UCW/Configure/LibUCW.pm index 3d17ac7a..fe3350e4 100644 --- a/ucw/perl/UCW/Configure/LibUCW.pm +++ b/ucw/perl/UCW/Configure/LibUCW.pm @@ -43,5 +43,20 @@ if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) { Set("CONFIG_UCW_RADIX_SORTER_BITS" => 12); } +PostConfig { + AtWrite { + UCW::Configure::C::ConfigHeader("ucw/autoconf.h", [ + # Excluded symbols (danger of collision) + '^CONFIG_DEBUG$' => 0, + + # Included symbols + '^CONFIG_' => 1, + '^CPU_' => 1, + '^SHERLOCK_VERSION_' => 1, + + ]); + } if Get("CONFIG_INSTALL_API"); +}; + # We succeeded 1; -- 2.39.2