Add library version information
[urcu.git] / configure.ac
index 612297861716584fdfc667bb739655e5c219b414..179cb7d9643584a72b0edbd7845a43e95b223132 100644 (file)
@@ -2,22 +2,30 @@
 # Process this file with autoconf to produce a configure script.
 
 
-AC_INIT([userspace-rcu], [0.3.3], [mathieu dot desnoyers at polymtl dot ca])
+AC_INIT([userspace-rcu], [0.5.4], [mathieu dot desnoyers at efficios dot com])
+
+# Following the numbering scheme proposed by libtool for the library version
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+AC_SUBST([URCU_LIBRARY_VERSION], [1:0:0])
+
 AC_CONFIG_AUX_DIR([config])
 AC_CANONICAL_TARGET
 AC_CANONICAL_HOST
 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
 AC_CONFIG_SRCDIR([urcu.h])
 AM_PROG_MKDIR_P
 
 AC_CONFIG_HEADERS([config.h urcu/config.h])
 
 # Keep at the end to do not pollute installed header.
-AH_TEMPLATE([CONFIG_URCU_SMP], [Enable SMP support. With SMP support enabled, uniprocessors are also supported. With SMP support disabled, UP systems work fine, but the behavior of SMP systems is undefined.])
-AH_TEMPLATE([CONFIG_URCU_HAVE_FENCE], [Defined when on a system that has memory fence instructions.])
-AH_TEMPLATE([CONFIG_URCU_HAVE_FUTEX], [Defined when on a system with futex support.])
-AH_TEMPLATE([CONFIG_URCU_COMPAT_ARCH], [Compatibility mode for i386 which lacks
+AH_TEMPLATE([CONFIG_RCU_SMP], [Enable SMP support. With SMP support enabled, uniprocessors are also supported. With SMP support disabled, UP systems work fine, but the behavior of SMP systems is undefined.])
+AH_TEMPLATE([CONFIG_RCU_HAVE_FENCE], [Defined when on a system that has memory fence instructions.])
+AH_TEMPLATE([CONFIG_RCU_HAVE_FUTEX], [Defined when on a system with futex support.])
+AH_TEMPLATE([CONFIG_RCU_COMPAT_ARCH], [Compatibility mode for i386 which lacks
 cmpxchg instruction.])
+AH_TEMPLATE([CONFIG_RCU_ARM_HAVE_DMB], [Use the dmb instruction is available for use on ARM.])
 
 # Checks for programs.
 AC_PROG_CC
@@ -32,7 +40,7 @@ AC_TYPE_SIZE_T
 # Checks for library functions.
 AC_FUNC_MALLOC
 AC_FUNC_MMAP
-AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul])
+AC_CHECK_FUNCS([bzero gettimeofday munmap sched_getcpu strtoul sysconf])
 
 # Find arch type
 case $host_cpu in
@@ -48,12 +56,42 @@ case $host_cpu in
        s390) ARCHTYPE="s390" ;;
        s390x) ARCHTYPE="s390" ;;
        sparc64) ARCHTYPE="sparc64" ;;
+       alpha*) ARCHTYPE="alpha" ;;
+       ia64) ARCHTYPE="gcc" ;;
+       arm*) ARCHTYPE="arm" ;;
        *) ARCHTYPE="unknown";;
 esac
 
-if test "$ARCHTYPE" = "unknown"; then
-       AC_MSG_ERROR([Unable to detect the architecture.])
+if test "x$ARCHTYPE" = "xarm" ; then
+AC_MSG_CHECKING([checking for dmb instruction])
+AC_TRY_COMPILE(
+[
+],
+[
+asm volatile("dmb":::"memory");
+],
+[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE([CONFIG_RCU_ARM_HAVE_DMB], [1])
+]
+,
+[
+       AC_MSG_RESULT([no])
+]
+)
 fi
+
+UATOMICSRC=urcu/uatomic_arch_$ARCHTYPE.h
+ARCHSRC=urcu/arch_$ARCHTYPE.h
+if test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc; then
+       APISRC=tests/api_gcc.h
+else
+       APISRC=tests/api_$ARCHTYPE.h
+fi
+if test "$ARCHTYPE" == "armv7l"; then
+       CFLAGS="-mcpu=cortex-a9 -mtune=cortex-a9 -O"
+fi
+
 AC_SUBST(ARCHTYPE)
 AC_SUBST(SUBARCHTYPE)
 
@@ -64,7 +102,7 @@ AC_SUBST(SUBARCHTYPE)
 #Only using fence for x86_64.
 if test "x$ARCHTYPE" = "xx86" -a "x$host_cpu" != "xi386" -a "x$host_cpu" != "xi486" -a "x$host_cpu" != "xi586" -a "x$host_cpu" != "xi686"; then
 ]
-       AC_DEFINE([CONFIG_URCU_HAVE_FENCE], [1])
+       AC_DEFINE([CONFIG_RCU_HAVE_FENCE], [1])
 [
 fi
 ]
@@ -81,7 +119,7 @@ AC_TRY_COMPILE(
 ],
 [
        AC_MSG_RESULT([yes])
-       AC_DEFINE([CONFIG_URCU_HAVE_FUTEX], [1])
+       AC_DEFINE([CONFIG_RCU_HAVE_FUTEX], [1])
        compat_futex_test=0
 ]
 ,
@@ -93,14 +131,12 @@ AC_TRY_COMPILE(
 
 AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ])
 
-AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc])
-
 AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ])
 
 [
 if test "x$SUBARCHTYPE" = xx86compat; then
 ]
-       AC_DEFINE([CONFIG_URCU_COMPAT_ARCH], [1])
+       AC_DEFINE([CONFIG_RCU_COMPAT_ARCH], [1])
 [
 fi
 ]
@@ -113,7 +149,7 @@ if test "$def_smp_support" = "no"; then
        echo "SMP support disabled."
 else
 ]
-       AC_DEFINE([CONFIG_URCU_SMP], [1])
+       AC_DEFINE([CONFIG_RCU_SMP], [1])
 [
        echo "SMP support enabled."
 fi
@@ -202,8 +238,18 @@ AC_CHECK_FUNCS(
 
 CFLAGS=$saved_CFLAGS
 
+AC_CONFIG_LINKS([
+       urcu/arch.h:$ARCHSRC
+       urcu/uatomic_arch.h:$UATOMICSRC
+       tests/api.h:$APISRC
+])
 AC_CONFIG_FILES([
        Makefile
        tests/Makefile
+       liburcu.pc
+       liburcu-bp.pc
+       liburcu-qsbr.pc
+       liburcu-mb.pc
+       liburcu-signal.pc
 ])
 AC_OUTPUT
This page took 0.024078 seconds and 4 git commands to generate.