]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Allow spl_config.h to be included by dependant packages
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Mar 2009 21:55:59 +0000 (14:55 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Mar 2009 21:55:59 +0000 (14:55 -0700)
We need dependent packages to be able to include spl_config.h so they
can leverage the configure checks the SPL has done.  This is important
because several of the spl headers need the results of these checks to
work properly.  Unfortunately, the autoheader build product is always
private to a particular build and defined certain common things.
(PACKAGE, VERSION, etc).  This prevents other packages which also use
autoheader from being include because the definitions conflict.  To
avoid this problem the SPL build system leverage AH_BOTTOM to include
a spl_unconfig.h at the botton of the autoheader build product.  This
custom include undefs all known shared symbols to prevent the confict.
This does however mean that those definition are also not availble
to the SPL package either.  The SPL package therefore uses the
equivilant SPL_META_* definitions.

12 files changed:
Makefile.am
Makefile.in
config/spl-meta.m4
configure
configure.ac
include/asm/atomic_compat.h
include/sys/types.h
lib/list.c
module/spl/spl-generic.c
module/splat/splat-ctl.c
spl_config.h.in
spl_unconfig.h [new file with mode: 0644]

index 37182fe7f510d819230627a81fa60a5c75925db5..63d6ba7e4091eb50e336baa548b09eab21510ccf 100644 (file)
@@ -2,7 +2,7 @@ SUBDIRS = lib cmd module include scripts
 
 AUTOMAKE_OPTIONS = foreign dist-zip
 EXTRA_DIST = autogen.sh spl.spec.in META DISCLAIMER
-noinst_HEADERS = spl_config.h
+noinst_HEADERS = spl_config.h spl_unconfig.h
 
 distclean-local::
        -$(RM) -R autom4te*.cache
@@ -17,6 +17,7 @@ distclean-local::
 
 install-data-local:
        $(INSTALL) -D spl_config.h $(DESTDIR)/$(LINUX)/include/spl/spl_config.h
+       $(INSTALL) -D spl_unconfig.h $(DESTDIR)/$(LINUX)/include/spl/spl_unconfig.h
 
 ctags:
        $(RM) $(top_srcdir)/tags
index 6b212bb65981b60a733c418169889cc5c7399d33..27825361ea0a83a4ac7e1fa5547e804a90c6c274 100644 (file)
@@ -203,7 +203,7 @@ target_vendor = @target_vendor@
 SUBDIRS = lib cmd module include scripts
 AUTOMAKE_OPTIONS = foreign dist-zip
 EXTRA_DIST = autogen.sh spl.spec.in META DISCLAIMER
-noinst_HEADERS = spl_config.h
+noinst_HEADERS = spl_config.h spl_unconfig.h
 all: spl_config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -661,6 +661,7 @@ distclean-local::
 
 install-data-local:
        $(INSTALL) -D spl_config.h $(DESTDIR)/$(LINUX)/include/spl/spl_config.h
+       $(INSTALL) -D spl_unconfig.h $(DESTDIR)/$(LINUX)/include/spl/spl_unconfig.h
 
 ctags:
        $(RM) $(top_srcdir)/tags
index 54c9ac38fc5f99a7cf3c16c6c0143f858db00a4d..84b41757d5489b81e97d0cdb41e0dc45943eb911 100644 (file)
@@ -7,17 +7,6 @@ dnl # Chris Dunlap <cdunlap@llnl.gov>
 dnl # Brian Behlendorf <behlendorf1@llnl.gov>
 dnl #
 AC_DEFUN([SPL_AC_META], [
-
-       AH_BOTTOM([
-#undef PACKAGE
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef STDC_HEADERS
-#undef VERSION])
-
        AC_MSG_CHECKING([metadata])
 
        META="$srcdir/META"
index f3deee9c88987fb8996b1e01d1cac4de89446881..3c63443244b438b6b32b8b7d5caab2599a6e9b8a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1510,10 +1510,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-
-
-
-
        echo "$as_me:$LINENO: checking metadata" >&5
 echo $ECHO_N "checking metadata... $ECHO_C" >&6
 
@@ -2212,6 +2208,8 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
           ac_config_headers="$ac_config_headers spl_config.h"
 
+
+
 echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
@@ -3988,7 +3986,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3991 "configure"' > conftest.$ac_ext
+  echo '#line 3989 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5587,7 +5585,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5590:" \
+echo "$as_me:5588:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6650,11 +6648,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6653: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6651: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6657: \$? = $ac_status" >&5
+   echo "$as_me:6655: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6918,11 +6916,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6921: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6919: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6925: \$? = $ac_status" >&5
+   echo "$as_me:6923: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7022,11 +7020,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7025: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7023: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7029: \$? = $ac_status" >&5
+   echo "$as_me:7027: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8491,7 +8489,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 8494 "configure"' > conftest.$ac_ext
+    echo '#line 8492 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9388,7 +9386,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9391 "configure"
+#line 9389 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9488,7 +9486,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9491 "configure"
+#line 9489 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11831,11 +11829,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11834: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11832: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11838: \$? = $ac_status" >&5
+   echo "$as_me:11836: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11935,11 +11933,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11938: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11936: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11942: \$? = $ac_status" >&5
+   echo "$as_me:11940: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12471,7 +12469,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 12474 "configure"' > conftest.$ac_ext
+    echo '#line 12472 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -13529,11 +13527,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13532: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13530: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13536: \$? = $ac_status" >&5
+   echo "$as_me:13534: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13633,11 +13631,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13636: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13634: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13640: \$? = $ac_status" >&5
+   echo "$as_me:13638: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15082,7 +15080,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 15085 "configure"' > conftest.$ac_ext
+    echo '#line 15083 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -15860,11 +15858,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15863: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15861: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15867: \$? = $ac_status" >&5
+   echo "$as_me:15865: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16128,11 +16126,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16131: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16129: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16135: \$? = $ac_status" >&5
+   echo "$as_me:16133: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16232,11 +16230,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16235: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16233: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16239: \$? = $ac_status" >&5
+   echo "$as_me:16237: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17701,7 +17699,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 17704 "configure"' > conftest.$ac_ext
+    echo '#line 17702 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
index bdec31c4bf76c46a6c7cc77cfb0ec1db192499a3..b6abe7a8c119f0d9fb9eab28b8d4646d889b629d 100644 (file)
@@ -31,6 +31,7 @@ AC_CONFIG_AUX_DIR([config])
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE([$SPL_META_NAME], [$SPL_META_VERSION])
 AC_CONFIG_HEADERS([spl_config.h])
+AH_BOTTOM([#include <spl_unconfig.h>])
 AM_MAINTAINER_MODE
 
 AC_PROG_INSTALL
index 9aa248b061794acb0afd0277312c7470b38d7daa..2f7376925a5d84d7360af3ee0a25165e75dbf3d9 100644 (file)
@@ -2,7 +2,7 @@
 #define _SPL_ATOMIC_COMPAT_H
 
 #include <asm/atomic.h>
-#include "spl_config.h"
+#include <spl_config.h>
 
 #ifndef HAVE_ATOMIC64_T
 #include <linux/spinlock.h>
index 699efe648b14445693b71c1b3630882b9366cf77..5fd3a9376752702d7721c0ae55a5115946d1af3d 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 
 #include <linux/types.h>
 #include <sys/sysmacros.h>
-#include "spl_config.h"
+#include <spl_config.h>
 
 #include <linux/uaccess_compat.h>
 #include <linux/file_compat.h>
index ee6b33a8362c1004a51fe1982507107fa9a25825..08b1f631ff97e4528184e6275f458e38a98287f6 100644 (file)
@@ -26,7 +26,7 @@
 
 
 #ifdef HAVE_CONFIG_H
-#  include "spl_config.h"
+#  include <spl_config.h>
 #endif /* HAVE_CONFIG_H */
 
 #ifdef WITH_PTHREADS
index c23abf6ff78b5c4f8ff829e325307b9a032914ea..76a8de472e9630ed58c527656fbe618bccabff19 100644 (file)
@@ -43,7 +43,7 @@
 
 #define DEBUG_SUBSYSTEM S_GENERIC
 
-char spl_version[16] = "SPL v" VERSION;
+char spl_version[16] = "SPL v" SPL_META_VERSION;
 
 long spl_hostid = 0;
 EXPORT_SYMBOL(spl_hostid);
@@ -340,7 +340,7 @@ static int __init spl_init(void)
        if ((rc = set_kallsyms_lookup_name()))
                GOTO(out7, rc = -EADDRNOTAVAIL);
 
-       printk("SPL: Loaded Solaris Porting Layer v%s\n", VERSION);
+       printk("SPL: Loaded Solaris Porting Layer v%s\n", SPL_META_VERSION);
        RETURN(rc);
 out7:
        kstat_fini();
@@ -358,7 +358,7 @@ out:
        debug_fini();
 
        printk("SPL: Failed to Load Solaris Porting Layer v%s, "
-              "rc = %d\n", VERSION, rc);
+              "rc = %d\n", SPL_META_VERSION, rc);
        return rc;
 }
 
@@ -366,7 +366,7 @@ static void spl_fini(void)
 {
        ENTRY;
 
-       printk("SPL: Unloaded Solaris Porting Layer v%s\n", VERSION);
+       printk("SPL: Unloaded Solaris Porting Layer v%s\n", SPL_META_VERSION);
        kstat_fini();
        proc_fini();
        vn_fini();
index d7aed023c926cbddb6068cc3da1ab9b912e2c75b..2ff62ffb00e2321e397c78391f6bb2a261b62580 100644 (file)
@@ -638,7 +638,7 @@ splat_init(void)
                                         NULL, SPLAT_NAME);
 
        printk(KERN_INFO "SPLAT: Loaded Solaris Porting LAyer "
-              "Tests v%s\n", VERSION);
+              "Tests v%s\n", SPL_META_VERSION);
        return 0;
 error:
        printk(KERN_ERR "SPLAT: Error registering splat device, %d\n", rc);
@@ -671,7 +671,7 @@ splat_fini(void)
 
        ASSERT(list_empty(&splat_module_list));
        printk(KERN_INFO "SPLAT: Unloaded Solaris Porting LAyer "
-              "Tests v%s\n", VERSION);
+              "Tests v%s\n", SPL_META_VERSION);
 }
 
 module_init(splat_init);
index 4d11efb3c0ad5eb9dd26f411116db631057ea241..8cfcff5c69825b6fe7ace54839b499f0322cab4d 100644 (file)
 /* Version number of package */
 #undef VERSION
 
-
-#undef PACKAGE
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef STDC_HEADERS
-#undef VERSION
+#include <spl_unconfig.h>
diff --git a/spl_unconfig.h b/spl_unconfig.h
new file mode 100644 (file)
index 0000000..b50a0be
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Undefine these symbols to allow other autoheader enabled packages
+ * to leverage the SPL configure checks without a header conflict.
+ */
+#undef PACKAGE
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef VERSION
+#undef STDC_HEADERS