AC_PREREQ(2.53)
AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
+AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
logfilebase="\${VARDIR}/log/samba"
privatedir="\${CONFIGDIR}/private"
libdir="\${prefix}/lib/samba"
- configdir="${sysconfdir}/samba"
+ configdir="\${sysconfdir}/samba"
swatdir="\${DATADIR}/samba/swat"
;;
esac])
AC_SUBST(KRB5_LIBS)
AC_SUBST(UUID_LIBS)
AC_SUBST(LDAP_LIBS)
-AC_SUBST(SHLIB_PROGS)
AC_SUBST(PAM_MODULES)
AC_SUBST(INSTALL_PAM_MODULES)
AC_SUBST(UNINSTALL_PAM_MODULES)
AC_SUBST(SMBWRAP_OBJS)
AC_SUBST(SMBWRAP_INC)
AC_SUBST(EXTRA_BIN_PROGS)
+AC_SUBST(SMBMOUNT_PROGS)
AC_SUBST(CIFSMOUNT_PROGS)
AC_SUBST(INSTALL_CIFSMOUNT)
AC_SUBST(UNINSTALL_CIFSMOUNT)
AC_LIBREPLACE_CC_CHECKS
-# add -ldl to the global LIBS
-LIBS="${LIBS} ${LIBDL}"
-
m4_include(lib/socket_wrapper/config.m4)
#################################################
dnl Add modules that have to be built by default here
dnl These have to be built static:
-default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_unixinfo auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default"
+default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_unixinfo rpc_epmapper auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
dnl These are preferably build shared, and static if dlopen() is not available
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script"
# case statement; its first reference must be unconditional.
#
case "$host_os" in
-# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
*hpux*)
#
# Defines needed for HPUX support.
done
AC_SUBST(LIBREPLACE_OBJS)
+# add -ldl to the global LIBS
+LIBS="${LIBS} ${LIBDL}"
+
AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h memory.h alloca.h)
AC_CHECK_HEADERS(limits.h float.h)
AC_CHECK_HEADERS(nss.h nss_common.h nsswitch.h ns_api.h sys/security.h)
AC_CHECK_HEADERS(syscall.h sys/syscall.h)
-AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
AC_CHECK_HEADERS(sys/ea.h sys/proplist.h)
AC_CHECK_HEADERS(sys/cdefs.h glob.h)
fi
############################################
-# check if the compiler can do immediate structures
+# check if the compiler will optimize out function calls
AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [
AC_TRY_LINK([
#include <stdio.h>],
AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror chown fchown chmod fchmod chroot link mknod mknod64)
AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull)
-AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync memset strlcpy strlcat setpgid)
+AC_CHECK_FUNCS(fstat strchr utime utimes chflags)
+AC_CHECK_FUNCS(getrlimit fsync 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 realpath)
AC_CHECK_FUNCS(setlocale nl_langinfo)
AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
+AC_CHECK_FUNCS(memalign posix_memalign)
AC_CHECK_HEADERS(sys/mman.h)
# setbuffer, shmget, shm_open are needed for smbtorture
AC_CHECK_FUNCS(setbuffer shmget shm_open)
+AC_CHECK_FUNCS(makecontext getcontext setcontext swapcontext)
# Find a method of generating a stack trace
AC_CHECK_HEADERS(execinfo.h libexc.h libunwind.h)
;;
*hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
# Use special PIC flags for the native HP-UX compiler.
- if test $ac_cv_prog_cc_Ae = yes; then
BLDSHARED="true"
SHLD="cc"
LDSHFLAGS="-b -Wl,-B,symbolic,-b,-z"
SONAMEFLAG="-Wl,+h "
PICFLAG="+z"
- elif test "${GCC}" = "yes"; then
+ if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
+ else
+ PICFLAG="+z"
fi
if test "$host_cpu" = "ia64"; then
SHLIBEXT="so"
AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
fi
+AC_CACHE_CHECK([for inotify support],samba_cv_HAVE_INOTIFY,[
+AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h)
+AC_CHECK_FUNC(inotify_init)
+AC_HAVE_DECL(__NR_inotify_init, [#include <asm/unistd.h>])
+],
+samba_cv_HAVE_INOTIFY=yes,
+samba_cv_HAVE_INOTIFY=no,
+samba_cv_HAVE_INOTIFY=cross)
+
+if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then
+ AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support])
+fi
+
#################################################
# Check if FAM notifications are available. For FAM info, see
# http://oss.sgi.com/projects/fam/
fi
if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then
- AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1,
- [Whether FAM file notifications are available])
+ default_shared_modules="$default_shared_modules vfs_notify_fam"
AC_TRY_COMPILE([#include <fam.h>],
[FAMCodes code = FAMChanged;],
AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1,
AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
fi
+AC_CACHE_CHECK([for st_flags in struct stat],
+ samba_cv_HAVE_STAT_ST_FLAGS,
+ [
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>],
+ [struct stat st; st.st_flags = 0;],
+ samba_cv_HAVE_STAT_ST_FLAGS=yes,
+ samba_cv_HAVE_STAT_ST_FLAGS=no,
+ samba_cv_HAVE_STAT_ST_FLAGS=cross)
+ ])
+
+if test x"$samba_cv_HAVE_STAT_ST_FLAGS" = x"yes"; then
+ AC_DEFINE(HAVE_STAT_ST_FLAGS, 1,
+ [Whether the stat struct has a st_flags member])
+fi
+
case "$host_os" in
*linux*)
AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
fi
##################################################################
- # HP/UX does not have ber_tag_t, disable LDAP there
- AC_CHECK_TYPE(ber_tag_t,,,[#include <lber.h>])
- if test x"$ac_cv_type_ber_tag_t" != x"yes"; then
- if test x"$with_ldap_support" = x"yes"; then
- AC_MSG_ERROR(ber_tag_t is needed for LDAP support)
- else
+ # HP/UX does not have ber_tag_t in lber.h - it must be configured as
+ # unsigned int in include/includes.h
+ case $host_os in
+ *hpux*)
AC_MSG_WARN(ber_tag_t is needed for LDAP support)
- fi
- with_ldap_support=no
- fi
+ AC_MSG_WARN(ber_tag_t must be configured in includes.h for hpux)
+ with_ldap_support=yes
+ ;;
+ *)
+ AC_CHECK_TYPE(ber_tag_t,,,[#include <lber.h>])
+ if test x"$ac_cv_type_ber_tag_t" != x"yes"; then
+ if test x"$with_ldap_support" = x"yes"; then
+ AC_MSG_ERROR(ber_tag_t is needed for LDAP support)
+ else
+ AC_MSG_WARN(ber_tag_t is needed for LDAP support)
+ fi
+ with_ldap_support=no
+ fi
+ ;;
+ esac
fi
if test x"$with_ldap_support" != x"no"; then
AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
- AC_CHECK_FUNC_EXT(ldap_dn2ad_canonical,$LDAP_LIBS)
AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)
if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes"; then
# Check to see whether there is enough LDAP functionality to be able
# to build AD support.
+# HPUX only has ldap_init; ok, we take care of this in smbldap.c
+case "$host_os" in
+ *hpux*)
+ AC_CHECK_FUNC_EXT(ldap_init,$LDAP_LIBS)
+
+ if test x"$ac_cv_func_ext_ldap_init" != x"yes"; then
+ if test x"$with_ads_support" = x"yes"; then
+ AC_MSG_ERROR(Active Directory support on HPUX requires ldap_init)
+ elif test x"$with_ads_support" = x"auto"; then
+ AC_MSG_WARN(Disabling Active Directory support (requires ldap_init on HPUX))
+ with_ads_support=no
+ fi
+ fi
+ ;;
+ *)
AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)
if test x"$ac_cv_func_ext_ldap_initialize" != x"yes"; then
with_ads_support=no
fi
fi
+ ;;
+esac
+
AC_CHECK_FUNC_EXT(ldap_add_result_entry,$LDAP_LIBS)
CPPFLAGS=$ac_save_CPPFLAGS
LDFLAGS=$ac_save_LDFLAGS
fi
+ AC_CHECK_HEADERS(krb5/locate_plugin.h)
fi
# Now we have determined whether we really want ADS support
AC_CHECK_FUNC_EXT(krb5_get_kdc_cred, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_free_error_contents, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(initialize_krb5_error_table, $KRB5_LIBS)
+ AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_alloc, $KRB5_LIBS)
+ AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_free, $KRB5_LIBS)
LIBS="$KRB5_LIBS $LIBS"
[Whether the krb5_ticket structure contains the kvno and enctype])
fi
+ AC_CACHE_CHECK(whether krb5_get_init_creds_opt_free takes a context argument,
+ smb_krb5_creds_opt_free_context,
+ [
+ AC_TRY_COMPILE([
+ #include <krb5.h>],
+ [
+ krb5_context ctx;
+ krb5_get_init_creds_opt *opt = NULL;
+ krb5_get_init_creds_opt_free(ctx, opt);
+ ],
+ [smb_krb5_creds_opt_free_context=yes],
+ [smb_krb5_creds_opt_free_context=no]
+ )
+ ])
+
+ if test x"$smb_krb5_creds_opt_free_context" = x"yes" ; then
+ AC_DEFINE(KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT, 1,
+ [Whether krb5_get_init_creds_opt_free takes a context argument])
+ fi
+
AC_CACHE_CHECK(whether krb5_verify_checksum takes 7 arguments, smb_krb5_verify_checksum, [
AC_TRY_COMPILE([
#include <krb5.h>],
[Whether the type krb5_addresses type exists])
fi
+ AC_CACHE_CHECK([whether krb5_mk_error takes 3 arguments MIT or 9 Heimdal],
+ samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE, [
+ AC_TRY_COMPILE([#include <krb5.h>],
+ [
+ krb5_mk_error(0,0,0);],
+ samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE=yes,
+ samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE=no)])
+
+ if test x"$samba_cv_HAVE_SHORT_KRB5_MK_ERROR_INTERFACE" = x"yes"; then
+ AC_DEFINE(HAVE_SHORT_KRB5_MK_ERROR_INTERFACE,1,
+ [whether krb5_mk_error takes 3 arguments MIT or 9 Heimdal])
+ fi
+
+
#
#
# Now the decisions whether we can support krb5
fi
if test x"$with_dnsupdate_support" != x"no"; then
- ac_save_LIBS=$LIBS
########################################################
- # now see if we can find the uuid libs in standard paths
- AC_CHECK_LIB_EXT(uuid, UUID_LIBS, uuid_generate)
-
- LIBS="$LIBS $UUID_LIBS"
+ # Now see if we can find the uuid libs in standard paths
+ # On some systems, the uuid API is in libc, so we have to
+ # be careful not to insert a spurious -luuid.
- if test x"$ac_cv_lib_ext_uuid_uuid_generate" = x"yes"; then
- with_dnsupdate_support=yes
- AC_DEFINE(WITH_DNS_UPDATES,1,[Whether to enable DNS Update support])
- AC_MSG_CHECKING(whether UUID support is used)
- AC_MSG_RESULT(yes)
- else
- if test x"$with_dnsupdate_support" = x"yes"; then
- AC_MSG_ERROR(libuuid is needed to enable DNS Updates support)
- else
- AC_MSG_WARN(libuuid is needed to enable DNS Updates support)
- fi
- UUID_LIBS=""
- with_dnsupdate_support=no
- fi
- LIBS=$ac_save_LIBS
+ UUID_LIBS=""
+ AC_LIBTESTFUNC(uuid, uuid_generate,
+ [
+ case " $LIBS " in
+ *\ -luuid\ *)
+ UUID_LIBS="-luuid"
+ SMB_REMOVE_LIB(uuid)
+ ;;
+ esac
+
+ with_dnsupdate_support=yes
+ AC_DEFINE(WITH_DNS_UPDATES,1,[Whether to enable DNS Update support])
+ ],
+ [
+ if test x"$with_dnsupdate_support" = x"yes"; then
+ AC_MSG_ERROR(libuuid is needed to enable DNS Updates support)
+ else
+ AC_MSG_WARN(libuuid is needed to enable DNS Updates support)
+ fi
+ with_dnsupdate_support=no
+ ])
fi
#################################################
*linux*)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount])
- EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbmount bin/smbmnt bin/smbumount"
+ SMBMOUNT_PROGS="bin/smbmount bin/smbmnt bin/smbumount"
;;
*)
AC_MSG_ERROR(not on a linux system!)
AC_MSG_RESULT(yes)
)
+############################################
+# See if we have the Linux readahead syscall.
+
+AC_CACHE_CHECK([for Linux readahead],
+ samba_cv_HAVE_LINUX_READAHEAD,[
+ AC_TRY_LINK([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <fcntl.h>],
+ [ssize_t err = readahead(0,0,0x80000);],
+ samba_cv_HAVE_LINUX_READAHEAD=yes,
+ samba_cv_HAVE_LINUX_READAHEAD=no)])
+
+if test x"$samba_cv_HAVE_LINUX_READAHEAD" = x"yes"; then
+ AC_DEFINE(HAVE_LINUX_READAHEAD,1,
+ [Whether Linux readahead is available])
+fi
+
#################################################
# Check whether winbind is supported on this platform. If so we need to
WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS
NSSSONAMEVERSIONSUFFIX=""
+SMB_KRB5_LOCATOR="bin/smb_krb5_locator.$SHLIBEXT"
+
case "$host_os" in
*linux*)
NSSSONAMEVERSIONSUFFIX=".2"
AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
AC_SUBST(NSSSONAMEVERSIONSUFFIX)
+AC_SUBST(SMB_KRB5_LOCATOR)
+
# Check the setting of --with-winbind
AC_ARG_WITH(winbind,
EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
- if test $BLDSHARED = true; then
- SHLIB_PROGS="$SHLIB_PROGS $WINBIND_NSS $WINBIND_WINS_NSS"
-
- if test x"$create_pam_modules" = x"yes"; then
- PAM_MODULES="$PAM_MODULES pam_winbind"
- INSTALL_PAM_MODULES="installpammodules"
- UNINSTALL_PAM_MODULES="uninstallpammodules"
- fi
+ if test $BLDSHARED = true -a x"$create_pam_modules" = x"yes"; then
+ PAM_MODULES="$PAM_MODULES pam_winbind"
+ INSTALL_PAM_MODULES="installpammodules"
+ UNINSTALL_PAM_MODULES="uninstallpammodules"
fi
else
AC_MSG_RESULT(no$winbind_no_reason)
MODULE_idmap_passdb=STATIC
MODULE_idmap_nss=STATIC
+MODULE_nss_info_template=STATIC
+
AC_ARG_WITH(static-modules,
-[ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in],
+[ --with-static-modules=MODULES Comma-separated list of names of modules to statically link in],
[ if test $withval; then
for i in `echo $withval | sed -e 's/,/ /g'`
do
fi ])
AC_ARG_WITH(shared-modules,
-[ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared],
+[ --with-shared-modules=MODULES Comma-separated list of names of modules to build shared],
[ if test $withval; then
for i in `echo $withval | sed -e 's/,/ /g'`
do
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
SMB_MODULE(rpc_unixinfo, \$(RPC_UNIXINFO_OBJ), "bin/librpc_unixinfo.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_epmapper, \$(RPC_EPMAPPER_OBJ), "bin/librpc_epmapper.$SHLIBEXT", RPC)
SMB_SUBSYSTEM(RPC,smbd/server.o)
SMB_MODULE(idmap_ldap, nsswitch/idmap_ldap.o, "bin/ldap.$SHLIBEXT", IDMAP)
SMB_MODULE(idmap_ad, nsswitch/idmap_ad.o, "bin/ad.$SHLIBEXT", IDMAP)
SMB_SUBSYSTEM(IDMAP, nsswitch/idmap.o)
+SMB_MODULE(nss_info_template, nsswitch/nss_info_template.o, "bin/template.$SHLIBEXT", NSS_INFO)
+SMB_SUBSYSTEM(NSS_INFO, nsswitch/nss_info.o)
+
SMB_MODULE(charset_weird, modules/weird.o, "bin/weird.$SHLIBEXT", CHARSET)
SMB_MODULE(charset_CP850, modules/CP850.o, "bin/CP850.$SHLIBEXT", CHARSET)
SMB_MODULE(charset_CP437, modules/CP437.o, "bin/CP437.$SHLIBEXT", CHARSET)
SMB_MODULE(vfs_prealloc, \$(VFS_PREALLOC_OBJ), "bin/prealloc.$SHLIBEXT", VFS)
SMB_MODULE(vfs_commit, \$(VFS_COMMIT_OBJ), "bin/commit.$SHLIBEXT", VFS)
SMB_MODULE(vfs_gpfs, \$(VFS_GPFS_OBJ), "bin/gpfs.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_notify_fam, \$(VFS_NOTIFY_FAM_OBJ), "bin/notify_fam.$SHLIBEXT", VFS)
SMB_SUBSYSTEM(VFS,smbd/vfs.o)
AC_MSG_RESULT([Using libraries:])
AC_MSG_RESULT([ LIBS = $LIBS])
if test x"$with_ads_support" != x"no"; then
- AC_MSG_RESULT([ KRB5_LIBS = $KRB5_LIBS])
+ AC_MSG_RESULT([ KRB5_LIBS = $KRB5_LIBS])
fi
if test x"$with_ldap_support" != x"no"; then
- AC_MSG_RESULT([ LDAP_LIBS = $LDAP_LIBS])
+ AC_MSG_RESULT([ LDAP_LIBS = $LDAP_LIBS])
fi
if test x"$with_dnsupdate_support" != x"no"; then
- AC_MSG_RESULT([ UUID_LIBS = $UUID_LIBS])
+ AC_MSG_RESULT([ UUID_LIBS = $UUID_LIBS])
fi
AC_MSG_RESULT([ AUTH_LIBS = $AUTH_LIBS])