Merge branch 'singlereplace' into single
[ira/wip.git] / source3 / configure.in
index f813e87fb751a5d1b6b66f0b799a270d8e3d31a4..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,7 +33,7 @@ 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)
@@ -43,12 +43,12 @@ 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 lib/tdb/$o"
+       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"
@@ -131,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)
 
@@ -878,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>
@@ -6200,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)
@@ -6248,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