3 # Process this file with autoconf to produce a configure script.
6 AC_INIT(folly, 0.1, folly@fb.com)
7 AC_CONFIG_SRCDIR([Likely.h])
8 AC_CONFIG_HEADERS([config.h])
9 AX_PREFIX_CONFIG_H([folly-config.h], [folly], [config.h])
10 AC_CONFIG_AUX_DIR([build-aux])
12 AM_INIT_AUTOMAKE([foreign dist-bzip2])
14 AC_CONFIG_MACRO_DIR([m4])
21 # Checks for programs.
24 AC_CXX_COMPILE_STDCXX_0X
26 # Checks for libraries.
27 AC_CHECK_LIB([glog],[openlog],[],[AC_MSG_ERROR(
28 [Please install google-glog library])])
29 AC_CHECK_LIB([gflags],[getenv],[],[AC_MSG_ERROR(
30 [Please install google-gflags library])])
32 # check for boost libs
33 AX_BOOST_BASE([1.20.0], [], [AC_MSG_ERROR(
34 [Please install boost >= 1.20.0 (thread, regex, and system)])])
39 # Checks for header files.
41 AC_CHECK_HEADERS([fcntl.h features.h inttypes.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h mutex.h malloc.h emmintrin.h byteswap.h])
43 AC_CHECK_HEADER(double-conversion.h, [], [AC_MSG_ERROR(
44 [Couldn't find double-conversion.h, please download from \
45 http://code.google.com/p/double-conversion/])], [])
46 AC_CHECK_LIB([double_conversion_pic],[ceil],[],[AC_MSG_ERROR(
47 [Please install double-conversion library])])
49 # Checks for typedefs, structures, and compiler characteristics.
56 AC_CHECK_TYPE([__int128],
57 [AC_DEFINE([HAVE_INT128_T], [1], [Define if __int128 exists])],
58 [AC_DEFINE([HAVE_INT128_T], [0], [Define if __int128 does not exist])])
59 AC_CHECK_TYPES([ptrdiff_t])
61 [AC_LANG_SOURCE[extern "C" void (*test_ifunc(void))() { return 0; }
62 void func() __attribute__((ifunc("test_ifunc")));]],
63 [AC_DEFINE([HAVE_IFUNC], [1], [Define to 1 if the compiler supports ifunc])],
64 [AC_DEFINE([HAVE_IFUNC], [0], [Define to 0 if the compiler doesn't support ifunc])]
67 [AC_LANG_SOURCE[class C { virtual void f() final {} virtual void g() {} };
68 class D : public C { virtual void g() override {} };]],
69 [AC_DEFINE([FINAL], [final],
70 [Define to "final" if the compiler supports C++11 "final"]),
71 AC_DEFINE([OVERRIDE], [override],
72 [Define to "override" if the compiler supports C++11 "override"])],
73 [AC_DEFINE([FINAL], [],
74 [Define to "final" if the compiler supports C++11 "final"]),
75 AC_DEFINE([OVERRIDE], [],
76 [Define to "override" if the compiler supports C++11 "override"])]
79 # Checks for library functions.
80 AC_CHECK_FUNCS([getdelim \
91 if test "$ac_cv_func_pthread_yield" = "no"; then
92 AC_CHECK_HEADERS([sched.h])
93 AC_CHECK_FUNCS([sched_yield])
97 if test "$ac_cv_cxx_compile_cxx0x_cxx" = yes; then
98 CXX_FLAGS="-std=c++0x"
100 if test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
101 CXX_FLAGS="-std=gnu++0x"
104 AC_SUBST(AM_CPPFLAGS, '-I../$(top_srcdir)'" "'-I$(top_srcdir)/io'" "'-I$(top_srcdir)/test'" -lstdc++ $CXX_FLAGS $BOOST_CPPFLAGS")
105 AC_SUBST(AM_CXXFLAGS, "$BOOST_THREAD_LIB $BOOST_SYSTEM_LIB")
107 AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"])
108 AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"])
111 AC_CONFIG_FILES([Makefile
113 test/function_benchmark/Makefile])