|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_INIT(libtdata, m4_esyscmd([tr -d '\n' < VERSION]))
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([1.11])
|
|
|
|
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
LT_INIT
|
|
|
|
|
|
|
|
# Checks for pointer size.
|
|
|
|
# TODO: Later this is irrelevant, and we should just bail on 32-bit platforms always
|
|
|
|
AC_CHECK_SIZEOF([uintptr_t])
|
|
|
|
if test "x$ac_cv_sizeof_uintptr_t" == "x"; then
|
|
|
|
AC_ERROR([Cannot determine size of uintptr_t])
|
|
|
|
fi
|
|
|
|
AC_SUBST(ac_cv_sizeof_uintptr_t)
|
|
|
|
|
|
|
|
if test "${ac_cv_sizeof_uintptr_t}" = "4"; then
|
|
|
|
AC_DEFINE([BUILD_HOST_32BIT], 1, [Define to 1 if host is 32bit])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl **************************************
|
|
|
|
dnl ***** tests for compiler built-ins *****
|
|
|
|
dnl **************************************
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_8],
|
|
|
|
[ctrie_cv_func___sync_bool_compare_and_swap_8],
|
|
|
|
[AC_LINK_IFELSE([
|
|
|
|
typedef unsigned int uint64 __attribute__ ((mode (DI)));
|
|
|
|
uint64 i;
|
|
|
|
int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
|
|
|
|
],
|
|
|
|
[ctrie_cv_func___sync_bool_compare_and_swap_8=yes],
|
|
|
|
[ctrie_cv_func___sync_bool_compare_and_swap_8=no])])
|
|
|
|
if test "$ctrie_cv_func___sync_bool_compare_and_swap_8" = "yes"; then
|
|
|
|
AC_DEFINE([HAVE__SYNC_BOOL_COMPARE_AND_SWAP_8], 1,
|
|
|
|
[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint64])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl *****************
|
|
|
|
dnl ***** options *****
|
|
|
|
dnl *****************
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([build_examples],
|
|
|
|
AS_HELP_STRING([--enable-build-examples], [Enable examples build]))
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_build_examples" = "xyes"], [
|
|
|
|
AC_DEFINE([BUILD_EXAMPLES], 1, [build of examples enabled])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
lib/libtdata.pc
|
|
|
|
lib/Makefile
|
|
|
|
include/Makefile])
|