]> git.proxmox.com Git - mirror_spl.git/blobdiff - configure
Atomic64 compatibility for 32-bit systems without kernel support.
[mirror_spl.git] / configure
index 8f644abf45bbf222b1c9172202f1b46c75b409c5..192a08442fa8398812498289843592da8ead199f 100755 (executable)
--- a/configure
+++ b/configure
@@ -1039,7 +1039,7 @@ Optional Features:
   --enable-debug-kmem-tracking
                           Enable detailed kmem tracking [default=no]
   --enable-atomic-spinlocks
-                          Atomic types use spinlocks [default=no]
+                          Atomic types use spinlocks [default=check]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -19160,25 +19160,9 @@ if test "${enable_atomic_spinlocks+set}" = set; then
   enableval="$enable_atomic_spinlocks"
 
 else
-  enable_atomic_spinlocks=no
+  enable_atomic_spinlocks=check
 fi;
 
-       if test "x$enable_atomic_spinlocks" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ATOMIC_SPINLOCK 1
-_ACEOF
-
-fi
-
-
-       echo "$as_me:$LINENO: checking whether atomic types use spinlocks" >&5
-echo $ECHO_N "checking whether atomic types use spinlocks... $ECHO_C" >&6
-       echo "$as_me:$LINENO: result: $enable_atomic_spinlocks" >&5
-echo "${ECHO_T}$enable_atomic_spinlocks" >&6
-
-       echo "$as_me:$LINENO: checking whether kernel defines uintptr_t" >&5
-echo $ECHO_N "checking whether kernel defines uintptr_t... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -19189,13 +19173,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/types.h>
+               #include <asm/atomic.h>
 
 int
 main (void)
 {
 
-               uintptr_t *ptr;
+               atomic64_t *ptr;
 
   ;
   return 0;
@@ -19218,11 +19202,10 @@ _ACEOF
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+               have_atomic64_t=yes
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_UINTPTR_T 1
+#define HAVE_ATOMIC64_T 1
 _ACEOF
 
 
@@ -19230,8 +19213,7 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-               echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+               have_atomic64_t=no
 
 
 
 
 
 
+       if test "x$enable_atomic_spinlocks" = xcheck; then
+
+               if test "x$have_atomic64_t" = xyes; then
+
+                       enable_atomic_spinlocks=no
+
+else
+
+                       enable_atomic_spinlocks=yes
+
+fi
+
+
+fi
+
+
+       if test "x$enable_atomic_spinlocks" = xyes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define ATOMIC_SPINLOCK 1
+_ACEOF
+
+
+else
+
+               if test "x$have_atomic64_t" = xno; then
+
+                       { { echo "$as_me:$LINENO: error: --disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details." >&5
+echo "$as_me: error: --disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+
+fi
+
+
+       echo "$as_me:$LINENO: checking whether atomic types use spinlocks" >&5
+echo $ECHO_N "checking whether atomic types use spinlocks... $ECHO_C" >&6
+       echo "$as_me:$LINENO: result: $enable_atomic_spinlocks" >&5
+echo "${ECHO_T}$enable_atomic_spinlocks" >&6
+
        echo "$as_me:$LINENO: checking whether kernel defines atomic64_t" >&5
 echo $ECHO_N "checking whether kernel defines atomic64_t... $ECHO_C" >&6
+       echo "$as_me:$LINENO: result: $have_atomic64_t" >&5
+echo "${ECHO_T}$have_atomic64_t" >&6
+
+       echo "$as_me:$LINENO: checking whether kernel defines atomic64_cmpxchg" >&5
+echo $ECHO_N "checking whether kernel defines atomic64_cmpxchg... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -19259,7 +19291,7 @@ int
 main (void)
 {
 
-               atomic64_t *ptr;
+               atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
 
   ;
   return 0;
@@ -19286,7 +19318,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_T 1
+#define HAVE_ATOMIC64_CMPXCHG 1
 _ACEOF
 
 
@@ -19305,8 +19337,8 @@ fi
 
 
 
-       echo "$as_me:$LINENO: checking whether kernel defines atomic64_cmpxchg" >&5
-echo $ECHO_N "checking whether kernel defines atomic64_cmpxchg... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking whether kernel defines atomic64_xchg" >&5
+echo $ECHO_N "checking whether kernel defines atomic64_xchg... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -19323,7 +19355,7 @@ int
 main (void)
 {
 
-               atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
+               atomic64_xchg((atomic64_t *)NULL, 0);
 
   ;
   return 0;
@@ -19350,7 +19382,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_CMPXCHG 1
+#define HAVE_ATOMIC64_XCHG 1
 _ACEOF
 
 
@@ -19369,8 +19401,8 @@ fi
 
 
 
-       echo "$as_me:$LINENO: checking whether kernel defines atomic64_xchg" >&5
-echo $ECHO_N "checking whether kernel defines atomic64_xchg... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking whether kernel defines uintptr_t" >&5
+echo $ECHO_N "checking whether kernel defines uintptr_t... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -19381,13 +19413,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <asm/atomic.h>
+               #include <linux/types.h>
 
 int
 main (void)
 {
 
-               atomic64_xchg((atomic64_t *)NULL, 0);
+               uintptr_t *ptr;
 
   ;
   return 0;
@@ -19414,7 +19446,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_XCHG 1
+#define HAVE_UINTPTR_T 1
 _ACEOF
 
 
@@ -22409,25 +22441,9 @@ if test "${enable_atomic_spinlocks+set}" = set; then
   enableval="$enable_atomic_spinlocks"
 
 else
-  enable_atomic_spinlocks=no
+  enable_atomic_spinlocks=check
 fi;
 
-       if test "x$enable_atomic_spinlocks" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ATOMIC_SPINLOCK 1
-_ACEOF
-
-fi
-
-
-       echo "$as_me:$LINENO: checking whether atomic types use spinlocks" >&5
-echo $ECHO_N "checking whether atomic types use spinlocks... $ECHO_C" >&6
-       echo "$as_me:$LINENO: result: $enable_atomic_spinlocks" >&5
-echo "${ECHO_T}$enable_atomic_spinlocks" >&6
-
-       echo "$as_me:$LINENO: checking whether kernel defines uintptr_t" >&5
-echo $ECHO_N "checking whether kernel defines uintptr_t... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -22438,13 +22454,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/types.h>
+               #include <asm/atomic.h>
 
 int
 main (void)
 {
 
-               uintptr_t *ptr;
+               atomic64_t *ptr;
 
   ;
   return 0;
@@ -22467,11 +22483,10 @@ _ACEOF
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+               have_atomic64_t=yes
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_UINTPTR_T 1
+#define HAVE_ATOMIC64_T 1
 _ACEOF
 
 
@@ -22479,8 +22494,7 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-               echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+               have_atomic64_t=no
 
 
 
 
 
 
+       if test "x$enable_atomic_spinlocks" = xcheck; then
+
+               if test "x$have_atomic64_t" = xyes; then
+
+                       enable_atomic_spinlocks=no
+
+else
+
+                       enable_atomic_spinlocks=yes
+
+fi
+
+
+fi
+
+
+       if test "x$enable_atomic_spinlocks" = xyes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define ATOMIC_SPINLOCK 1
+_ACEOF
+
+
+else
+
+               if test "x$have_atomic64_t" = xno; then
+
+                       { { echo "$as_me:$LINENO: error: --disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details." >&5
+echo "$as_me: error: --disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+
+fi
+
+
+       echo "$as_me:$LINENO: checking whether atomic types use spinlocks" >&5
+echo $ECHO_N "checking whether atomic types use spinlocks... $ECHO_C" >&6
+       echo "$as_me:$LINENO: result: $enable_atomic_spinlocks" >&5
+echo "${ECHO_T}$enable_atomic_spinlocks" >&6
+
        echo "$as_me:$LINENO: checking whether kernel defines atomic64_t" >&5
 echo $ECHO_N "checking whether kernel defines atomic64_t... $ECHO_C" >&6
+       echo "$as_me:$LINENO: result: $have_atomic64_t" >&5
+echo "${ECHO_T}$have_atomic64_t" >&6
+
+       echo "$as_me:$LINENO: checking whether kernel defines atomic64_cmpxchg" >&5
+echo $ECHO_N "checking whether kernel defines atomic64_cmpxchg... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -22508,7 +22572,7 @@ int
 main (void)
 {
 
-               atomic64_t *ptr;
+               atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
 
   ;
   return 0;
@@ -22535,7 +22599,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_T 1
+#define HAVE_ATOMIC64_CMPXCHG 1
 _ACEOF
 
 
@@ -22554,8 +22618,8 @@ fi
 
 
 
-       echo "$as_me:$LINENO: checking whether kernel defines atomic64_cmpxchg" >&5
-echo $ECHO_N "checking whether kernel defines atomic64_cmpxchg... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking whether kernel defines atomic64_xchg" >&5
+echo $ECHO_N "checking whether kernel defines atomic64_xchg... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -22572,7 +22636,7 @@ int
 main (void)
 {
 
-               atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
+               atomic64_xchg((atomic64_t *)NULL, 0);
 
   ;
   return 0;
@@ -22599,7 +22663,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_CMPXCHG 1
+#define HAVE_ATOMIC64_XCHG 1
 _ACEOF
 
 
@@ -22618,8 +22682,8 @@ fi
 
 
 
-       echo "$as_me:$LINENO: checking whether kernel defines atomic64_xchg" >&5
-echo $ECHO_N "checking whether kernel defines atomic64_xchg... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking whether kernel defines uintptr_t" >&5
+echo $ECHO_N "checking whether kernel defines uintptr_t... $ECHO_C" >&6
 
 
 cat >conftest.c <<_ACEOF
@@ -22630,13 +22694,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <asm/atomic.h>
+               #include <linux/types.h>
 
 int
 main (void)
 {
 
-               atomic64_xchg((atomic64_t *)NULL, 0);
+               uintptr_t *ptr;
 
   ;
   return 0;
@@ -22663,7 +22727,7 @@ _ACEOF
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_ATOMIC64_XCHG 1
+#define HAVE_UINTPTR_T 1
 _ACEOF