base/dispatch.c, etc.: Replace inline assembler for the `rdrand' fix.
[catacomb] / configure.ac
index b41687a..b4f7389 100644 (file)
@@ -78,8 +78,8 @@ AC_DEFUN([catacomb_CPU_FAMILIES],
    $1([i[[3-6]]86,*], [x86], [sysv])
    $1([x86_64,cygwin], [amd64], [win])
    $1([x86_64,*], [amd64], [sysv])
    $1([i[[3-6]]86,*], [x86], [sysv])
    $1([x86_64,cygwin], [amd64], [win])
    $1([x86_64,*], [amd64], [sysv])
-   $1([arm,*-gnueabi | arm,*-gnueabihf | dnl
-       armv*,*-gnueabi | armv*,*-gnueabihf], [armel], [gnueabi])])
+   $1([arm,* | armv*,*], [armel], [std])
+   $1([aarch64,*], [arm64], [std])])
 
 dnl A utility to clear the `seen' flags, used so as to process each CPU or
 dnl ABI once.
 
 dnl A utility to clear the `seen' flags, used so as to process each CPU or
 dnl ABI once.
@@ -145,7 +145,7 @@ m4_define([catacomb_DEFINE_CPU_OR_ABI],
        ;;m4_define([catacomb_seen_$3/$$2], [t])])])
   catacomb_CPU_FAMILIES([_def])
   nil) ;;
        ;;m4_define([catacomb_seen_$3/$$2], [t])])])
   catacomb_CPU_FAMILIES([_def])
   nil) ;;
-  *) AC_MSG_ERROR([BUG: unexpected $1 \`$1']) ;;
+  *) AC_MSG_ERROR([BUG: unexpected $1 \`$$1']) ;;
 esac])
 
 dnl Now that's out the way, we can explain what we're doing.
 esac])
 
 dnl Now that's out the way, we can explain what we're doing.
@@ -179,6 +179,26 @@ case $CPUFAM in
   *) AC_MSG_RESULT([$CPUFAM/$ABI]) ;;
 esac
 
   *) AC_MSG_RESULT([$CPUFAM/$ABI]) ;;
 esac
 
+dnl Consider enabling support for assembler-level debugging toys.
+AC_ARG_ENABLE([asm-debug],
+  AS_HELP_STRING([--enable-asm-debug],
+    [enable assembler debugging features]),
+  [mdw_asm_debug=$enableval], [mdw_asm_debug=no])
+case $CPUFAM in nil) mdw_asm_debug=no ;; esac
+case $mdw_asm_debug in
+  no) ;;
+  *) AC_DEFINE([ENABLE_ASM_DEBUG], [1],
+       [Define to enable assembler-level debugging.]) ;;
+esac
+AM_CONDITIONAL([ASM_DEBUG], [test x$mdw_asm_debug != xno])
+
+dnl Check for leading underscores on C symbols.
+LT_SYS_SYMBOL_USCORE
+case $sys_symbol_underscore in
+  yes) AC_DEFINE([SYM_USCORE], [1],
+        [Define if C symbols are prefixed with an underscore.]) ;;
+esac
+
 dnl--------------------------------------------------------------------------
 dnl CPU-specific assembler features.
 
 dnl--------------------------------------------------------------------------
 dnl CPU-specific assembler features.
 
@@ -239,11 +259,10 @@ AC_CHECK_TYPE([socklen_t], [],
 ])
 
 dnl The maths library.
 ])
 
 dnl The maths library.
-mdw_ORIG_LIBS=$LIBS LIBS=
+mdw_ORIG_LIBS=$LIBS LIBS=$CATACOMB_LIBS
 AC_SEARCH_LIBS([log], [m])
 AC_SEARCH_LIBS([sqrt], [m])
 AC_SEARCH_LIBS([log], [m])
 AC_SEARCH_LIBS([sqrt], [m])
-AC_SUBST([MATHLIBS], [$LIBS])
-LIBS=$mdw_ORIG_LIBS
+CATACOMB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
 
 dnl Logging is weird under Termux.  Unfortunately, it involves macros, so we
 dnl have to do this the hard way.
 
 dnl Logging is weird under Termux.  Unfortunately, it involves macros, so we
 dnl have to do this the hard way.
@@ -279,6 +298,9 @@ AC_CHECK_HEADERS([sys/auxv.h])
 AC_CHECK_HEADERS([linux/auxvec.h])
 AC_CHECK_FUNCS([getauxval])
 
 AC_CHECK_HEADERS([linux/auxvec.h])
 AC_CHECK_FUNCS([getauxval])
 
+dnl Some equipment for measuring CPU performance.
+AC_CHECK_HEADERS([linux/perf_event.h])
+
 dnl Find the bit lengths of the obvious integer types.  This will be useful
 dnl when deciding on a representation for multiprecision integers.
 type_bits="" type_bits_sep=""
 dnl Find the bit lengths of the obvious integer types.  This will be useful
 dnl when deciding on a representation for multiprecision integers.
 type_bits="" type_bits_sep=""
@@ -401,7 +423,7 @@ dnl Set the master libraries we need.
 AC_SUBST([CATACOMB_LIBS])
 
 dnl Necessary support libraries.
 AC_SUBST([CATACOMB_LIBS])
 
 dnl Necessary support libraries.
-PKG_CHECK_MODULES([mLib], [mLib >= 2.2.2.1])
+PKG_CHECK_MODULES([mLib], [mLib >= 2.4.1])
 AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS"
 
 dnl--------------------------------------------------------------------------
 AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS"
 
 dnl--------------------------------------------------------------------------