dnl Process this file with autoconf to produce a configure script.
AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
-# we want to be compatibe with older versions of Samba
+# we want to be compatible with older versions of Samba
AC_PREFIX_DEFAULT(/usr/local/samba)
dnl Unique-to-Samba variables we'll be playing with.
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
fi])
+AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable heap debugging [default=no]])
+
+if test "x$enable_dmalloc" = xyes
+then
+ AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
+ AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
+ [Define to check invariants around some common functions])
+ LIBS="$LIBS -ldmalloc"
+fi
+
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
;;
esac
;;
+
+#
+# CRAY Unicos has broken const handling
+ *unicos*)
+ AC_MSG_RESULT([disabling const])
+ CPPFLAGS="$CPPFLAGS -Dconst="
+ ;;
+
#
# AIX4.x doesn't even admit to having large
# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
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 lber.h)
#
# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
;;
esac
AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
-AC_CHECK_HEADERS(nss.h nss_common.h sys/security.h security/pam_appl.h security/pam_modules.h)
+AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
AC_CHECK_HEADERS(stropts.h poll.h)
AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
# For quotas on Veritas VxFS filesystems
AC_CHECK_HEADERS(sys/fs/vx_quota.h)
+# For quotas on Linux XFS filesystems
+AC_CHECK_HEADERS(linux/xqm.h)
+
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_CHECK_SIZEOF(short,cross)
AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
AC_DEFINE(HAVE_LIBDL)])
-############################################
-# we need krb5 for w2k ADS authentication
-AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
- AC_DEFINE(HAVE_KRB5)])
-
-
############################################
# check if the compiler can do immediate structures
AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
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 setpgid)
AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
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(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
+AC_CHECK_FUNCS(syslog vsyslog)
# setbuffer is needed for smbtorture
AC_CHECK_FUNCS(setbuffer)
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,
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
;;
*solaris*) AC_DEFINE(SUNOS5)
BLDSHARED="true"
- LDSHFLAGS="-Wl,-h,\$@.so -G"
+ LDSHFLAGS="-h \$@ -G"
if test "${ac_cv_prog_CC}" = "gcc"; then
PICFLAG="-fPIC"
else
LDSHFLAGS="-G"
;;
esac
+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])
+
+#######################################################
+# test whether building a shared library actually works
+if test $BLDSHARED = true; then
+AC_CACHE_CHECK([whether building shared libraries actually works],
+ [ac_cv_shlib_works],[
+ ac_cv_shlib_works=no
+ # try building a trivial shared library
+ $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
+ $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
+ ac_cv_shlib_works=yes
+ rm -f shlib.so shlib.po
+])
+if test $ac_cv_shlib_works = no; then
+ BLDSHARED=false
+fi
+fi
+
# this updates our target list if we can build shared libs
if test $BLDSHARED = true; then
fi
fi
+
+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 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 (default=no) ],
+[ --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-dce-dfs Include DCE/DFS support (default=no)],
+[ --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 (default=no)],
-[ case "$withval" in
- yes)
+# see if this box has the RedHat location for kerberos
+AC_MSG_CHECKING(for /usr/kerberos)
+if test -d /usr/kerberos; then
+ LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
+ CFLAGS="$CFLAGS -I/usr/kerberos/include"
+ CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
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_DEFINE_UNQUOTED(KRB4_DIR, ${withval})
- ;;
- *)
+else
AC_MSG_RESULT(no)
- ;;
- esac ],
- AC_MSG_RESULT(no)
-)
+fi
#################################################
-# 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 (default=no)],
+[ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
[ case "$withval" in
- yes)
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
AC_MSG_RESULT(yes)
- AC_DEFINE(KRB5_AUTH)
- LIBS="$LIBS -ldes425 -lkrb5 -lcrypto -lcom_err"
+ LIBS="$LIBS -lkrb5"
CFLAGS="$CFLAGS -I$withval/include"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
- AC_DEFINE_UNQUOTED(KRB5_DIR,${withval})
- ;;
- *)
- AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
+# now check for krb5.h. Some systems have the libraries without the headers!
+# note that this check is done here to allow for different kerberos
+# include paths
+AC_CHECK_HEADERS(krb5.h)
+
+# now check for gssapi headers. This is also done here to allow for
+# different kerberos include paths
+AC_CHECK_HEADERS(gssapi/gssapi_generic.h gssapi/gssapi.h)
+
+##################################################################
+# 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"])
+AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5"])
+
+
+########################################################
+# now see if we can find the krb5 libs in standard paths
+# or as specified above
+AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5";
+ AC_DEFINE(HAVE_KRB5)])
+
+########################################################
+# now see if we can find the gssapi libs in standard paths
+AC_CHECK_LIB(gssapi_krb5, gss_display_status, [AC_DEFINE(HAVE_GSSAPI)])
+
+
+##################################################################
+# we might need the lber lib on some systems. To avoid link errors
+# this test must be before the libldap test
+AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
+
+########################################################
+# now see if we can find the ldap libs in standard paths
+if test x$have_ldap != xyes; then
+AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
+ AC_DEFINE(HAVE_LDAP)])
+fi
+
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use AUTOMOUNT)
#################################################
-# check for a 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 password database)
+AC_MSG_CHECKING(whether to use PAM)
AC_ARG_WITH(pam,
-[ --with-pam Include PAM password database support (default=no)],
+[ --with-pam Include PAM support (default=no)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_LDAP_SAM)
- LIBS="-lldap -llber -lresolv $LIBS"
+ LIBS="-lldap -llber $LIBS"
with_smbpasswd_sam=no
;;
*)
AC_SUBST(swatdir)]
)
-#################################################
-# check for i18n'ed SWAT compiling
-AC_MSG_CHECKING(whether to use i18n'ed SWAT)
-AC_ARG_WITH(i18n-swat,
-[ --with-i18n-swat Use i18n'ed SWAT
- --without-i18n-swat Don't use i18n'ed SWAT (default)],
-[ case "$withval" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(I18N_SWAT)
- i18n_swat="yes"
- ;;
- *)
- AC_MSG_RESULT(no)
- i18n_swat="no"
- ;;
- esac
- AC_SUBST(i18n_swat) ],
- [ AC_MSG_RESULT(no)
- i18n_swat="no"
- AC_SUBST(i18n_swat) ]
-)
-
-#################################################
-# set SWAT default language for old web browsers.
-AC_MSG_CHECKING(whether to use default SWAT language)
-AC_ARG_WITH(swat-def-lang,
-[ --with-swat-def-lang=LN default SWAT language for old web browsers (empty)],
-[
- default_pref_lang=""
- case "$withval" in
- yes)
- AC_MSG_WARN([--with-swat-def-lang called without argument - will use default])
- ;;
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- default_pref_lang="$withval"
- AC_MSG_RESULT($withval)
- ;;
- esac
- AC_DEFINE_UNQUOTED(I18N_DEFAULT_PREF_LANG, "$default_pref_lang")
-],
-[
- default_pref_lang=""
- AC_MSG_RESULT(no)
- AC_DEFINE_UNQUOTED(I18N_DEFAULT_PREF_LANG, "$default_pref_lang")
-]
-)
-
#################################################
# choose native language(s) of man pages
AC_MSG_CHECKING(chosen man pages' language(s))
[ case "$withval" in
yes)
- case "$host_os" in
- *sysv5*)
- AC_MSG_RESULT(Using UnixWare ACLs)
- AC_DEFINE(HAVE_UNIXWARE_ACLS)
- ;;
- *solaris*)
- AC_MSG_RESULT(Using solaris ACLs)
- AC_DEFINE(HAVE_SOLARIS_ACLS)
- ;;
- *irix*)
- AC_MSG_RESULT(Using IRIX ACLs)
- AC_DEFINE(HAVE_IRIX_ACLS)
- ;;
- *aix*)
- 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"
- ;;
+ case "$host_os" in
+ *sysv5*)
+ AC_MSG_RESULT(Using UnixWare ACLs)
+ AC_DEFINE(HAVE_UNIXWARE_ACLS)
+ ;;
+ *solaris*)
+ AC_MSG_RESULT(Using solaris ACLs)
+ AC_DEFINE(HAVE_SOLARIS_ACLS)
+ ;;
+ *hpux*)
+ AC_MSG_RESULT(Using HPUX ACLs)
+ AC_DEFINE(HAVE_HPUX_ACLS)
+ ;;
+ *irix*)
+ AC_MSG_RESULT(Using IRIX ACLs)
+ AC_DEFINE(HAVE_IRIX_ACLS)
+ ;;
+ *aix*)
+ 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,[
- AC_TRY_LINK([#include <sys/types.h>
+ AC_CHECK_LIB(acl,acl_get_file)
+ AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
+ AC_TRY_LINK([#include <sys/types.h>
#include <sys/acl.h>],
[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)])
# Initially, the value of $host_os decides whether winbind is supported
case "$host_os" in
- *linux*|*solaris*)
+ *linux*|*solaris*|*irix*)
HAVE_WINBIND=yes
;;
*)
# Display test results
-if test x"$HAVE_WINBIND" = x"yes"; then
+WINBIND_TARGETS=""
+WINBIND_STARGETS=""
+WINBIND_LTARGETS=""
+WINBIND_PAM_PROGS=""
+
+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
+ WINBIND_TARGETS="bin/wbinfo"
+ WINBIND_STARGETS="bin/winbindd"
+ if test x"$BLDSHARED" = x"true"; then
+ WINBIND_LTARGETS="nsswitch/libnss_winbind.so"
+ if test x"$with_pam" = x"yes"; then
+ WINBIND_PAM_TARGETS="nsswitch/pam_winbind.so"
+ fi
+ fi
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)
+AC_SUBST(WINBIND_PAM_TARGETS)
#################################################
-# Check for SWAT i18n support
+# Check to see if we should use the included popt
-PACKAGE=i18n_swat
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_SUBST(PACKAGE)
-ALL_LINGUAS="en ja pl tr"
-AM_GNU_GETTEXT
+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)'
+ FLAGS1="-I$srcdir/popt"
+else
+ AC_MSG_RESULT(no)
+ LIBS="$LIBS -lpopt"
+fi
+AC_SUBST(BUILD_POPT)
+AC_SUBST(FLAGS1)
#################################################
# final configure stuff
builddir=`pwd`
AC_SUBST(builddir)
-AC_OUTPUT(include/stamp-h Makefile intl/Makefile po/Makefile.in)
+AC_OUTPUT(include/stamp-h Makefile)
+
+#################################################
+# Print very concise instructions on building/use
+if test "x$enable_dmalloc" = xyes
+then
+ AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
+ AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])
+fi
\ No newline at end of file