summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKevin Lin <developer@kevinlin.info>2020-03-24 11:10:34 -0700
committerdormando <dormando@rydia.net>2020-03-26 13:02:02 -0700
commit38ce7b8531bd13ed3523658f4189e78606c885b1 (patch)
treea9a1bc7b50fc4fd6b9631f0ef907bf6d3f7fb6ff /configure.ac
parentdfb7eb468f06dbcb9abca68c0ff3a89eb3bf80de (diff)
downloadmemcached-38ce7b8531bd13ed3523658f4189e78606c885b1.tar.gz
./configure --enable-static for static builds
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f5b64fd..0fd5c8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,9 @@ AC_ARG_ENABLE(tls,
AC_ARG_ENABLE(asan,
[AS_HELP_STRING([--enable-asan], [Compile with ASAN EXPERIMENTAL ])])
+AC_ARG_ENABLE(static,
+ [AS_HELP_STRING([--enable-static], [Compile a statically linked binary])])
+
dnl **********************************************************************
dnl DETECT_SASL_CB_GETCONF
dnl
@@ -206,6 +209,10 @@ if test "x$enable_asan" = "xyes"; then
AC_DEFINE([ASAN],1,[Set to nonzero if you want to compile using ASAN])
fi
+if test "x$enable_static" = "xyes"; then
+ AC_DEFINE([STATIC],1,[Set to nonzero if you want to compile a statically linked binary])
+fi
+
AM_CONDITIONAL([BUILD_DTRACE],[test "$build_dtrace" = "yes"])
AM_CONDITIONAL([DTRACE_INSTRUMENT_OBJ],[test "$dtrace_instrument_obj" = "yes"])
AM_CONDITIONAL([ENABLE_SASL],[test "$enable_sasl" = "yes"])
@@ -213,6 +220,7 @@ AM_CONDITIONAL([ENABLE_EXTSTORE],[test "$enable_extstore" != "no"])
AM_CONDITIONAL([ENABLE_ARM_CRC32],[test "$enable_arm_crc32" = "yes"])
AM_CONDITIONAL([ENABLE_TLS],[test "$enable_tls" = "yes"])
AM_CONDITIONAL([ENABLE_ASAN],[test "$enable_asan" = "yes"])
+AM_CONDITIONAL([ENABLE_STATIC],[test "$enable_static" = "yes"])
AC_SUBST(DTRACE)
@@ -464,6 +472,11 @@ if test "x$enable_tls" = "xyes"; then
fi
fi
+if test "x$enable_static" = "xyes"; then
+ LIBS="$LIBS -ldl"
+ LDFLAGS="-static $LDFLAGS"
+fi
+
dnl ----------------------------------------------------------------------------
AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs)