diff options
author | Martin Mares <mj@ucw.cz> | 1999-01-23 22:08:36 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-01-23 22:08:36 +0100 |
commit | 2c2f67bd83c267c1dbee68c6ed7d67f9be77e566 (patch) | |
tree | af1b6208207804a087a742b8c4fd4cabb86ff690 | |
parent | ca3d562b24d5a3e303ab00d276496fb38b7382ee (diff) | |
download | bird-2c2f67bd83c267c1dbee68c6ed7d67f9be77e566.tar bird-2c2f67bd83c267c1dbee68c6ed7d67f9be77e566.zip |
Filter all `Modules' files through C preprocessor, so that they can
reference BIRD configuration.
By the way: Do you know GCC by default does `#define unix 1'?
-rw-r--r-- | configure.in | 2 | ||||
-rwxr-xr-x | tools/mergedirs | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 977b928..9f5baeb 100644 --- a/configure.in +++ b/configure.in @@ -114,7 +114,7 @@ else fi AC_CONFIG_HEADER(sysdep/autoconf.h) -AC_OUTPUT_COMMANDS(,[$srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs]) +AC_OUTPUT_COMMANDS(,[CPP="$CPP" $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs]) AC_OUTPUT($makefiles) cat >&AC_FD_MSG <<EOF diff --git a/tools/mergedirs b/tools/mergedirs index 7bc9109..4196831 100755 --- a/tools/mergedirs +++ b/tools/mergedirs @@ -4,6 +4,7 @@ if [ -z "$4" ] ; then echo "Usage: mergedirs <src-dir> <src-dir-rel> <obj-dir> <list-of-dirs>" exit 1 fi +cpp=${CPP:-gcc -E} SRCDIR=$1 shift SRCREL=$1 @@ -19,7 +20,9 @@ shift echo "Merging system-dependent modules ($@)" MODULES=`for a in $@ ; do - sed <$SRCDIR/$a/Modules "s@\\(.*\\)@\\1 $a/\\1@" + cat sysdep/autoconf.h $SRCDIR/$a/Modules | + $cpp -U unix - | + sed "/^[ ]*\$/d;/^#/d;s@\\(.*\\)@\\1 $a/\\1@" done | sort +0 -1 -u | cut -d ' ' -f 2` |