s3:build: remove redundant qnx block size definition
[ira/wip.git] / source3 / configure.in
index 693fe6a061df7efc245d8f4bca1c583afdc64555..c7ad8e7d27f1b0933d05b0ff487876f964f2efad 100644 (file)
@@ -1057,7 +1057,7 @@ 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(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
-AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64)
+AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocate posix_fallocate64)
 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(getpwent_r)
@@ -1541,9 +1541,10 @@ DSO_EXPORTS=""
 
   # and these are for particular systems
   case "$host_os" in
-               *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
-                       case "$host_os" in *linux*)
-                               AC_DEFINE(LINUX,1,[Whether the host os is linux]) ;;
+               *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu | *qnx*)
+                       case "$host_os" in
+                               *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux]) ;;
+                               *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx]) ;;
                        esac
                        BLDSHARED="true"
                        LDSHFLAGS="-shared -Wl,-Bsymbolic"
@@ -1656,9 +1657,6 @@ DSO_EXPORTS=""
                        AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
                        AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element])
                        ;;
-               *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
-                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
-                       ;;
                *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
                        BLDSHARED="true"
                        LDSHFLAGS="-shared"
@@ -1837,6 +1835,194 @@ AC_DEFINE_UNQUOTED(SHLIBEXT, "$SHLIBEXT", [Shared library extension])
 
 AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
 
+
+###########################################################
+#
+# Configuration of subsystems / libraries
+#
+###########################################################
+
+INSTALLLIBCMD_SH=:
+INSTALLLIBCMD_A=:
+UNINSTALLLIBCMD_SH=:
+UNINSTALLLIBCMD_A=:
+
+if test $BLDSHARED = true; then
+       INSTALLLIBCMD_SH="\$(INSTALLCMD)"
+       UNINSTALLLIBCMD_SH="rm -f"
+fi
+if test $enable_static = yes; then
+       INSTALLLIBCMD_A="\$(INSTALLCMD)"
+       UNINSTALLLIBCMD_A="rm -f"
+fi
+
+#################################################
+# --disable-shared-libs
+# can be used to disable the internal use of shared libs altogether
+# (this only has an effect when building shared libs is enabled)
+#
+USESHARED=false
+AC_SUBST(USESHARED)
+
+AC_MSG_CHECKING(whether to use shared libraries internally)
+AC_ARG_ENABLE([shared-libs],
+       AS_HELP_STRING([--enable-shared-libs],
+               [Use shared libraries internally (default=yes)]),
+       [enable_shared_libs=$enableval],
+       [enable_shared_libs=yes])
+
+if test x"$enable_shared_libs" != x"no" ; then
+       USESHARED=$BLDSHARED
+fi
+
+AC_MSG_RESULT([$USESHARED])
+
+if test x"$enable_shared_libs" = x"yes" -a x"$BLDSHARED" != x"true" ; then
+       AC_MSG_WARN([--enable-shared-libs: no support for shared libraries])
+fi
+
+#################################################
+# --with-static-libs=LIBS:
+#   link (internal) libs dynamically or statically?
+#
+# If a subsystem is built as a library then this controls whether they are
+# linked into Samba targets statically or dynamically:
+#
+# * If we build the shared library at all, we link dynamically by default.
+#
+# * We only link statically if we don't build shared or if the library
+#   appears in the --with-static-libs configure option.
+#
+# Example:
+#   --with-static-libs=libtalloc makes use of libtalloc.a instead
+#   of linking the dynamic variant with -ltalloc.
+#
+# NOTE: This option only affects libraries that we do not only build
+# but that samba also links against as libraries (as opposed to linking
+# the plain object files. - This has to be configured in Makefile.in.
+# So in particular it does not harm to give invalid or unknown names here.
+#
+
+AC_ARG_WITH([static-libs],
+       [AS_HELP_STRING([--with-static-libs=LIBS],
+               [Comma-separated list of names of (internal) libraries to link statically (instead of dynamically)])],
+       [AS_IF([test $withval],
+               [for lib in `echo $withval | sed -e 's/,/ /g'` ; do
+                       [lib=`echo $lib | tr '[a-z]' '[A-Z]'`]
+                       eval LINK_$lib=STATIC
+               done], [])],
+       [])
+
+#
+# WORKAROUND:
+#   until we have organized other internal subsystems (as util, registry
+#   and smbconf) into shared libraries, we CAN NOT link libnetapi
+#   dynamically to samba programs.
+#
+LINK_LIBNETAPI=STATIC
+
+LINK_LIBSMBCLIENT=STATIC
+
+#
+#  The library versions are hardcoded here
+#  and filled into the LIBFOO_SOVER variable.
+#
+#  TODO: for talloc and tdb (at least), these should
+#  be extracted from their respective source directories
+#
+AC_ARG_ENABLE(external_libtalloc, [AS_HELP_STRING([--enable-external-libtalloc], [Enable external talloc [default=auto]])],
+[ enable_external_libtalloc=$enableval ], [ enable_external_libtalloc=auto ])
+
+if test "x$enable_external_libtalloc" != xno
+then
+       PKG_CHECK_MODULES(LIBTALLOC, talloc >= 2.0.1,
+               [ enable_external_libtalloc=yes ],
+               [ if test x$enable_external_libtalloc = xyes; then
+                       AC_MSG_ERROR([Unable to find libtalloc])
+                 else
+                       enable_external_libtalloc=no
+                 fi
+               ])
+fi
+
+if test "x$enable_external_libtalloc" = xno
+then
+       m4_include(../lib/talloc/libtalloc.m4)
+       LINK_LIBTALLOC=STATIC
+       SMB_LIBRARY(talloc, 2)
+       LIBTALLOC_OBJ0=""
+       for obj in ${TALLOC_OBJ}; do
+               LIBTALLOC_OBJ0="${LIBTALLOC_OBJ0} ${tallocdir}/${obj}"
+       done
+       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TALLOC_CFLAGS}"
+       SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${TALLOC_CFLAGS}"
+       AC_SUBST(LIBTALLOC_OBJ0)
+
+       TALLOCTORT="bin/talloctort\$(EXEEXT)"
+       AC_SUBST(TALLOCTORT)
+fi
+
+
+AC_ARG_ENABLE(external_libtdb,
+       [AS_HELP_STRING([--enable-external-libtdb],
+               [Enable external tdb [default=auto]])],
+               [ enable_external_libtalloc=$enableval ],
+               [ enable_external_libtalloc=auto ])
+
+if test "x$enable_external_libtdb" != xno
+then
+       PKG_CHECK_MODULES(LIBTDB, tdb >= 1.1.4,
+               [ enable_external_libtdb=yes ],
+               [
+               if test x$enable_external_libtdb = xyes; then
+                       AC_MSG_ERROR([Unable to find libtdb])
+               else
+                       enable_external_libtdb=no
+               fi
+               ])
+fi
+
+AC_SUBST(LIBTDB_OBJ0)
+if test "x$enable_external_libtdb" = xno
+then
+       m4_include(../lib/tdb/libtdb.m4)
+       LINK_LIBTDB=STATIC
+       SMB_LIBRARY(tdb, 1)
+       LIBTDB_OBJ0=""
+       for obj in ${TDB_OBJ}; do
+               LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
+       done
+       AC_SUBST(LIBTDB_OBJ0)
+       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
+       SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CONFIGURE_CPPFLAGS} ${TDB_CFLAGS}"
+
+       TDBBACKUP="bin/tdbbackup\$(EXEEXT)"
+       AC_SUBST(TDBBACKUP)
+       TDBDUMP="bin/tdbdump\$(EXEEXT)"
+       AC_SUBST(TDBDUMP)
+       TDBTOOL="bin/tdbtool\$(EXEEXT)"
+       AC_SUBST(TDBTOOL)
+       TDBTORTURE="bin/tdbtorture\$(EXEEXT)"
+       AC_SUBST(TDBTORTURE)
+       ac_cv_have_tdb_err_nesting=yes
+else
+       AC_TRY_COMPILE([#include "tdb.h"],
+                      [enum TDB_ERROR err = TDB_ERR_NESTING],
+                      ac_cv_have_tdb_err_nesting=yes,
+                      ac_cv_have_tdb_err_nesting=no)
+fi
+
+if test x"$ac_cv_have_tdb_err_nesting" = xyes; then
+   AC_DEFINE(HAVE_TDB_ERR_NESTING, 1, [Whether we have TDB_ERR_NESTING])
+fi
+
+SMB_LIBRARY(netapi, 0)
+SMB_LIBRARY(smbclient, 0)
+SMB_LIBRARY(smbsharemodes, 0)
+SMB_LIBRARY(addns, 0, no, [undefined API])
+
+
+
 ################
 
 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
@@ -3370,15 +3556,12 @@ if test x"$with_ads_support" != x"no"; then
     AC_TRY_COMPILE(
       [#define KRB5_DEPRECATED 1
       #include <krb5.h>],
-      [void main(void) {}],
+      [],
       samba_cv_HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER=yes,
       samba_cv_HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER=no)])
 
   if test x"$samba_cv_HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER" = x"yes"; then
-    AC_DEFINE(KRB5_DEPRECATED, 1,
-              [Whether to use deprecated krb5 interfaces])
-  else
-    AC_DEFINE(KRB5_DEPRECATED,,
+    AC_DEFINE(HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER, 1,
               [Whether to use deprecated krb5 interfaces])
   fi
 fi
@@ -4766,173 +4949,6 @@ else
         AC_MSG_RESULT(no$utmp_no_reason)
 fi
 
-INSTALLLIBCMD_SH=:
-INSTALLLIBCMD_A=:
-UNINSTALLLIBCMD_SH=:
-UNINSTALLLIBCMD_A=:
-
-if test $BLDSHARED = true; then
-       INSTALLLIBCMD_SH="\$(INSTALLCMD)"
-       UNINSTALLLIBCMD_SH="rm -f"
-fi
-if test $enable_static = yes; then
-       INSTALLLIBCMD_A="\$(INSTALLCMD)"
-       UNINSTALLLIBCMD_A="rm -f"
-fi
-
-#################################################
-# --disable-shared-libs
-# can be used to disable the internal use of shared libs altogether
-# (this only has an effect when building shared libs is enabled)
-#
-USESHARED=false
-AC_SUBST(USESHARED)
-
-AC_MSG_CHECKING(whether to use shared libraries internally)
-AC_ARG_ENABLE([shared-libs],
-       AS_HELP_STRING([--enable-shared-libs],
-               [Use shared libraries internally (default=yes)]),
-       [enable_shared_libs=$enableval],
-       [enable_shared_libs=yes])
-
-if test x"$enable_shared_libs" != x"no" ; then
-       USESHARED=$BLDSHARED
-fi
-
-AC_MSG_RESULT([$USESHARED])
-
-if test x"$enable_shared_libs" = x"yes" -a x"$BLDSHARED" != x"true" ; then
-       AC_MSG_WARN([--enable-shared-libs: no support for shared libraries])
-fi
-
-#################################################
-# --with-static-libs=LIBS:
-#   link (internal) libs dynamically or statically?
-#
-# If a subsystem is built as a library then this controls whether they are
-# linked into Samba targets statically or dynamically:
-#
-# * If we build the shared library at all, we link dynamically by default.
-#
-# * We only link statically if we don't build shared or if the library
-#   appears in the --with-static-libs configure option.
-#
-# Example:
-#   --with-static-libs=libtalloc makes use of libtalloc.a instead
-#   of linking the dynamic variant with -ltalloc.
-#
-# NOTE: This option only affects libraries that we do not only build
-# but that samba also links against as libraries (as opposed to linking
-# the plain object files. - This has to be configured in Makefile.in.
-# So in particular it does not harm to give invalid or unknown names here.
-#
-
-AC_ARG_WITH([static-libs],
-       [AS_HELP_STRING([--with-static-libs=LIBS],
-               [Comma-separated list of names of (internal) libraries to link statically (instead of dynamically)])],
-       [AS_IF([test $withval],
-               [for lib in `echo $withval | sed -e 's/,/ /g'` ; do
-                       [lib=`echo $lib | tr '[a-z]' '[A-Z]'`]
-                       eval LINK_$lib=STATIC
-               done], [])],
-       [])
-
-#
-# WORKAROUND:
-#   until we have organized other internal subsystems (as util, registry
-#   and smbconf) into shared libraries, we CAN NOT link libnetapi
-#   dynamically to samba programs.
-#
-LINK_LIBNETAPI=STATIC
-
-LINK_LIBSMBCLIENT=STATIC
-
-#
-#  The library versions are hardcoded here
-#  and filled into the LIBFOO_SOVER variable.
-#
-#  TODO: for talloc and tdb (at least), these should
-#  be extracted from their respective source directories
-#
-AC_ARG_ENABLE(external_libtalloc, [AS_HELP_STRING([--enable-external-libtalloc], [Enable external talloc [default=auto]])], 
-[ enable_external_libtalloc=$enableval ], [ enable_external_libtalloc=auto ])
-
-if test "x$enable_external_libtalloc" != xno
-then
-       PKG_CHECK_MODULES(LIBTALLOC, talloc >= 2.0.1,
-               [ enable_external_libtalloc=yes ],
-               [ if test x$enable_external_libtalloc = xyes; then
-                       AC_MSG_ERROR([Unable to find libtalloc])
-             else 
-                       enable_external_libtalloc=no
-                 fi
-               ])
-fi
-
-if test "x$enable_external_libtalloc" = xno
-then
-       m4_include(../lib/talloc/libtalloc.m4)
-       LINK_LIBTALLOC=STATIC
-       SMB_LIBRARY(talloc, 2)
-       LIBTALLOC_OBJ0=""
-       for obj in ${TALLOC_OBJ}; do
-               LIBTALLOC_OBJ0="${LIBTALLOC_OBJ0} ${tallocdir}/${obj}"
-       done
-       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TALLOC_CFLAGS}"
-       AC_SUBST(LIBTALLOC_OBJ0)
-
-       TALLOCTORT="bin/talloctort\$(EXEEXT)"
-       AC_SUBST(TALLOCTORT)
-fi
-
-
-AC_ARG_ENABLE(external_libtdb,
-       [AS_HELP_STRING([--enable-external-libtdb],
-               [Enable external tdb [default=auto]])],
-               [ enable_external_libtalloc=$enableval ],
-               [ enable_external_libtalloc=auto ])
-
-if test "x$enable_external_libtdb" != xno
-then
-       PKG_CHECK_MODULES(LIBTDB, tdb >= 1.1.4,
-               [ enable_external_libtdb=yes ],
-               [
-               if test x$enable_external_libtdb = xyes; then
-                       AC_MSG_ERROR([Unable to find libtdb])
-               else
-                       enable_external_libtdb=no
-               fi
-               ])
-fi
-
-AC_SUBST(LIBTDB_OBJ0)
-if test "x$enable_external_libtdb" = xno
-then
-       m4_include(../lib/tdb/libtdb.m4)
-       LINK_LIBTDB=STATIC
-       SMB_LIBRARY(tdb, 1)
-       LIBTDB_OBJ0=""
-       for obj in ${TDB_OBJ}; do
-               LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
-       done
-       AC_SUBST(LIBTDB_OBJ0)
-       SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
-
-       TDBBACKUP="bin/tdbbackup\$(EXEEXT)"
-       AC_SUBST(TDBBACKUP)
-       TDBDUMP="bin/tdbdump\$(EXEEXT)"
-       AC_SUBST(TDBDUMP)
-       TDBTOOL="bin/tdbtool\$(EXEEXT)"
-       AC_SUBST(TDBTOOL)
-       TDBTORTURE="bin/tdbtorture\$(EXEEXT)"
-       AC_SUBST(TDBTORTURE)
-fi
-
-SMB_LIBRARY(netapi, 0)
-SMB_LIBRARY(smbclient, 0)
-SMB_LIBRARY(smbsharemodes, 0)
-SMB_LIBRARY(addns, 0, no, [undefined API])
-
 
 #################################################
 # these tests are taken from the GNU fileutils package
@@ -5196,7 +5212,7 @@ AC_ARG_WITH(ctdb,
   esac])
 
 SAVED_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $CTDB_CPPFLAGS"
+CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS"
 ctdb_broken="missing or broken headers"
 
 AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[