summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-22 12:19:18 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-22 12:19:18 +0000
commit0dde23a7b24edf1cbf4d7d7e5afea485e37498e5 (patch)
tree57d2881ccdb24a6217d0a85216a0447c0fb301d3 /source3/configure.in
parentdb94beaa41d6c2c82ee9351a171f2a73a9e358da (diff)
downloadsamba-0dde23a7b24edf1cbf4d7d7e5afea485e37498e5.tar.gz
samba-0dde23a7b24edf1cbf4d7d7e5afea485e37498e5.tar.bz2
samba-0dde23a7b24edf1cbf4d7d7e5afea485e37498e5.zip
Fixes from Paul Green and vorlon@debian.org for building shared libraries
(make it possible to build both shared and static) and -lcrypt handling. (This used to be commit 30510f50077fd157664c127ac0182ce26843d43f)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in67
1 files changed, 35 insertions, 32 deletions
diff --git a/source3/configure.in b/source3/configure.in
index dfd97bc42f..66bdf5edf1 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -6,6 +6,9 @@ AC_PREREQ(2.53)
AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
+AC_DISABLE_STATIC
+AC_ENABLE_SHARED
+
#################################################
# Directory handling stuff to support both the
# legacy SAMBA directories and FHS compliant
@@ -727,11 +730,6 @@ fi
AC_FUNC_MEMCMP
###############################################
-# test for where we get crypt() from
-AC_SEARCH_LIBS(crypt, [crypt], [AUTHLIBS="$AUTHLIBS -lcrypt";
- AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
-
-###############################################
# Readline included by default unless explicitly asked not to
test "${with_readline+set}" != "set" && with_readline=yes
@@ -952,9 +950,8 @@ AC_LIBTESTFUNC(sec, bigcrypt)
AC_LIBTESTFUNC(security, getprpwnam)
AC_LIBTESTFUNC(sec, getprpwnam)
-# this bit needs to be modified for each OS that is suported by
-# smbwrapper. You need to specify how to created a shared library and
-# how to compile C code to produce PIC object files
+# Assume non-shared by default and override below
+BLDSHARED="false"
# these are the defaults, good for lots of systems
HOST_OS="$host_os"
@@ -965,12 +962,16 @@ PICFLAG=""
PICSUFFIX="po"
POBAD_CC="#"
SHLIBEXT="so"
-# Assume non-shared by default and override below
-BLDSHARED="false"
-AC_MSG_CHECKING([ability to build shared libraries])
-# and these are for particular systems
-case "$host_os" in
+if test "$enable_shared" = "yes"; then
+ # this bit needs to be modified for each OS that is suported by
+ # smbwrapper. You need to specify how to created a shared library and
+ # how to compile C code to produce PIC object files
+
+ AC_MSG_CHECKING([ability to build shared libraries])
+
+ # and these are for particular systems
+ case "$host_os" in
*linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux])
BLDSHARED="true"
LDSHFLAGS="-shared"
@@ -1114,13 +1115,14 @@ case "$host_os" in
*)
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
-esac
-AC_SUBST(DYNEXP)
-AC_MSG_RESULT($BLDSHARED)
-AC_MSG_CHECKING([linker flags for shared libraries])
-AC_MSG_RESULT([$LDSHFLAGS])
-AC_MSG_CHECKING([compiler flags for position-independent code])
-AC_MSG_RESULT([$PICFLAGS])
+ esac
+ AC_SUBST(DYNEXP)
+ AC_MSG_RESULT($BLDSHARED)
+ AC_MSG_CHECKING([linker flags for shared libraries])
+ AC_MSG_RESULT([$LDSHFLAGS])
+ AC_MSG_CHECKING([compiler flags for position-independent code])
+ AC_MSG_RESULT([$PICFLAGS])
+fi
#######################################################
# test whether building a shared library actually works
@@ -2408,15 +2410,10 @@ AC_ARG_WITH(pam_smbpass,
###############################################
-# test for where we get crypt() from, but only
-# if not using PAM
-if test x"$with_pam_for_crypt" = x"no"; then
-AC_CHECK_FUNCS(crypt)
-if test x"$ac_cv_func_crypt" = x"no"; then
- AC_CHECK_LIB(crypt, crypt, [AUTHLIBS="$AUTHLIBS -lcrypt";
- AC_DEFINE(HAVE_CRYPT,1,[Whether crypt() is available])])
-fi
-fi
+# test for where we get crypt() from
+AC_SEARCH_LIBS(crypt, [crypt],
+ [test "$ac_cv_search_crypt" = "none required" || AUTHLIBS="-lcrypt $AUTHLIBS"
+ AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
##
## moved after the check for -lcrypt in order to
@@ -2673,9 +2670,12 @@ AC_ARG_WITH(libsmbclient,
LIBSMBCLIENT=libsmbclient
AC_MSG_RESULT(yes)
else
+ enable_static=yes
+ AC_MSG_RESULT(no shared library support -- will supply static library)
+ fi
+ if test $enable_static = yes; then
INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
LIBSMBCLIENT=libsmbclient
- AC_MSG_RESULT(no shared library support -- will supply static library)
fi
;;
esac ],
@@ -2686,10 +2686,13 @@ AC_ARG_WITH(libsmbclient,
LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
LIBSMBCLIENT=libsmbclient
AC_MSG_RESULT(yes)
- else
+ else
+ enable_static=yes
+ AC_MSG_RESULT(no shared library support -- will supply static library)
+ fi
+ if test $enable_static = yes; then
INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
LIBSMBCLIENT=libsmbclient
- AC_MSG_RESULT(no shared library support -- will supply static library)
fi]
)