AC_SUBST(WRAP)
AC_SUBST(WRAP32)
AC_SUBST(PICFLAG)
+AC_SUBST(PICSUFFIX)
+AC_SUBST(POBAD_CC)
AC_SUBST(SHLIBEXT)
-AC_SUBST(BLDSHARED)
+AC_SUBST(LIBSMBCLIENT_SHARED)
# compile with optimisation and without debugging by default
CFLAGS="-O ${CFLAGS}"
-AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
+AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
[if eval "test x$enable_debug = xyes"; then
CFLAGS="${CFLAGS} -g"
fi])
+AC_ARG_ENABLE(developer, [ --enable-developer turn on developer warnings and debugging [default=no]],
+ [if eval "test x$enable_developer = xyes"; then
+ CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
+ fi])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_AWK
+dnl needed before AC_TRY_COMPILE
+AC_ISC_POSIX
+
dnl Check if C compiler understands -c and -o at the same time
AC_PROG_CC_C_O
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
fi
-#################################################
-# set codepage directory location
-AC_ARG_WITH(codepagedir,
-[ --with-codepagedir=DIR Where to put codepage files (\$libdir/codepages)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody does it
- #
- AC_MSG_WARN([--with-codepagedir called without argument - will use default])
- ;;
- * )
- codepagedir="$withval"
- ;;
- esac])
-
-
AC_CANONICAL_SYSTEM
dnl Add #include for broken IRIX header files
# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
*hpux*)
AC_PROG_CC_FLAG(Ae)
+ # mmap on HPUX is completely broken...
+ AC_DEFINE(MMAP_BLACKLIST)
if test $ac_cv_prog_cc_Ae = yes; then
CPPFLAGS="$CPPFLAGS -Ae"
fi
#
*solaris*)
case `uname -r` in
- 5.6*|5.7*)
+ 5.0*|5.1*|5.2*|5.3*|5.5*)
+ AC_MSG_RESULT([no large file support])
+ ;;
+ 5.*)
AC_MSG_RESULT([enabling large file support])
if test "$ac_cv_prog_gcc" = yes; then
${CC-cc} -v >conftest.c 2>&1
AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
-AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
+AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
-AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h)
+AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h sasl.h)
#
# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(wchar_t, unsigned short)
-# we need libcups for CUPS support...
+############################################
+# for cups support we need libcups, and a handful of header files
+
AC_CHECK_LIB(cups,httpConnect)
+# I wonder if there is a nicer way of doing this?
+
+if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
+ AC_CHECK_HEADERS(cups/cups.h cups/language.h)
+ if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
+ if test x"$ac_cv_header_cups_language_h" = x"yes"; then
+ AC_DEFINE(HAVE_CUPS)
+ fi
+ fi
+fi
+
+############################################
# we need libdl for PAM and the new VFS code
AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
AC_DEFINE(HAVE_LIBDL)])
+############################################
+# check if the compiler can do immediate structures
+AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
+ AC_TRY_COMPILE([
+#include <stdio.h>],
+[
+ #define X_FOOBAR(x) ((FOOBAR) { x })
+ typedef struct {unsigned x;} FOOBAR;
+ FOOBAR f = X_FOOBAR(1);
+],
+ samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
+if test x"$samba_cv_immediate_structures" = x"yes"; then
+ AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES)
+fi
+
+############################################
+# check for unix domain sockets
+AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>],
+[
+ struct sockaddr_un sunaddr;
+ sunaddr.sun_family = AF_UNIX;
+],
+ samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
+if test x"$samba_cv_unixsocket" = x"yes"; then
+ AC_DEFINE(HAVE_UNIXSOCKET)
+fi
+
+
AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
AC_TRY_COMPILE([
#include <sys/types.h>
# test for where we get readline() from
AC_MSG_CHECKING(whether to use readline)
AC_ARG_WITH(readline,
-[ --with-readline[=DIR] Look for readline include/libs in DIR
- --without-readline Don't include readline support],
+[ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ],
[ case "$with_readline" in
yes)
AC_MSG_RESULT(yes)
AC_SUBST(TERMLIBS)
AC_SUBST(TERMLDFLAGS)
+# The readline API changed slightly from readline3 to readline4, so
+# code will generate warnings on one of them unless we have a few
+# special cases.
+AC_CHECK_LIB(readline, rl_completion_matches,
+ [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
+ [Do we have rl_completion_matches?])],
+ [],
+ [$TERMLIBS])
+
# The following test taken from the cvs sources
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
fi
AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
-AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
+AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat)
AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
-AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
+AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
fi
fi
-#
-# If no strcasecmp, check for it in some known places
-# It is in -lresolv on ReliantUNIX and UnixWare
-# -lresolve *must* follow -lnsl for name resolution to work properly
-#
-
-if test x$ac_cv_func_strcasecmp = xno ; then
- AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
- AC_DEFINE(HAVE_STRCASECMP))
-fi
+#####################################
+# we might need the resolv library on some systems
+AC_CHECK_LIB(resolv, dn_expand)
#
# Check for the functions putprpwnam, set_auth_parameters,
LDSHFLAGS="-shared"
SHLD="\${CC}"
PICFLAG=""
+PICSUFFIX="po"
+POBAD_CC="#"
SHLIBEXT="so"
BLDSHARED="false"
;;
*solaris*) AC_DEFINE(SUNOS5)
BLDSHARED="true"
- LDSHFLAGS="-Wl,-soname,\$@ -shared"
- PICFLAG="-KPIC -xO4"
+ LDSHFLAGS="-Wl,-h,\$@.so -G"
+ if test "${ac_cv_prog_CC}" = "gcc"; then
+ PICFLAG="-fPIC"
+ else
+ PICFLAG="-KPIC"
+ POBAD_CC=""
+ PICSUFFIX="po.o"
+ fi
;;
*sunos*) AC_DEFINE(SUNOS4)
BLDSHARED="true"
LDSHFLAGS="-Wl,-h,\$@ -G"
- PICFLAG="-KPIC -O2" # Is this correct for SunOS
+ PICFLAG="-KPIC" # Is this correct for SunOS
;;
*bsd*) BLDSHARED="true"
LDSHFLAGS="-Wl,-soname,\$@ -shared"
- PICFLAG="-fPIC -O2"
+ PICFLAG="-fPIC"
;;
*irix*) AC_DEFINE(IRIX)
case "$host_os" in
ATTEMPT_WRAP32_BUILD=yes
BLDSHARED="true"
LDSHFLAGS="-Wl,-soname,\$@ -shared"
- PICFLAG="-fPIC"
+ if test "${ac_cv_prog_CC}" = "gcc"; then
+ PICFLAG="-fPIC"
+ else
+ PICFLAG="-KPIC"
+ fi
;;
*aix*) AC_DEFINE(AIX)
BLDSHARED="true"
SHLIBEXT="sl"
# Use special PIC flags for the native HP-UX compiler.
if test $ac_cv_prog_cc_Ae = yes; then
- BLDSHARED="true"
+ #BLDSHARED="true"
LDSHFLAGS="-b -z +h \$@"
PICFLAG="+z"
fi
*sco*) AC_DEFINE(SCO);;
*unixware*) AC_DEFINE(UNIXWARE)
BLDSHARED="true"
+ LDSHFLAGS="-Wl,-soname,\$@ -shared"
+ PICFLAG="-KPIC"
;;
*next2*) AC_DEFINE(NEXT2);;
*dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
;;
esac
+# this updates our target list if we can build shared libs
+if test $BLDSHARED = true; then
+ LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
+else
+ LIBSMBCLIENT_SHARED=
+fi
+
################
AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
AC_DEFINE(HAVE_UX_UT_SYSLEN)
fi
+
+#################################################
+# check for libiconv support
+AC_MSG_CHECKING(whether to use libiconv)
+AC_ARG_WITH(libiconv,
+[ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
+[ case "$withval" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ CFLAGS="$CFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ AC_CHECK_LIB(iconv, iconv_open)
+ AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}")
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
+
+
############
-# check for iconv in libc, and if not then we build our own
+# check for iconv in libc
AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
AC_TRY_RUN([
#include <iconv.h>
main() {
- iconv_t cd = iconv_open("ASCII", "UCS2");
+ iconv_t cd = iconv_open("ASCII", "UCS-2LE");
if (cd == 0 || cd == (iconv_t)-1) return -1;
return 0;
}
fi
fi
-AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
-AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
- samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
-if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
- AC_DEFINE(HAVE_TRUNCATED_SALT)
+
+case "$host_os" in
+*linux*)
+AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_CAPABILITY_H
+#include <sys/capability.h>
+#endif
+],[int i;],
+ samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
+if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
+ AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS)
fi
+;;
+esac
AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
AC_TRY_COMPILE([#include <sys/acl.h>
#if defined(HAVE_RPCSVC_NIS_H)
#include <rpcsvc/nis.h>
#endif],
-[return 0;],
+[int i;],
samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES)
# check for smbwrapper support
AC_MSG_CHECKING(whether to use smbwrapper)
AC_ARG_WITH(smbwrapper,
-[ --with-smbwrapper Include SMB wrapper support
- --without-smbwrapper Don't include SMB wrapper support (default)],
+[ --with-smbwrapper Include SMB wrapper support (default=no) ],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
)
#################################################
-# check for the AFS filesystem
-AC_MSG_CHECKING(whether to use AFS)
+# check for AFS clear-text auth support
+AC_MSG_CHECKING(whether to use AFS clear-text auth)
AC_ARG_WITH(afs,
-[ --with-afs Include AFS support
- --without-afs Don't include AFS support (default)],
+[ --with-afs Include AFS clear-text auth support (default=no) ],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
#################################################
-# check for the DFS auth system
-AC_MSG_CHECKING(whether to use DFS auth)
+# check for the DFS clear-text auth system
+AC_MSG_CHECKING(whether to use DFS clear-text auth)
AC_ARG_WITH(dfs,
-[ --with-dfs Include DFS support
- --without-dfs Don't include DFS support (default)],
+[ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
)
-#################################################
-# check for Kerberos IV auth system
-AC_MSG_CHECKING(whether to use Kerberos IV)
-AC_ARG_WITH(krb4,
-[ --with-krb4=base-dir Include Kerberos IV support
- --without-krb4 Don't include Kerberos IV support (default)],
-[ AC_MSG_RESULT(yes)
- AC_DEFINE(KRB4_AUTH)
- AC_CHECK_LIB(resolv, dn_expand)
- LIBS="$LIBS -lkrb -ldes"
- CFLAGS="$CFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"],
- AC_MSG_RESULT(no)
-)
#################################################
-# check for Kerberos 5 auth system
-AC_MSG_CHECKING(whether to use Kerberos 5)
+# check for location of Kerberos 5 install
+AC_MSG_CHECKING(for kerberos 5 install path)
AC_ARG_WITH(krb5,
-[ --with-krb5=base-dir Include Kerberos 5 support
- --without-krb5 Don't include Kerberos 5 support (default)],
-[ AC_MSG_RESULT(yes)
- AC_DEFINE(KRB5_AUTH)
- LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
+[ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
+[ case "$withval" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ LIBS="$LIBS -lkrb5"
CFLAGS="$CFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"],
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ AC_DEFINE(HAVE_KRB5)
+ have_krb5=yes;
+ ;;
+ esac ],
AC_MSG_RESULT(no)
)
+##################################################################
+# we might need the k5crypto and com_err libraries on some systems
+AC_CHECK_LIB(com_err, _et_list, [LIBS="$LIBS -lcom_err"])
+AC_CHECK_LIB(k5crypto, krb5_encrypt_data, [LIBS="$LIBS -lk5crypto"])
+
+
+########################################################
+# now see if we can find the krb5 libs in standard paths
+if test x$have_krb5 != xyes; then
+AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
+ AC_DEFINE(HAVE_KRB5)])
+fi
+
+########################################################
+# now see if we can find the ldap libs in standard paths
+if test x$have_ldap != xyes; then
+AC_CHECK_LIB(ldap, ldap_open, [LIBS="$LIBS -lldap";
+ AC_DEFINE(HAVE_LDAP)])
+fi
+AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
+
+
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use AUTOMOUNT)
AC_ARG_WITH(automount,
-[ --with-automount Include AUTOMOUNT support
- --without-automount Don't include AUTOMOUNT support (default)],
+[ --with-automount Include AUTOMOUNT support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
# check for smbmount support
AC_MSG_CHECKING(whether to use SMBMOUNT)
AC_ARG_WITH(smbmount,
-[ --with-smbmount Include SMBMOUNT (Linux only) support
- --without-smbmount Don't include SMBMOUNT support (default)],
+[ --with-smbmount Include SMBMOUNT (Linux only) support (default=no)],
[ case "$withval" in
yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_SMBMOUNT)
- MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
+ case "$host_os" in
+ *linux*)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_SMBMOUNT)
+ MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
+ ;;
+ *)
+ AC_MSG_ERROR(not on a linux system!)
+ ;;
+ esac
;;
*)
AC_MSG_RESULT(no)
#################################################
-# check for a PAM password database
-
-AC_MSG_CHECKING(whether to use PAM password database)
+# check for a PAM clear-text auth, accounts, password and session support
+with_pam_for_crypt=no
+AC_MSG_CHECKING(whether to use PAM)
AC_ARG_WITH(pam,
-[ --with-pam Include PAM password database support
- --without-pam Don't include PAM password database support (default)],
+[ --with-pam Include PAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_PAM)
LIBS="$LIBS -lpam"
+ with_pam_for_crypt=yes
;;
*)
AC_MSG_RESULT(no)
# check for pam_smbpass support
AC_MSG_CHECKING(whether to use pam_smbpass)
AC_ARG_WITH(pam_smbpass,
-[ --with-pam_smbpass Include the smbpass PAM module
- --without-pam_smbpass Don't include the smbpass PAM module (default)],
+[ --with-pam_smbpass Build a PAM module to allow other applications to use our smbpasswd file (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_MSG_RESULT([No libpam found -- disabling pam_smbpass])
PAM_MOD=""
else
- AC_DEFINE(WITH_PAM_SMBPASS)
PAM_MOD="bin/pam_smbpass.so"
fi
;;
###############################################
# test for where we get crypt() from, but only
# if not using PAM
-if test "$with_pam" != yes; then
+if test $with_pam_for_crypt = no; then
AC_CHECK_FUNCS(crypt)
if test x"$ac_cv_func_crypt" = x"no"; then
AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
fi
fi
+##
+## moved after the check for -lcrypt in order to
+## ensure that the necessary libraries are included
+## check checking for truncated salt. Wrapped by the
+## $with_pam_for_crypt variable as above --jerry
+##
+if test $with_pam_for_crypt = no; then
+AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
+AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
+ samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)])
+if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
+ AC_DEFINE(HAVE_TRUNCATED_SALT)
+fi
+fi
+
+
+
+########################################################################################
+##
+## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER
+##
+########################################################################################
+
+## set the with_smbpasswd_sam as the default
+with_smbpasswd_sam=yes
+
#################################################
# check for a TDB password database
-AC_MSG_CHECKING(whether to use TDB password database)
+AC_MSG_CHECKING(whether to use TDB SAM database)
AC_ARG_WITH(tdbsam,
-[ --with-tdbsam Include experimental TDB password database
- --without-tdbsam Don't include experimental TDB password database (default)],
+[ --with-tdbsam Include experimental TDB SAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_TDBPWD)
-# AC_MSG_ERROR([TDB password database not supported in this version.])
+ AC_DEFINE(WITH_TDB_SAM)
+ with_smbpasswd_sam=no
;;
*)
AC_MSG_RESULT(no)
#################################################
# check for a LDAP password database
-AC_MSG_CHECKING(whether to use LDAP password database)
-AC_ARG_WITH(ldap,
-[ --with-ldap Include LDAP support
- --without-ldap Don't include LDAP support (default)],
+AC_MSG_CHECKING(whether to use LDAP SAM database)
+AC_ARG_WITH(ldapsam,
+[ --with-ldapsam Include experimental LDAP SAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_LDAP)
- AC_MSG_ERROR([LDAP password database not supported in this version.])
+ AC_DEFINE(WITH_LDAP_SAM)
+ LIBS="-lldap -llber $LIBS"
+ with_smbpasswd_sam=no
;;
*)
AC_MSG_RESULT(no)
#################################################
# check for a NISPLUS password database
-AC_MSG_CHECKING(whether to use NISPLUS password database)
-AC_ARG_WITH(nisplus,
-[ --with-nisplus Include NISPLUS password database support
- --without-nisplus Don't include NISPLUS password database support (default)],
+AC_MSG_CHECKING(whether to use NISPLUS SAM database)
+AC_ARG_WITH(nisplussam,
+[ --with-nisplussam Include NISPLUS SAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_NISPLUS)
+ AC_DEFINE(WITH_NISPLUS_SAM)
+ with_smbpasswd_sam=no
;;
*)
AC_MSG_RESULT(no)
AC_MSG_RESULT(no)
)
+################################################
+# This test should come last because the
+# smbpasswd SAM is only used if another format
+# has not been defined
+AC_MSG_CHECKING(whether to use traditional smbpasswd file)
+if test $with_smbpasswd_sam = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_SMBPASSWD_SAM)
+else
+ AC_MSG_RESULT(no)
+fi
+
+########################################################################################
+##
+## END OF TESTS FOR SAM BACKENDS.
+##
+########################################################################################
+
#################################################
# check for a NISPLUS_HOME support
AC_MSG_CHECKING(whether to use NISPLUS_HOME)
AC_ARG_WITH(nisplus-home,
-[ --with-nisplus-home Include NISPLUS_HOME support
- --without-nisplus-home Don't include NISPLUS_HOME support (default)],
+[ --with-nisplus-home Include NISPLUS_HOME support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
# check for the secure socket layer
AC_MSG_CHECKING(whether to use SSL)
AC_ARG_WITH(ssl,
-[ --with-ssl Include SSL support
- --without-ssl Don't include SSL support (default)
- --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
+[ --with-ssl Include SSL support (default=no)
+ --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl/include)
+ --with-ssllib=DIR Where the SSL libraries are (defaults to /usr/local/ssl/lib)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
yes|no)
echo "configure: warning: --with-sslinc called without argument - will use default" 1>&w
CFLAGS="-I/usr/local/ssl/include $CFLAGS"
- LIBS="-lssl -lcrypto $LIBS"
- LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
;;
* )
CFLAGS="-I${withval} $CFLAGS"
- LIBS="-lssl -lcrypto $LIBS"
- LDFLAGS="-L${withval}/lib $LDFLAGS"
;;
esac
else
CFLAGS="-I/usr/local/ssl/include $CFLAGS"
- LIBS="-lssl -lcrypto $LIBS"
+
+ fi
+
+ if test "${with_ssllib+set}" = set; then
+
+ withval="$with_ssllib"
+ case "$withval" in
+ yes|no)
+ echo "configure: warning: --with-ssllib called without argument - will use default" 1>&w
+ LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
+ ;;
+ * )
+ LDFLAGS="-L${withval}/lib $LDFLAGS"
+ ;;
+ esac
+
+ else
+
LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
fi
- if test ! -d ${withval}; then
- echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
- exit 1
- fi
+ LIBS="-lssl -lcrypto $LIBS"
+
+# if test ! -d ${withval}; then
+# echo "configure: error: called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config" 1>&2
+# exit 1
+# fi
CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS" # Damn, SSLeay defines its own
# check for syslog logging
AC_MSG_CHECKING(whether to use syslog logging)
AC_ARG_WITH(syslog,
-[ --with-syslog Include experimental SYSLOG support
- --without-syslog Don't include SYSLOG support (default)],
+[ --with-syslog Include experimental SYSLOG support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
#################################################
# check for a shared memory profiling support
AC_MSG_CHECKING(whether to use profiling)
-AC_ARG_WITH(profile,
-[ --with-profile Include profile support
- --without-profile Don't include profile support (default)],
+AC_ARG_WITH(profiling-data,
+[ --with-profiling-data Include gathering source code profile information (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
)
-#################################################
-# check for experimental netatalk resource fork support
-AC_MSG_CHECKING(whether to support netatalk)
-AC_ARG_WITH(netatalk,
-[ --with-netatalk Include experimental Netatalk support
- --without-netatalk Don't include experimental Netatalk support (default)],
-[ case "$withval" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_NETATALK)
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac ],
- AC_MSG_RESULT(no)
-)
-
#################################################
# check for experimental disk-quotas support
QUOTAOBJS=smbd/noquotas.o
AC_MSG_CHECKING(whether to support disk-quotas)
AC_ARG_WITH(quotas,
-[ --with-quotas Include experimental disk-quota support
- --without-quotas Don't include experimental disk-quota support (default)],
+[ --with-quotas Include experimental disk-quota support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
+ case "$host_os" in
+ *linux*)
+ # Check for kernel 2.4.x quota braindamage...
+ AC_CACHE_CHECK([for linux 2.4.x quota braindamage..],samba_cv_linux_2_4_quota_braindamage, [
+ AC_TRY_COMPILE([#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <linux/quota.h>
+#include <mntent.h>
+#include <linux/unistd.h>],[struct mem_dqblk D;],
+ samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)])
+if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then
+ AC_DEFINE(LINUX_QUOTAS_2)
+else
+ AC_DEFINE(LINUX_QUOTAS_1)
+fi
+ ;;
+ *)
+ ;;
+ esac
QUOTAOBJS=smbd/quotas.o
+ AC_DEFINE(WITH_QUOTAS)
;;
*)
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether to support utmp accounting)
AC_ARG_WITH(utmp,
-[ --with-utmp Include experimental utmp accounting
- --without-utmp Don't include experimental utmp accounting (default)],
+[ --with-utmp Include experimental utmp accounting (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
)
-#################################################
-# check for MS Dfs support
-
-AC_MSG_CHECKING(whether to support Microsoft Dfs)
-AC_ARG_WITH(msdfs,
-[ --with-msdfs Include MS Dfs support
- --without-msdfs Don't include MS Dfs support (default)],
-[ case "$withval" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_MSDFS)
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac ],
- AC_MSG_RESULT(no)
-)
-
#################################################
# set private directory location
AC_ARG_WITH(privatedir,
-[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
+[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
[ case "$withval" in
yes|no)
#
#################################################
# set lock directory location
AC_ARG_WITH(lockdir,
-[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
+[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
[ case "$withval" in
yes|no)
#
#################################################
# set SWAT directory location
AC_ARG_WITH(swatdir,
-[ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
+[ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
[ case "$withval" in
yes|no)
#
AC_SUBST(swatdir)]
)
+#################################################
+# choose native language(s) of man pages
+AC_MSG_CHECKING(chosen man pages' language(s))
+AC_ARG_WITH(manpages-langs,
+[ --with-manpages-langs={en,ja,pl} Choose man pages' language(s). (en)],
+[ case "$withval" in
+ yes|no)
+ AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
+ manlangs="en"
+ ;;
+ *)
+ manlangs="$withval"
+ ;;
+ esac
+
+ AC_MSG_RESULT($manlangs)
+ manlangs=`echo $manlangs | sed "s/,/ /"` # replacing commas with spaces to produce a list
+ AC_SUBST(manlangs)],
+
+ [manlangs="en"
+ AC_MSG_RESULT($manlangs)
+ AC_SUBST(manlangs)]
+)
+
#################################################
# these tests are taken from the GNU fileutils package
AC_CHECKING(how to get filesystem space usage)
fi
AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
-AC_ARG_WITH(spinlocks, [ --with-spinlocks use spin locks instead of fcntl locks ])
+AC_ARG_WITH(spinlocks,
+[ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ])
if test "x$with_spinlocks" = "xyes"; then
AC_DEFINE(USE_SPINLOCKS)
AC_MSG_CHECKING(whether to support ACLs)
AC_ARG_WITH(acl-support,
-[ --with-acl-support Include ACL support
- --without-acl-support Don't include ACL support (default)],
+[ --with-acl-support Include ACL support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(Using AIX ACLs)
AC_DEFINE(HAVE_AIX_ACLS)
;;
+ *osf*)
+ AC_MSG_RESULT(Using Tru64 ACLs)
+ AC_DEFINE(HAVE_TRU64_ACLS)
+ LIBS="$LIBS -lpacl"
+ ;;
*)
AC_CHECK_LIB(acl,acl_get_file)
AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
)
#################################################
-# check whether winbind is supported on this platform
+# Check whether winbind is supported on this platform. If so we need to
+# build and install client programs (WINBIND_TARGETS), sbin programs
+# (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS).
+
+AC_MSG_CHECKING(whether to build winbind)
-AC_MSG_CHECKING(whether to compile winbind)
+# Initially, the value of $host_os decides whether winbind is supported
case "$host_os" in
*linux*|*solaris*)
- WINBIND_TARGETS="$WINBIND_TARGETS \$(WINBIND_PROGS)"
- case "$with_pam" in
- yes)
- WINBIND_TARGETS="$WINBIND_TARGETS \$(WINBIND_PAM_PROGS)"
- ;;
- *)
- esac
+ HAVE_WINBIND=yes
;;
*)
+ HAVE_WINBIND=no
winbind_no_reason=", unsupported on $host_os"
;;
esac
+# Check the setting of --with-winbindd
+
AC_ARG_WITH(winbind,
-[ --with-winbind Build winbind library (default, if supported by OS)
- --without-winbind Don't build winbind library],
+[ --with-winbind Build winbind (default, if supported by OS)],
[
case "$withval" in
+ yes)
+ HAVE_WINBIND=yes
+ ;;
no)
- WINBIND_TARGETS=""
+ HAVE_WINBIND=no
winbind_reason=""
;;
esac ],
)
-if test x"$WINBIND_TARGETS" = x; then
- AC_MSG_RESULT(no$winbind_no_reason)
-else
+# We need unix domain sockets for winbind
+
+if test x"$HAVE_WINBIND" = x"yes"; then
+ if test x"$samba_cv_unixsocket" = x"no"; then
+ winbind_no_reason=", no unix domain socket support on $host_os"
+ HAVE_WINBIND=no
+ fi
+fi
+
+# Display test results
+
+if test x"$HAVE_WINBIND" = x"yes"; then
+
AC_MSG_RESULT(yes)
+
+ WINBIND_TARGETS="\$(WINBIND_PROGS)"
+ WINBIND_STARGETS="\$(WINBIND_SPROGS)"
+ WINBIND_LTARGETS="\$(WINBIND_LPROGS)"
+ case "$with_pam" in
+ yes)
+ WINBIND_PAM_PROGS="\$(WINBIND_PAM_PROGS)"
+ ;;
+ esac
+else
+ AC_MSG_RESULT(no$winbind_no_reason)
+
+ WINBIND_TARGETS=""
+ WINBIND_STARGETS=""
+ WINBIND_LTARGETS=""
+ WINBIND_PAM_PROGS=""
fi
+# Substitution time!
+
AC_SUBST(WINBIND_TARGETS)
+AC_SUBST(WINBIND_STARGETS)
+AC_SUBST(WINBIND_LTARGETS)
+AC_SUBST(WINBIND_PAM_PROGS)
+
+#################################################
+# Check to see if we should use the included popt
+
+AC_ARG_WITH(included-popt,
+[ --with-included-popt use bundled popt library, not from system],
+[
+ case "$withval" in
+ yes)
+ INCLUDED_POPT=yes
+ ;;
+ no)
+ INCLUDED_POPT=no
+ ;;
+ esac ],
+)
+if test x"$INCLUDED_POPT" != x"yes"; then
+ AC_CHECK_LIB(popt, poptGetContext,
+ INCLUDED_POPT=no, INCLUDED_POPT=yes)
+fi
+
+AC_MSG_CHECKING(whether to use included popt)
+if test x"$INCLUDED_POPT" = x"yes"; then
+ AC_MSG_RESULT($srcdir/popt)
+ BUILD_POPT='$(POPT_OBJS)'
+ CFLAGS="$CFLAGS -I$srcdir/popt"
+else
+ AC_MSG_RESULT(no)
+ LIBS="$LIBS -lpopt"
+fi
+AC_SUBST(BUILD_POPT)
#################################################
# final configure stuff