summaryrefslogtreecommitdiff
path: root/build_posix
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2014-06-19 17:50:43 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2014-06-19 17:50:43 +1000
commit5e66df5428491a737b92aa48617a3848bf2d73b1 (patch)
treeff8c8cd088dcd396c21a14e0d2483ce91056b772 /build_posix
parentf8ac98d387c0b73a1d419dfc6df94d0bd8b0cd5f (diff)
downloadmongo-5e66df5428491a737b92aa48617a3848bf2d73b1.tar.gz
Add support for --enable-builtins to configure
--enable-builtins will allow users to include some extensions in the WiredTiger library by default. This saves needing to load libraries at runtime.
Diffstat (limited to 'build_posix')
-rw-r--r--build_posix/aclocal/options.m442
1 files changed, 40 insertions, 2 deletions
diff --git a/build_posix/aclocal/options.m4 b/build_posix/aclocal/options.m4
index 6dd7bbe2257..8d1bd8f88eb 100644
--- a/build_posix/aclocal/options.m4
+++ b/build_posix/aclocal/options.m4
@@ -13,6 +13,34 @@ no) wt_cv_enable_attach=no;;
esac
AC_MSG_RESULT($wt_cv_enable_attach)
+AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_SNAPPY,
+ [Snappy support automatically loaded.])
+AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_ZLIB,
+ [Zlib support automatically loaded.])
+AC_MSG_CHECKING(if --with-builtins option specified)
+AC_ARG_WITH(builtins,
+ [AS_HELP_STRING([--with-builtins],
+ [builtin extension names (snappy, zlib).])],
+ [with_builtins=$withval],
+ [with_builtins=])
+
+# Convert to space separated list
+builtin_list=`echo "$with_builtins"|tr -s , ' '`
+
+# Validate and setup each builtin extension library.
+for builtin_i in $builtin_list; do
+ case "$builtin_i" in
+ snappy) AC_DEFINE(HAVE_BUILTIN_EXTENSION_SNAPPY)
+ LIBBUILTINSNAPPY=-lwiredtiger_snappy
+ wt_cv_with_builtin_extension_snappy=yes;;
+ zlib) AC_DEFINE(HAVE_BUILTIN_EXTENSION_ZLIB)
+ LIBBUILTINZLIB=-lwiredtiger_zlib
+ wt_cv_with_builtin_extension_zlib=yes;;
+ *) AC_MSG_ERROR([Unknown builtin extension "$builtin_i"]);;
+ esac
+done
+AC_MSG_RESULT($with_builtins)
+
AC_MSG_CHECKING(if --enable-bzip2 option specified)
AC_ARG_ENABLE(bzip2,
[AS_HELP_STRING([--enable-bzip2],
@@ -81,7 +109,12 @@ AC_ARG_ENABLE(snappy,
[AS_HELP_STRING([--enable-snappy],
[Build the snappy compressor extension.])], r=$enableval, r=no)
case "$r" in
-no) wt_cv_enable_snappy=no;;
+no) if test "$wt_cv_with_builtin_extension_snappy" = "yes"; then
+ wt_cv_enable_snappy=yes
+ else
+ wt_cv_enable_snappy=no
+ fi
+ ;;
*) wt_cv_enable_snappy=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_snappy)
@@ -129,7 +162,12 @@ AC_ARG_ENABLE(zlib,
[AS_HELP_STRING([--enable-zlib],
[Build the zlib compressor extension.])], r=$enableval, r=no)
case "$r" in
-no) wt_cv_enable_zlib=no;;
+no) if test "$wt_cv_with_builtin_extension_zlib" = "yes"; then
+ wt_cv_enable_zlib=yes
+ else
+ wt_cv_enable_zlib=no
+ fi
+ ;;
*) wt_cv_enable_zlib=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_zlib)