AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
+dnl Unique-to-Samba variables we'll be playing with.
AC_SUBST(SHELL)
AC_SUBST(MPROGS)
AC_SUBST(LDSHFLAGS)
AC_SUBST(HOST_OS)
+AC_SUBST(WRAP)
AC_SUBST(WRAP32)
AC_SUBST(PICFLAG)
+
+# compile with optimisation and without debugging by default
+CFLAGS=${CFLAGS-"-O"}
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
AC_PROG_AWK
AC_CANONICAL_SYSTEM
AC_VALIDATE_CACHE_SYSTEM_TYPE
SAMBA_MAINTAINER_MODE
-
-
-# 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
-
-# these are the defaults, good for lots of systems
-PICFLAG="-fpic"
-HOST_OS="$host_os"
-LDSHFLAGS="-shared"
-
-# and these are for particular systems
-case "$host_os" in
- *linux*) AC_DEFINE(LINUX);;
- *solaris*) AC_DEFINE(SUNOS5)
- LDSHFLAGS="-G";;
- *sunos*) AC_DEFINE(SUNOS4);;
- *irix*) AC_DEFINE(IRIX)
- WRAP32=smbwrapper/smbwrapper.32.so
- PICFLAG="-KPIC"
- ;;
- *aix*) AC_DEFINE(AIX);;
- *hpux*) AC_DEFINE(HPUX);;
- *qnx*) AC_DEFINE(QNX);;
- *osf*) AC_DEFINE(OSF1);;
- *sco*) AC_DEFINE(SCO);;
- *next2*) AC_DEFINE(NEXT2);;
-esac
-
AC_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(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/types.h rpc/xdr.h rpc/auth.h rpc/clnt.h)
+AC_CHECK_HEADERS(compat.h rpc/rpc.h rpc/types.h rpc/xdr.h rpc/auth.h rpc/clnt.h)
AC_CHECK_HEADERS(rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h )
AC_CHECK_HEADERS(sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h)
AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
-AC_CHECK_HEADERS(readline/history.h sys/capability.h sysacll.h sys/syscall.h)
-AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h)
+AC_CHECK_HEADERS(readline/history.h sys/capability.h syscall.h sys/syscall.h)
+AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_RDEV
+AC_DIRENT_D_OFF
AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t)
# stupid glibc has the functions but no declaration. grrrr.
AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
- AC_TRY_COMPILE([#include <unistd.h>],[int i = setresuid],
+ AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)setresuid],
samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
AC_DEFINE(HAVE_SETRESUID_DECL)
fi
+# stupid glibc has the functions but no declaration. grrrr.
+AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
+ AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
+ samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
+if test x"$samba_cv_have_crypt_decl" = x"yes"; then
+ AC_DEFINE(HAVE_CRYPT_DECL)
+fi
+
# and glibc has setresuid under linux but the function does
# nothing until kernel 2.1.44! very dumb.
AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
-AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
+AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64)
AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
AC_CHECK_FUNCS(fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
AC_CHECK_FUNCS(srandom random srand rand setenv)
+# syscall() is needed for smbwrapper.
+AC_CHECK_FUNCS(syscall)
AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
AC_CHECK_FUNCS(_write __write _fork __fork)
AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
-AC_CHECK_FUNCS(llseek _llseek __llseek readdir64 _readdir64 __readdir64)
+AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
+# 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
+
+# these are the defaults, good for lots of systems
+HOST_OS="$host_os"
+LDSHFLAGS="-shared"
+
+# and these are for particular systems
+case "$host_os" in
+ *linux*) AC_DEFINE(LINUX);;
+ *solaris*) AC_DEFINE(SUNOS5)
+ LDSHFLAGS="-G"
+ ;;
+ *sunos*) AC_DEFINE(SUNOS4)
+ LDSHFLAGS=""
+ ;;
+ *bsd*) LDSHFLAGS="-shared -Bshareable"
+ ;;
+ *irix*) AC_DEFINE(IRIX)
+ ATTEMPT_WRAP32_BUILD=yes
+ ;;
+ *aix*) AC_DEFINE(AIX);;
+ *hpux*) AC_DEFINE(HPUX);;
+ *qnx*) AC_DEFINE(QNX);;
+ *osf*) AC_DEFINE(OSF1);;
+ *sco*) AC_DEFINE(SCO);;
+ *next2*) AC_DEFINE(NEXT2);;
+ *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
+ *sysv4.2*) AC_CHECK_LIB(resolv, strcasecmp);;
+esac
+
+# try to work out how to produce pic code with this compiler
+PICFLAG=""
+AC_PROG_CC_FLAG(fpic)
+if test $ac_cv_prog_cc_fpic = yes; then
+ PICFLAG="-fpic";
+fi
+if test x$PICFLAG = x; then
+ AC_PROG_CC_FLAG(Kpic)
+ if test $ac_cv_prog_cc_Kpic = yes; then
+ PICFLAG="-Kpic";
+ fi
+fi
+if test x$PICFLAG = x; then
+ AC_PROG_CC_FLAG(KPIC)
+ if test $ac_cv_prog_cc_KPIC = yes; then
+ PICFLAG="-KPIC";
+ fi
+fi
+
+################
+
AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
AC_TRY_RUN([#include <stdio.h>
main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
AC_TRY_COMPILE([#include <sys/types.h>
-#include <dirent.h>],
-[void seekdir(DIR *d, long loc) { return; }],
+#include <dirent.h>
+void seekdir(DIR *d, long loc) { return; }],[return 0;],
samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
AC_DEFINE(SEEKDIR_RETURNS_VOID)
AC_DEFINE(HAVE_SYSV_IPC)
fi
+#################################################
+# 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)],
+[ case "$withval" in
+ yes)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_SMBWRAPPER)
+ WRAP="bin/smbsh bin/smbwrapper.so"
+
+ if test x$ATTEMPT_WRAP32_BUILD = x; then
+ WRAP32=""
+ else
+ WRAP32=bin/smbwrapper.32.so
+ fi
+
+# Conditions under which smbwrapper should not be built.
+
+ if test x$PICFLAG = x; then
+ echo No support for PIC code - disabling smbwrapper and smbsh
+ WRAP=""
+ WRAP32=""
+ elif test x$ac_cv_func_syscall = xno; then
+ AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
+ WRAP=""
+ WRAP32=""
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
+
#################################################
# check for the AFS filesystem
AC_MSG_CHECKING(whether to use AFS)
AC_MSG_RESULT(no)
)
+#################################################
+# check for experimental disk-quotas support
+QUOTAOBJS=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)],
+[ case "$withval" in
+ yes)
+ AC_MSG_RESULT(yes)
+ QUOTAOBJS=quotas.o
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
+AC_SUBST(QUOTAOBJS)
#################################################
# these tests are taken from the GNU fileutils package