From 16b719f0066047aaf404756a0b4fe8c74eec6a2a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Mar 2010 14:45:33 -0700 Subject: Allow spl_config.h to be included by dependant packages (updated) We need dependent packages to be able to include spl_config.h to build properly. This was partially solved in commit 0cbaeb1 by using AH_BOTTOM to #undef common #defines (PACKAGE, VERSION, etc) which autoconf always adds and cannot be easily removed. This solution works as long as the spl_config.h is included before your projects config.h. That turns out to be easier said than done. In particular, this is a problem when your package includes its config.h using the -include gcc option which ensures the first thing included is your config.h. To handle all cases cleanly I have removed the AH_BOTTOM hack and replaced it with an AC_CONFIG_HEADERS command. This command runs immediately after spl_config.h is written and with a little awk-foo it strips the offending #defines from the file. This eliminates the problem entirely and makes header safe for inclusion. Also in this change I have removed the few places in the code where spl_config.h is included. It is now added to the gcc compile line to ensure the config results are always available. Finally, I have also disabled the verbose kernel builds. If you want them back you can always build with 'make V=1'. Since things are working now they don't need to be on by default. --- config/config.awk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/config.awk (limited to 'config/config.awk') diff --git a/config/config.awk b/config/config.awk new file mode 100644 index 000000000..cc4b7cc26 --- /dev/null +++ b/config/config.awk @@ -0,0 +1,15 @@ +# Remove default preprocessor define's from config.h +# PACKAGE +# PACKAGE_BUGREPORT +# PACKAGE_NAME +# PACKAGE_STRING +# PACKAGE_TARNAME +# PACKAGE_VERSION +# STDC_HEADERS +# VERSION + +BEGIN { RS = "" ; FS = "\n" } \ + !/.#define PACKAGE./ && \ + !/.#define VERSION./ && \ + !/.#define STDC_HEADERS./ \ + { print $0"\n" } -- cgit v1.2.3