dnl --allow-shlib-undefined flag defined. This causes a stackload of
dnl warnings when building modules.
if test "$ac_cv_prog_gnu_ld" = "yes"; then
- ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>/dev/null | head -1`
+ ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>&1 < /dev/null | grep "GNU ld"`
AC_MSG_CHECKING(GNU ld release date)
changequote(,)dnl
ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
if test "x$CUPS_CONFIG" != x; then
- ac_save_CFLAGS=$CFLAGS
ac_save_LDFLAGS=$LDFLAGS
ac_save_PRINT_LIBS=$PRINT_LIBS
- CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
- LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
- PRINT_LIBS="$PRINT_LIBS -lcups"
AC_CHECK_HEADERS(cups/cups.h cups/language.h)
+
if test x"$ac_cv_header_cups_cups_h" = xyes -a \
x"$ac_cv_header_cups_language_h" = xyes; then
+ # try linking with -lcups alone first. That should work unless libcups is
+ # underlinked. With cups-config --libs we pull in unwanted and unneeded
+ # dendencies including thread libraries - use cups-config only if really
+ # required.
+ AC_CHECK_LIB_EXT(cups, ac_save_PRINT_LIBS , httpConnect,
+ [PRINT_LIBS"$ac_save_PRINT_LIBS -lcups"],
+ [AC_MSG_WARN([your cups library doesn't link with -lcups alone, it might be underlinked.]) ;
+ PRINT_LIBS="$ac_save_PRINT_LIBS `$CUPS_CONFIG --libs`"])
+
AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
samba_cv_HAVE_CUPS=yes
AC_CHECK_LIB_EXT(cups, PRINT_LIBS, httpConnectEncrypt)
AC_CHECK_FUNCS(setsid glob strpbrk crypt16 getauthuid)
AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
+AC_CHECK_FUNCS(getgrset)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocate posix_fallocate64)
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
AC_DEFINE(HAVE_STAT_DOS_FLAGS, 1, [whether there is DOS flags support in the stat struct])
fi
+AC_CACHE_CHECK([whether we can compile with __attribute__((destructor))],
+ samba_cv_function_attribute_destructor,
+ [
+ AC_COMPILE_IFELSE(
+ [
+ __attribute__((destructor))
+ static void cleanup(void) { }
+ ],
+ samba_cv_function_attribute_destructor=yes)
+ ])
+
+if test x"$samba_cv_function_attribute_destructor" = xyes ; then
+ AC_DEFINE(HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR, 1,
+ [whether we can compile with __attribute__((destructor))])
+fi
+
#####################################
# needed for SRV lookups
AC_CHECK_LIB(resolv, dn_expand)
if test "${ac_cv_prog_gnu_ld}" = "yes"; then
DYNEXP="-Wl,-E"
fi
- # TODO: need to add $CFLAGS here for explicit 64-bit builds?
LDSHFLAGS="-shared"
else
PICFLAG="-KPIC"
- ## ${CFLAGS} added for building 64-bit shared
- ## libs using Sun's Compiler
- LDSHFLAGS="-G \${CFLAGS}"
+ LDSHFLAGS="-G"
fi
if test "$ac_cv_prog_gnu_ld" = "yes"; then
SONAMEFLAG="-Wl,-soname="
;;
esac
BLDSHARED="true"
- LDSHFLAGS="-set_version sgi1.0 -shared"
- SONAMEFLAG="-soname "
- SHLD="\${LD}"
+ LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared"
+ SONAMEFLAG="-Wl,-soname,"
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
else
BLDSHARED="true"
LDSHFLAGS="-shared"
SONAMEFLAG="-Wl,-soname,"
- PICFLAG="-fPIC"
+ if test "${GCC}" = "yes"; then
+ PICFLAG="-fPIC"
+ fi
AC_DEFINE(STAT_ST_BLOCKSIZE,512)
AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
;;
AC_MSG_RESULT($BLDSHARED)
+saved_before_as_needed_ldflags="$LDFLAGS"
for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do
saved_ldflags="$LDFLAGS"
AC_MSG_CHECKING([if $flags works])
test x"$ld_as_needed_flag_found" = xyes && break
done
+# check if we have to disable LD_AS_NEEDED_FLAG:
+# On some systems for a veriety of reasons linking with
+# -Wl,--as-needed -lreadline -lncurses fails
+# we have to retest, if these combination is detected before.
+# Bugzilla #7209
+
+if test x$ac_cv_lib_readline_rl_callback_handler_install = xyes ; then
+ if test x$ld_as_needed_flag_found = xyes ; then
+ AC_MSG_CHECKING([if $LD_AS_NEEDED_FLAG works with readline])
+ # try if check no fails
+ save_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ AC_TRY_LINK([], [rl_callback_handler_install();], [AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no]); LDFLAGS="$saved_before_as_needed_ldflags"])
+ LIBS="$save_LIBS"
+ fi
+fi
+
+
+
# for historical reasons almost all linkers don't complain about unresolved
# symbols in shared libs. Except for the internal samba modules we want to get
# errors when we produce a shared lib with unresolved symbols. On some
# variables so they need to be eval'ed.
if AC_TRY_COMMAND([$CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.o ${srcdir-.}/../tests/shlib.c 1>&AS_MESSAGE_LOG_FD])
then
- if AC_TRY_COMMAND([`eval echo "$SHLD"` `eval echo "$LDSHFLAGS"` -o "shlib.$SHLIBEXT" shlib.o 1>&AS_MESSAGE_LOG_FD])
+ if AC_TRY_COMMAND([`eval echo "$SHLD $LDSHFLAGS $PICFLAG"` -o "shlib.$SHLIBEXT" shlib.o 1>&AS_MESSAGE_LOG_FD])
then
ac_cv_shlib_works=yes
fi
AC_DEFINE(SIZEOF_TIME_T,8,[The size of the 'time_t' type])
fi
+AC_CACHE_CHECK([for TIME_T_MAX],samba_cv_TIME_T_MAX,[
+AC_TRY_RUN([#include <time.h>
+main() {
+ struct tm *tm;
+ if (sizeof(time_t) == 8) {
+ time_t max_time = 0x7fffffffffffffffll;
+ tm = gmtime(&max_time);
+ /* This should fail with 32-bit tm_year. */
+ if (tm == NULL) {
+ /* Max time_t that works with 32-bit int tm_year in struct tm. */
+ max_time = 67768036191676799ll;
+ tm = gmtime(&max_time);
+ if (tm) {
+ exit(0);
+ }
+ }
+ }
+ exit(1);
+}],
+samba_cv_TIME_T_MAX=yes,samba_cv_TIME_T_MAX=no,samba_cv_TIME_T_MAX=cross)])
+if test x"$samba_cv_TIME_T_MAX" = x"yes"; then
+ AC_DEFINE(TIME_T_MAX,67768036191676799ll,[The maximum value of the 'time_t' type])
+fi
+
+
AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
#################################################
# Check for DMAPI interfaces in libdm/libjfsdm/libxsdm
-SMB_CHECK_DMAPI([], AC_MSG_NOTICE(DMAPI support not present) )
+
+with_dmapi_support=auto
+AC_MSG_CHECKING(whether to use DMAPI support)
+AC_ARG_WITH(dmapi,
+[AS_HELP_STRING([--with-dmapi], [Include DMAPI/XDSM support (default=auto)])],
+[ case "$withval" in
+ yes|no)
+ with_dmapi_support=$withval
+ ;;
+ esac ]
+)
+AC_MSG_RESULT([$with_dmapi_support])
+
+if test x"$with_dmapi_support" != xno ; then
+ SMB_CHECK_DMAPI([], [
+ AC_MSG_NOTICE(DMAPI support not present)
+ if test x"$with_dmapi_support" = xyes ; then
+ AC_MSG_ERROR(no DMAPI support found but requested!)
+ fi
+ ]
+ )
+fi
# Add TSM SM VFS module only if there are both GPFS and DMAPI support
# Theoretically it should work with AIX JFS2 too but this needs testing