Merge branch 'singlereplace' into single
[metze/samba/wip.git] / source3 / configure.in
index 81f41c125786634790c531b89657cdf09ac7e96e..2801125b1138eac552b3a3fab41ce14aea78a69d 100644 (file)
@@ -23,7 +23,7 @@ m4_include(m4/check_path.m4)
 
 AC_LIBREPLACE_CC_CHECKS
 
-m4_include(lib/talloc/libtalloc.m4)
+m4_include(../talloc/libtalloc.m4)
 
 LIBTALLOC_OBJ0=""
 for obj in ${TALLOC_OBJ}; do
@@ -33,20 +33,22 @@ AC_SUBST(LIBTALLOC_OBJ0)
 
 # TODO: These should come from m4_include(lib/tdb/libtdb.m4)
 # but currently this fails: things have to get merged from s4.
-tdbdir="lib/tdb"
+tdbdir="../tdb"
 AC_SUBST(tdbdir)
 TDB_CFLAGS="-I${srcdir-.}/$tdbdir/include"
 AC_SUBST(TDB_CFLAGS)
-TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
-TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o"
-AC_SUBST(TDB_OBJ)
 
 LIBTDB_OBJ0=""
-for o in $TDB_OBJ; do LIBTDB_OBJ0="$LIBTDB_OBJ0 lib/tdb/$o"; done
+for o in common/tdb.o common/dump.o common/transaction.o common/error.o \
+            common/traverse.o common/freelist.o common/freelistcheck.o \
+                common/io.o common/lock.o common/open.o; 
+do 
+       LIBTDB_OBJ0="$LIBTDB_OBJ0 $tdbdir/$o"
+done
 
 AC_SUBST(LIBTDB_OBJ0)
 SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include  -I. -I${srcdir-.}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/lib/replace"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../replace"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TALLOC_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/libaddns"
@@ -129,8 +131,6 @@ else
        CFLAGS="-O"
 fi
 
-CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3"
-
 m4_include(lib/socket_wrapper/config.m4)
 m4_include(lib/nss_wrapper/config.m4)
 
@@ -260,7 +260,7 @@ if test "$ac_cv_prog_gnu_ld" = "yes"; then
            if test "$ac_cv_gnu_ld_vernr_major" -lt 2 || test "$ac_cv_gnu_ld_vernr_minor" -lt 14; then
              ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes
            fi
-           if test "$ac_cv_gnu_ld_vernr_major" -gt 2 || test "$ac_cv_gnu_ld_vernr_major"=2 && test "$ac_cv_gnu_ld_vernr_minor" -ge 12; then
+           if test "$ac_cv_gnu_ld_vernr_major" -gt 2 || test "$ac_cv_gnu_ld_vernr_major"=2 && test "$ac_cv_gnu_ld_vernr_minor" -ge 12; then
              ac_cv_gnu_ld_version_script=yes
            fi
         fi
@@ -876,6 +876,21 @@ if test x"$samba_cv_sig_atomic_t" = x"yes"; then
    AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
 fi
 
+AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>],[struct sigevent s;],
+       samba_cv_struct_sigevent=yes,samba_cv_struct_sigevent=no)])
+if test x"$samba_cv_struct_sigevent" = x"yes"; then
+   AC_DEFINE(HAVE_STRUCT_SIGEVENT,1,[Whether we have the struct sigevent])
+   AC_CHECK_MEMBERS([struct sigevent.sigev_value.sival_ptr,struct sigevent.sigev_value.sigval_ptr], , ,
+       [#include <signal.h>])
+fi
+
 AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [
     AC_TRY_COMPILE([
 #include <sys/types.h>
@@ -6198,6 +6213,14 @@ MSG
 
 fi
 
+AC_ARG_ENABLE(merged-build, 
+[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])])
+
+if test x$enable_merged_build = xyes; then
+       MERGED_BUILD=1
+       m4_include(samba4.m4)
+fi
+
 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
 LIB_REMOVE_USR_LIB(LDFLAGS)
 LIB_REMOVE_USR_LIB(LIBS)
@@ -6246,6 +6269,10 @@ fi
 SMBD_LIBS="$samba_dmapi_libs"
 AC_SUBST(SMBD_LIBS)
 
+if test x$MERGED_BUILD != x1; then
+       CFLAGS="${CFLAGS} \$(FLAGS) -D_SAMBA_BUILD_=3"
+fi
+
 AC_OUTPUT(Makefile
          script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh
          lib/netapi/examples/Makefile