Reintroduce merged build, using waf to build smbtorture4.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 6 May 2010 12:08:49 +0000 (14:08 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 7 May 2010 16:34:00 +0000 (18:34 +0200)
source3/Makefile.in
source3/configure.in

index 13cc776115baf69cf1f20c61dec8faf9ddd0fdd1..11b5e5343c07ba3e43a866e9bbaacaa253e94575 100644 (file)
@@ -3213,3 +3213,17 @@ libnetapi_examples: libnetapi
 
 clean_libnetapi_examples:
        $(MAKE) -C lib/netapi/examples clean
+
+../source4/configure: ../buildtools/scripts/configure.waf
+       cd ../source4 && ./autogen.sh
+
+samba4-configure:
+       @test -f ../source4/.lock-wscript || ( cd ../source4 && ./configure.developer --prefix="$(prefix)")
+
+.PHONY: samba4-configure
+
+bin/smbtorture4: samba4-configure
+       cd ../source4 && ../buildtools/bin/waf build --targets=smbtorture   
+       cp ../source4/bin/smbtorture bin/smbtorture4
+
+.PHONY: bin/smbtorture4
index c42139604b232d1c74a348d48b2d976d5e37111c..2e677d7b649a7c294642547ea269014294db168c 100644 (file)
@@ -195,6 +195,8 @@ AC_ARG_WITH(profiling-data,
 )
 
 dnl Checks for programs.
+merged_build_possible=yes
+
 AC_PROG_INSTALL
 AC_PROG_AWK
 # Check for GNU make
@@ -203,7 +205,7 @@ AC_SAMBA_GNU_MAKE([true], [true])
 
 # Check for perl
 m4_include(../m4/check_perl.m4)
-AC_SAMBA_PERL([true], [true])
+AC_SAMBA_PERL([true], [merged_build_possible=no])
 
 AC_CHECK_TOOL(AR, ar)
 
@@ -1834,6 +1836,7 @@ if test x"$BLDSHARED" != x"true"; then
        SHLD="shared-libraries-disabled"
        PICFLAG="${PIE_CFLAGS}"
        SHLIBEXT="shared_libraries_disabled"
+       merged_build_possible=no
 fi
 
 AC_MSG_CHECKING([used PICFLAG])
@@ -4235,6 +4238,10 @@ if test x"$with_ads_support" != x"no"; then
 LIBS="$ac_save_LIBS"
 fi
 
+if test x"$use_ads" != xyes; then
+       merged_build_possible=no
+fi
+
 AC_CHECK_LIB_EXT(nscd, NSCD_LIBS, nscd_flush_cache)
 PASSDB_LIBS="$PASSDB_LIBS $NSCD_LIBS"
 
@@ -6623,8 +6630,42 @@ MSG
 
 fi
 
+AC_ARG_ENABLE(merged-build, 
+[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])], 
+[ enable_merged_build=$enableval ], [ enable_merged_build=auto ])
+
+if test x"$enable_merged_build" = x"yes" -a \
+       x"$merged_build_possible" = x"no" ; then
+       AC_MSG_ERROR(Merged build required but not possible)
+fi
+
 m4_include(../lib/zlib/zlib.m4)
 
+if test x$enable_merged_build = xauto; then
+       # Check for python
+       m4_include(../m4/check_python.m4)
+       AC_SAMBA_PYTHON_DEVEL([true], [merged_build_possible=no])
+
+       AC_MSG_CHECKING([whether it would be possible to do a merged build])
+       AC_MSG_RESULT([$merged_build_possible])
+
+       # Enable merged build automatically if possible, when in developer mode
+       if test "x$developer" = xyes; then
+               enable_merged_build=$merged_build_possible
+       fi
+fi
+
+if test x$enable_merged_build = xyes; then
+       MERGED_BUILD=1
+       saved_USESHARED="$USESHARED"
+       USESHARED="false"
+       smbtorture4_path="bin/smbtorture4"
+       smbtorture4_option="-t bin/smbtorture4"
+       AC_SUBST(smbtorture4_path)
+       AC_SUBST(smbtorture4_option)
+       USESHARED="$saved_USESHARED"
+fi
+
 AC_SUBST(ZLIB_LIBS)
 AC_SUBST(ZLIB_OBJS)
 AC_ZLIB([ZLIB_OBJS=""], [