aboutsummaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-10-03 21:32:08 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-10-03 21:34:42 -0700
commit97ea4adcf0d862472857a4d2e2211edabf8a69df (patch)
tree44d91ff366d46a8c3e3747d5b6b36d1b68d96489 /autogen.sh
parentfae1dd3d947a9b112c273ea669091fbdf9ccd4d6 (diff)
downloadnasm-97ea4adcf0d862472857a4d2e2211edabf8a69df.tar.gz
nasm-97ea4adcf0d862472857a4d2e2211edabf8a69df.tar.xz
nasm-97ea4adcf0d862472857a4d2e2211edabf8a69df.zip
config/unconfig.h: eliminate #undef directives
config/config.h as generated by autoconf has #undef directives commented out, but the autoheader-generated template contains them, and config/unconfig.h should not contain them. Re-introduce config/config.h.in, and postprocess it to generate config/unconfig.h by commenting out all the #undef directives, just as configure does. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index 5597c8a0..c681c679 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -43,6 +43,15 @@ if test ! -f autoconf/aclocal.m4; then
fi
rm -rf autoconf/*m4.old
"$AUTOHEADER" -B autoconf
+if [ config/config.h.in -nt config/unconfig.h ]; then
+ # Create a file corresponding to a completely empty configure
+ # instance, commenting out the #undef directives from the template
+ # just like configure would do.
+ perl -np < config/config.h.in > config/unconfig.h \
+ -e 's:^(\#\s*undef\s.*)$:/* $1 */:;' \
+ -e 's:config/config.h.in:config/unconfig.h:;' \
+ -e 's:autoheader:autogen.sh:;'
+fi
"$AUTOCONF" -B autoconf
rm -rf autom4te.cache config.log config.status config/config.h Makefile