summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in158
1 files changed, 65 insertions, 93 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 5acdb41028..fd4441a4be 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -173,17 +173,17 @@ AC_ARG_ENABLE(debug,
CFLAGS="${CFLAGS} -g"
fi])
-AC_ARG_ENABLE(developer, [ --enable-developer turn on developer warnings and debugging [default=no]],
+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])
-AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer turn on developer warnings and debugging, except -Wstrict-prototypes [default=no]],
+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]])
+AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable heap debugging [default=no]])
if test "x$enable_dmalloc" = xyes
then
@@ -198,6 +198,10 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_AWK
+dnl Check if we use GNU ld
+LD=ld
+AC_PROG_LD_GNU
+
dnl needed before AC_TRY_COMPILE
AC_ISC_POSIX
@@ -498,16 +502,17 @@ AC_CHECK_TYPE(wchar_t, unsigned short)
############################################
# for cups support we need libcups, and a handful of header files
-AC_CHECK_LIB(cups,httpConnect)
+AC_ARG_ENABLE(cups,
+[ --enable-cups Turn on CUPS support (default=auto)])
-# I wonder if there is a nicer way of doing this?
+if test x$enable_cups != xno; then
+ AC_PATH_PROG(CUPS_CONFIG, cups-config)
-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
+ if test "x$CUPS_CONFIG" != x; then
AC_DEFINE(HAVE_CUPS)
- fi
+ CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
+ LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
+ LIBS="$LIBS `$CUPS_CONFIG --libs`"
fi
fi
@@ -878,12 +883,14 @@ case "$host_os" in
PICFLAG="-fPIC"
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
;;
- *solaris*)
- AC_DEFINE(SUNOS5)
+ *solaris*) AC_DEFINE(SUNOS5)
BLDSHARED="true"
- LDSHFLAGS="-h \$@ -G"
+ LDSHFLAGS="-G"
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
+ if test "${ac_cv_prog_gnu_ld}" = "yes"; then
+ DYNEXP="-Wl,-E"
+ fi
else
PICFLAG="-KPIC"
## ${CFLAGS} added for building 64-bit shared
@@ -896,11 +903,11 @@ case "$host_os" in
;;
*sunos*) AC_DEFINE(SUNOS4)
BLDSHARED="true"
- LDSHFLAGS="-Wl,-h,\$@ -G"
+ LDSHFLAGS="-G"
PICFLAG="-KPIC" # Is this correct for SunOS
;;
*bsd*) BLDSHARED="true"
- LDSHFLAGS="-Wl,-soname,\$@ -shared"
+ LDSHFLAGS="-shared"
DYNEXP="-Wl,-Bdynamic"
PICFLAG="-fPIC"
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
@@ -912,7 +919,7 @@ case "$host_os" in
esac
ATTEMPT_WRAP32_BUILD=yes
BLDSHARED="true"
- LDSHFLAGS="-soname \$@ -shared"
+ LDSHFLAGS="-set_version sgi1.0 -shared"
SHLD="\${LD}"
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
@@ -924,16 +931,24 @@ case "$host_os" in
*aix*) AC_DEFINE(AIX)
BLDSHARED="true"
LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
+ DYNEXP="-Wl,-brtl,-bexpall"
+ if test "${GCC}" = "yes"; then
+ PICFLAG="-O2"
+ else
PICFLAG="-O2 -qmaxmem=6000"
+ ## for funky AIX compiler using strncpy()
+ CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT"
+ fi
+
AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
;;
*hpux*) AC_DEFINE(HPUX)
SHLIBEXT="sl"
# Use special PIC flags for the native HP-UX compiler.
if test $ac_cv_prog_cc_Ae = yes; then
- SHLD="/usr/bin/ld"
BLDSHARED="true"
- LDSHFLAGS="-B symbolic -b -z +h \$@"
+ SHLD="/usr/bin/ld"
+ LDSHFLAGS="-B symbolic -b -z"
PICFLAG="+z"
fi
DYNEXP="-Wl,-E"
@@ -942,31 +957,26 @@ case "$host_os" in
*qnx*) AC_DEFINE(QNX);;
*osf*) AC_DEFINE(OSF1)
BLDSHARED="true"
- LDSHFLAGS="-Wl,-soname,\$@ -shared"
+ LDSHFLAGS="-shared"
PICFLAG="-fPIC"
;;
- *sco*)
- AC_DEFINE(SCO)
- ;;
+ *sco*) AC_DEFINE(SCO);;
*unixware*) AC_DEFINE(UNIXWARE)
BLDSHARED="true"
- LDSHFLAGS="-Wl,-soname,\$@ -shared"
+ LDSHFLAGS="-shared"
PICFLAG="-KPIC"
;;
*next2*) AC_DEFINE(NEXT2);;
*dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
*sysv4*)
case "$host" in
- *-univel-*)
- if [ test "$GCC" != yes ]; then
+ *-univel-*) if [ test "$GCC" != yes ]; then
AC_DEFINE(HAVE_MEMSET)
fi
LDSHFLAGS="-G"
DYNEXP="-Bexport"
;;
- *mips-sni-sysv4*)
- AC_DEFINE(RELIANTUNIX)
- ;;
+ *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);;
esac
;;
@@ -1097,7 +1107,7 @@ AC_TRY_COMPILE([
#include <dirent.h>],
[struct dirent64 de;],
samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
-if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes"; then
+if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
AC_DEFINE(HAVE_STRUCT_DIRENT64)
fi
@@ -1576,7 +1586,7 @@ fi
AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/popt -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
+CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/smbwrapper"
AC_TRY_COMPILE([
#define REPLACE_GETPASS 1
#define NO_CONFIG_H 1
@@ -2281,69 +2291,6 @@ AC_ARG_WITH(utmp,
)
#################################################
-# set private directory location
-AC_ARG_WITH(privatedir,
-[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody calls it without argument
- #
- AC_MSG_WARN([--with-privatedir called without argument - will use default])
- privatedir='${prefix}/private'
- ;;
- * )
- privatedir="$withval"
- ;;
- esac
- AC_SUBST(privatedir)],
- [privatedir='${prefix}/private'
- AC_SUBST(privatedir)]
-)
-
-#################################################
-# set lock directory location
-AC_ARG_WITH(lockdir,
-[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody calls it without argument
- #
- AC_MSG_WARN([--with-lockdir called without argument - will use default])
- lockdir='$(VARDIR)/locks'
- ;;
- * )
- lockdir="$withval"
- ;;
- esac
- AC_SUBST(lockdir)],
- [lockdir='$(VARDIR)/locks'
- AC_SUBST(lockdir)]
-)
-
-#################################################
-# set SWAT directory location
-AC_ARG_WITH(swatdir,
-[ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody does it
- #
- AC_MSG_WARN([--with-swatdir called without argument - will use default])
- swatdir='${prefix}/swat'
- ;;
- * )
- swatdir="$withval"
- ;;
- esac
- AC_SUBST(swatdir)],
- [swatdir='${prefix}/swat'
- AC_SUBST(swatdir)]
-)
-
-#################################################
# choose native language(s) of man pages
AC_MSG_CHECKING(chosen man pages' language(s))
AC_ARG_WITH(manpages-langs,
@@ -2739,6 +2686,31 @@ else
AC_MSG_RESULT(no$winbind_no_reason)
fi
+
+# Check for FreeBSD problem with getgroups
+# It returns EGID too many times in the list of groups
+# and causes a security problem
+AC_CACHE_CHECK([whether or not getgroups returns EGID too many times],
+ samba_cv_have_getgroups_too_many_egids,[AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ gid_t groups[10];
+ int n = 10;
+
+ n = getgroups(n, &groups);
+ /* Could actually pass back the number of EGIDs there ... */
+ exit((n > 1 && groups[0] == getegid() && groups[1] == getegid()) ? 1 : 0);
+}],
+ samba_cv_have_getgroups_too_many_egids=no,samba_cv_have_getgroups_too_many_egids=yes, samba_cv_have_getgroups_too_many_egids=cross)])
+if test x"$samba_cv_have_getgroups_too_many_egids" = x"yes"; then
+ AC_DEFINE(HAVE_GETGROUPS_TOO_MANY_EGIDS)
+fi
+
+
+
# Substitution time!
AC_SUBST(WINBIND_TARGETS)