summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-07 13:55:31 +0200
committerMichael Adam <obnox@samba.org>2008-07-07 20:34:03 +0200
commite9d5d97a3f182419ce5979591a510e18e37a64a1 (patch)
tree86ffacd427307b2a5f94449e425f5e9df383af1a
parent1c7123f3a6ea23589d374e66b0f2af91595a15da (diff)
downloadsamba-e9d5d97a3f182419ce5979591a510e18e37a64a1.tar.gz
samba-e9d5d97a3f182419ce5979591a510e18e37a64a1.tar.bz2
samba-e9d5d97a3f182419ce5979591a510e18e37a64a1.zip
build: extend SMB_LIBRARY() to optionally take default value.
The default value defaults to "yes". If no is specified, an optional third argument contains the reason why building of the shared library is turned off by default. Michael (This used to be commit af971f79c7d736eb5b7ae8fcd4b2bf7ccf4834f3)
-rw-r--r--source3/m4/aclocal.m429
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/m4/aclocal.m4 b/source3/m4/aclocal.m4
index 25f9912bef..d63d121455 100644
--- a/source3/m4/aclocal.m4
+++ b/source3/m4/aclocal.m4
@@ -54,7 +54,7 @@ AC_DEFUN(SMB_SUBSYSTEM,
])
-dnl SMB_LIBRARY(name)
+dnl SMB_LIBRARY(name, default)
dnl
dnl configure build and use of an (internal) shared library
dnl
@@ -81,6 +81,32 @@ AC_SUBST([INSTALL_]LIBUC)
AC_SUBST([UNINSTALL_]LIBUC)
AC_MSG_CHECKING([whether to build the LIBNAME shared library])
+m4_if([$2], [no], [
+dnl set the default to not build the shared lib
+AC_ARG_WITH(LIBNAME,
+AS_HELP_STRING([--with-]LIBNAME,
+ m4_if([$3], [],
+ [Build the LIBNAME shared library (default=no)],
+ [Build the LIBNAME shared library (default=no ($3))])),
+[
+case "$withval" in
+ yes)
+ build_lib=yes
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ build_lib=no
+ ;;
+esac
+],
+[
+# if unspecified, default is not to build
+AC_MSG_RESULT(yes)
+build_lib=no
+]
+)
+],[
+dnl by default, try to build the shared lib
AC_ARG_WITH(LIBNAME,
AS_HELP_STRING([--with-]LIBNAME,
[Build the LIBNAME shared library (default=yes if shared libs supported)]),
@@ -100,6 +126,7 @@ esac
build_lib=yes
]
)
+])
if eval test x"$build_lib" = "xyes" ; then
# only set the install targets if the user chose the library