diff options
author | Brian Behlendorf <[email protected]> | 2010-03-22 14:45:33 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-03-22 14:45:33 -0700 |
commit | 16b719f0066047aaf404756a0b4fe8c74eec6a2a (patch) | |
tree | 054c7b8867d597e02bf3494c75f4c0f5a514d5ba /lib | |
parent | aa600d8a3843755be1dd621ecd00401f26f3bb49 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.in | 2 | ||||
-rw-r--r-- | lib/list.c | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 992319d02..ad1fbd95e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -192,7 +192,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -DEFAULT_INCLUDES = -I${top_srcdir} +DEFAULT_INCLUDES = -include ${top_srcdir}/spl_config.h AM_CFLAGS = -Wall -Wstrict-prototypes -Werror -Wshadow \ -D__USE_LARGEFILE64 noinst_LTLIBRARIES = libcommon.la diff --git a/lib/list.c b/lib/list.c index 08b1f631f..fbee2d97d 100644 --- a/lib/list.c +++ b/lib/list.c @@ -25,10 +25,6 @@ *****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include <spl_config.h> -#endif /* HAVE_CONFIG_H */ - #ifdef WITH_PTHREADS # include <pthread.h> #endif /* WITH_PTHREADS */ |