Format configure
authorBrian Aker <brian@tangent.org>
Wed, 31 Oct 2012 10:17:04 +0000 (06:17 -0400)
committerBrian Aker <brian@tangent.org>
Wed, 31 Oct 2012 10:17:04 +0000 (06:17 -0400)
configure.ac

index d9d1cd48252cebdfbfe877caa88d0d418a1ffc98..60a6fb575b7193b2cf4df6cf55c7cb4b0bdf2aaf 100644 (file)
@@ -105,8 +105,8 @@ AC_CHECK_PROGS([YACC], ['bison'], [:])
 AX_PROG_SPHINX_BUILD
 
 # Checks for libraries.
-AC_SEARCH_LIBS(getopt_long, gnugetopt)
-AC_SEARCH_LIBS(gethostbyname, nsl)
+AC_SEARCH_LIBS([getopt_long],[gnugetopt])
+AC_SEARCH_LIBS([gethostbyname],[nsl])
 
 # Checks for header files.
 AC_CHECK_HEADERS([arpa/inet.h])
@@ -167,13 +167,12 @@ AC_FUNC_ERROR_AT_LINE
 AC_FUNC_FORK
 AC_FUNC_STRERROR_R
 
-AC_CHECK_HEADER([umem.h], [
-   AC_DEFINE([HAVE_UMEM_H], 1,
-         [Define this if you have umem.h])
-   build_cache=no
-], [build_cache=yes])
+AC_CHECK_HEADER([umem.h],
+                [AC_DEFINE([HAVE_UMEM_H],[1],[Define this if you have umem.h])
+                build_cache=no],
+                [build_cache=yes])
 
-AM_CONDITIONAL([BUILD_CACHE], [test "x$build_cache" = "xyes"])
+AM_CONDITIONAL([BUILD_CACHE],[test "x$build_cache" = "xyes"])
 
 AX_COMPILER_VENDOR
 
@@ -201,49 +200,44 @@ AX_CXX_GCC_ABI_DEMANGLE
 AX_SASL_CHECK
 AX_LIBEVENT
 
-dnl
-dnl The sasl functions should only be visible if we build with sasl support
-dnl
-AS_IF([test "x$ac_enable_sasl" = "xyes"], [
-       [ LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1" ]
-       ],[ LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0" ])
-AC_SUBST(LIBMEMCACHED_WITH_SASL_SUPPORT)
+#
+# The sasl functions should only be visible if we build with sasl support
+#
+AS_IF([test "x$ac_enable_sasl" = "xyes"],
+      [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"],
+      [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0"])
+AC_SUBST([LIBMEMCACHED_WITH_SASL_SUPPORT])
 
-AC_CHECK_LIB([rt],[clock_gettime], [
-              RT_LIB="-lrt"
+AC_CHECK_LIB([rt],[clock_gettime],
+             [RT_LIB="-lrt"
               AC_SUBST(RT_LIB)
-              AC_DEFINE([HAVE_CLOCK_GETTIME], [ 1 ], [Have clock_gettime])
-              ],[
-              AC_DEFINE([HAVE_CLOCK_GETTIME], [ 0 ], [Have clock_gettime])
-              ])
+              AC_DEFINE([HAVE_CLOCK_GETTIME], [ 1 ], [Have clock_gettime])],
+              [AC_DEFINE([HAVE_CLOCK_GETTIME], [ 0 ], [Have clock_gettime])])
 
 # Check for the ability to call dlopen
-AC_CHECK_LIB([dl],[dlopen], [
-              DL_LIB="-ldl"
-              AC_SUBST([DL_LIB])
-              AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])
-              ],[
-                 AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])
-                 ])
+AS_IF([test "x$enable_static" = "xyes"],
+      [AC_CHECK_LIB([dl],[dlopen],
+                    [DL_LIB="-ldl"
+                     AC_SUBST([DL_LIB])
+                     AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])],
+                     [AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])])
 
 AC_CHECK_LIB([m],[floor])
 AC_CHECK_FUNCS([sigignore])
 
 AC_CHECK_HEADERS([atomic.h])
-AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],[
-      AC_CHECK_FUNCS([atomic_add_64])
+AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],
+      [AC_CHECK_FUNCS([atomic_add_64])
       AC_CHECK_FUNCS([atomic_add_32])
-      AS_IF([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],[
-            AC_DEFINE([USE_ATOMIC_H],
-                     [1],
-                      [Define to true if you want to use functions from atomic.h])])])
-
-AC_DEFINE([HAVE_LIBDRIZZLE], [0], [Support for libdrizzle])
-AC_DEFINE([HAVE_DRIZZLED_BINARY], [0], [Support for DrizzleD])
-AC_DEFINE([DRIZZLED_BINARY], [0], [Support for DrizzleD])
-AC_DEFINE([GEARMAND_BLOBSLAP_WORKER], [0], [Support for Gearman Blobslap worker])
-AC_DEFINE([HAVE_LIBPQ], [0], [Support for Postgres])
-AC_DEFINE([HAVE_LIBCURL], [0], [Support for libcurl])
+      AS_IF([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"],
+            [AC_DEFINE([USE_ATOMIC_H],[1],[Define to true if you want to use functions from atomic.h])])])
+
+AC_DEFINE([HAVE_LIBDRIZZLE],[0],[Support for libdrizzle])
+AC_DEFINE([HAVE_DRIZZLED_BINARY],[0],[Support for DrizzleD])
+AC_DEFINE([DRIZZLED_BINARY],[0],[Support for DrizzleD])
+AC_DEFINE([GEARMAND_BLOBSLAP_WORKER],[0],[Support for Gearman Blobslap worker])
+AC_DEFINE([HAVE_LIBPQ],[0],[Support for Postgres])
+AC_DEFINE([HAVE_LIBCURL],[0],[Support for libcurl])
 
 dnl Check for the requirements for running memcached with less privileges
 dnl than the default privilege set. On Solaris we need setppriv and priv.h
@@ -262,11 +256,11 @@ AC_CHECK_FUNCS([setppriv],
 AC_CHECK_HEADERS_ONCE([winsock2.h poll.h sys/wait.h fnmatch.h])
 AM_CONDITIONAL([BUILD_POLL],[test "x$ac_cv_header_poll_h" = "xno"])
 AM_CONDITIONAL([BUILD_WIN32_WRAPPERS],[test "x$ac_cv_header_winsock2_h" = "xyes"])
-AS_IF(test "x$ac_cv_header_winsock2_h" = "xyes",
+AS_IF([test "x$ac_cv_header_winsock2_h" = "xyes"],
       [AM_LDFLAGS="$AM_LDFLAGS -lws2_32"
        AM_CFLAGS="$AM_CFLAGS $NO_WERROR"
        AM_CXXFLAGS="$AM_CXXFLAGS $NO_WERROR"
-      ])
+       ])
 SOCKET_SEND_FLAGS
 
 AX_UUID_GENERATE_TIME_SAFE
@@ -275,6 +269,10 @@ AX_UUID_GENERATE_TIME_SAFE
 AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])])
 AX_PTHREAD_TIMEDJOIN_NP
 
+# backtrace() does not work with static builds.
+AS_IF([test "x$enable_static" = "xyes"],
+      [AC_DEFINE([AX_ENABLE_BACKTRACE],[1],[Support for backtrace().])])
+
 PANDORA_ENABLE_DTRACE
 AX_ENDIAN
 AX_ASSERT
@@ -283,13 +281,12 @@ AX_HARDEN_COMPILER_FLAGS
 
 AX_AM_JOBSERVER([yes])
 
-AC_CONFIG_FILES([
-  Makefile
-  docs/conf.py
-  libmemcached-1.0/configure.h
-  support/libmemcached.pc
-  support/libmemcached.spec
-  ])
+AC_CONFIG_FILES([Makefile
+                 docs/conf.py
+                 libmemcached-1.0/configure.h
+                 support/libmemcached.pc
+                 support/libmemcached.spec
+                 ])
 AC_OUTPUT
 
 echo "---"