Automatically enable merged build (for more complete 'make test') when possible durin...
[ira/wip.git] / source3 / configure.in
index 1eba4a0a58122fc5ee1477926daa3a0e7fac2a9a..cd849349c082f8b7ab9c1941beb776cf84d4ce47 100644 (file)
@@ -350,7 +350,7 @@ AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_C
 ],
        samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv__CC_NEGATIVE_ENUM_VALUES=no)])
 if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
-       AC_MSG_WARN([using --unit-enums for pidl])
+       AC_MSG_WARN([using --uint-enums for pidl])
        PIDL_ARGS="$PIDL_ARGS --uint-enums"
 fi
 
@@ -657,6 +657,8 @@ AC_SUBST(LIBREPLACE_OBJS)
 
 # add -ldl to the global LIBS
 LIBS="${LIBS} ${LIBDL} ${LIBREPLACE_NETWORK_LIBS}"
+AUTH_LIBS="${AUTH_LIBS} ${CRYPT_LIBS}"
+
 
 AC_CHECK_HEADERS(aio.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h memory.h alloca.h)
@@ -4318,12 +4320,6 @@ AC_ARG_WITH(pam_smbpass,
 )
 
 
-###############################################
-# test for where we get crypt() from
-AC_SEARCH_LIBS(crypt, [crypt],
-  [test "$ac_cv_search_crypt" = "none required" || AUTH_LIBS="-lcrypt $AUTH_LIBS"
-  AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
-
 ##
 ## moved after the check for -lcrypt in order to
 ## ensure that the necessary libraries are included
@@ -6219,13 +6215,52 @@ MSG
 fi
 
 AC_ARG_ENABLE(merged-build, 
-[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])])
+[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 = xauto; then
+       merged_build_possible=yes
+
+       # Check for GNU make
+       m4_include(../source4/build/m4/check_make.m4)
+       AC_SAMBA_GNU_MAKE([true], [merged_build_possible=no])
+
+       # Check for perl
+       m4_include(../source4/build/m4/check_perl.m4)
+       AC_SAMBA_PERL([true], [merged_build_possible=no])
+
+       # Check for python
+       m4_include(../source4/build/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
        m4_include(samba4.m4)
 fi
 
+m4_include(../lib/zlib/zlib.m4)
+AC_SUBST(ZLIB_LIBS)
+AC_SUBST(ZLIB_OBJS)
+AC_ZLIB([ZLIB_OBJS=""], [
+       ZLIB_LIBS=""
+       for o in adler32.o compress.o crc32.o gzio.o uncompr.o \
+                    deflate.o trees.o zutil.o inflate.o infback.o \
+                        inftrees.o inffast.o
+       do
+               ZLIB_OBJS="$ZLIB_OBJS ../lib/zlib/$o"
+       done
+       CFLAGS="$CFLAGS -I../lib/zlib"
+])
+
 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
 LIB_REMOVE_USR_LIB(LDFLAGS)
 LIB_REMOVE_USR_LIB(LIBS)