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(krb5developer, [ --enable-krb5developer turn on developer warnings and debugging, except -Wstrict-prototypes [default=no]],
+ [if eval "test x$enable_krb5developer = xyes"; then
+ CFLAGS="${CFLAGS} -g -Wall -Wshadow -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 ldap.h sasl.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)
RUNPROG=""
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 strlcpy strlcat)
+AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
+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)
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
BLDSHARED="true"
LDSHFLAGS="-shared"
PICFLAG="-fPIC"
+ AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
*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
POBAD_CC=""
PICSUFFIX="po.o"
fi
+ AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
*sunos*) AC_DEFINE(SUNOS4)
BLDSHARED="true"
*bsd*) BLDSHARED="true"
LDSHFLAGS="-Wl,-soname,\$@ -shared"
PICFLAG="-fPIC"
+ AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
*irix*) AC_DEFINE(IRIX)
case "$host_os" in
else
PICFLAG="-KPIC"
fi
+ AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
*aix*) AC_DEFINE(AIX)
BLDSHARED="true"
LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
PICFLAG="-O2 -qmaxmem=6000"
+ AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
;;
*hpux*) AC_DEFINE(HPUX)
SHLIBEXT="sl"
LDSHFLAGS="-b -z +h \$@"
PICFLAG="+z"
fi
+ AC_DEFINE(STAT_ST_BLOCKSIZE,8192)
;;
*qnx*) AC_DEFINE(QNX);;
*osf*) AC_DEFINE(OSF1)
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
AC_DEFINE(HAVE_INO64_T)
fi
+AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
+AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <sys/stat.h>
+main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
+samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
+if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
+ AC_DEFINE(HAVE_DEV64_T)
+fi
+
AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
AC_TRY_COMPILE([
#if defined(HAVE_UNISTD_H)
AC_DEFINE(HAVE_STRUCT_DIRENT64)
fi
+AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
+AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+main() { dev_t dev; int i = major(dev); return 0; }],
+samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
+if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
+ AC_DEFINE(HAVE_DEVICE_MAJOR_FN)
+fi
+
+AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
+AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+main() { dev_t dev; int i = minor(dev); return 0; }],
+samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
+if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
+ AC_DEFINE(HAVE_DEVICE_MINOR_FN)
+fi
+
AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
AC_TRY_RUN([#include <stdio.h>
main() { char c; c=250; exit((c > 0)?0:1); }],
fi
fi
+AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>],
+[struct stat st; st.st_blocks = 0;],
+samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
+if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
+ AC_DEFINE(HAVE_STAT_ST_BLOCKS)
+fi
case "$host_os" in
*linux*)
# 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"])
########################################################
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
########################################################
# 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_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap";
AC_DEFINE(HAVE_LDAP)])
fi
-
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use AUTOMOUNT)
[ 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 to see if we should use the included popt
if test x"$INCLUDED_POPT" = x"yes"; then
AC_MSG_RESULT($srcdir/popt)
BUILD_POPT='$(POPT_OBJS)'
- CFLAGS="$CFLAGS -I$srcdir/popt"
+ FLAGS1="-I$srcdir/popt"
else
AC_MSG_RESULT(no)
LIBS="$LIBS -lpopt"
fi
AC_SUBST(BUILD_POPT)
+AC_SUBST(FLAGS1)
#################################################
# final configure stuff
AC_SUBST(builddir)
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