The branch, master has been updated via 8f8e7c7... Revert "s3-build: Remove --enable-merged support." from 158d41b... s4-smbtorture: make sure to zero the add driver info 8 struct before adding drivers.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8f8e7c788a12d1e0bda9183ed765cc1048e105f7 Author: Günther Deschner <g...@samba.org> Date: Tue Apr 27 18:00:43 2010 +0200 Revert "s3-build: Remove --enable-merged support." This reverts commit f8fc7fcbeb8141c5b2775e2219bae17c55ad4a3c. Was that pushed by coincidence ? merged build is really, really required over here. ----------------------------------------------------------------------- Summary of changes: source3/configure.in | 51 ++++++++- source3/samba4-templates.mk | 144 +++++++++++++++++++++++ source3/samba4.m4 | 211 ++++++++++++++++++++++++++++++++++ source3/samba4.mk | 265 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 668 insertions(+), 3 deletions(-) create mode 100644 source3/samba4-templates.mk create mode 100644 source3/samba4.m4 create mode 100644 source3/samba4.mk Changeset truncated at 500 lines: diff --git a/source3/configure.in b/source3/configure.in index a30f301..9a190cc 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -195,15 +195,17 @@ AC_ARG_WITH(profiling-data, ) dnl Checks for programs. +merged_build_possible=yes + AC_PROG_INSTALL AC_PROG_AWK # Check for GNU make m4_include(../m4/check_make.m4) -AC_SAMBA_GNU_MAKE([true], [true]) +AC_SAMBA_GNU_MAKE([true], [merged_build_possible=no]) # 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) @@ -1829,6 +1831,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]) @@ -4232,6 +4235,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" @@ -6620,8 +6627,39 @@ 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" + m4_include(samba4.m4) + USESHARED="$saved_USESHARED" +fi + AC_SUBST(ZLIB_LIBS) AC_SUBST(ZLIB_OBJS) AC_ZLIB([ZLIB_OBJS=""], [ @@ -6693,7 +6731,14 @@ SMBD_LIBS="$samba_dmapi_libs" AC_SUBST(SMBD_LIBS) CFLAGS="${CFLAGS} \$(FLAGS)" -CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3" + +if test x$MERGED_BUILD != x1; then + CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3" +else + if test x"$BLDSHARED" = x"true" ; then + LDFLAGS="$LDFLAGS -L./bin" + fi +fi AC_SUBST(MAKEFILE) if test x$samba_cv_gnu_make = xyes; then diff --git a/source3/samba4-templates.mk b/source3/samba4-templates.mk new file mode 100644 index 0000000..0024a75 --- /dev/null +++ b/source3/samba4-templates.mk @@ -0,0 +1,144 @@ +# Templates file for Samba 4 +# This relies on GNU make. +# +# © 2008 Jelmer Vernooij <jel...@samba.org> +# +############################################################################### +# Templates +############################################################################### + +# Partially link +# Arguments: target object file, source object files +define partial_link_template +$(1): $(2) ; + @echo Partially linking $$@ + @mkdir -p $$(@D) + @$$(PARTLINK) -o $$@ $$^ +endef + +# Link a binary +# Arguments: target file, depends, flags +define binary_link_template +$(1)4: $(2) ; + @echo Linking $$@ + @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) $$(LIBS) +clean:: + @rm -f $(1) + +everything:: $(1)4 + +endef + +# Link a host-machine binary +# Arguments: target file, depends, flags +define host_binary_link_template +$(1)4: $(2) ; + @echo Linking $$@ + @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +clean:: + rm -f $(1) + +binaries:: $(1)4 + + +endef + +# Create a prototype header +# Arguments: header file, c files +define proto_header_template +echo:: ; + echo $(1) ; + +proto:: $(1) ; + +clean:: ; + rm -f $(1) ; + +$(1): $(2) ; + @echo "Creating $$@" + @$$(PERL) $$(srcdir)/../source4/script/mkproto.pl --srcdir=$$(srcdir)/../source4 --builddir=$$(builddir)/../source4 --public=/dev/null --private=$$@ $$^ +endef + +# Shared module +# Arguments: Target, dependencies, objects +define shared_module_template + +$(1): $(2) ; + @echo Linking $$@ + @mkdir -p $$(@D) + @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +PLUGINS += $(1) + +endef + +# Shared library +# Arguments: Target, dependencies, link flags, soname +define shared_library_template +$(1): $(2) + @echo Linking $$@ + @mkdir -p $$(@D) + @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \ + $(3) \ + $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4))) $$(LIBS) + +ifneq ($(notdir $(1)),$(notdir $(4))) +$(4): $(1) + @echo "Creating symbolic link for $$@" + @ln -fs $$(<F) $$@ +endif + +ifneq ($(notdir $(1)),$(notdir $(5))) +$(5): $(1) $(4) + @echo "Creating symbolic link for $$@" + @ln -fs $$(<F) $$@ +endif +endef + +# Shared alias +# Arguments: Target, subsystem name, alias name +define shared_module_alias_template +bin/modules/$(2)/$(3).$$(SHLIBEXT): $(1) + @ln -fs $$(<F) $$@ + +PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT) + +uninstallplugins:: + @-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT) +installplugins:: + @ln -fs $(1) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT) + +endef + +define shared_module_install_template +installplugins:: bin/modules/$(1)/$(2) + @echo Installing $(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/ + @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2) +uninstallplugins:: + @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2) + +endef + +# abspath for older makes +abspath = $(shell cd $(dir $(1)); pwd)/$(notdir $(1)) + +# Install a binary +# Arguments: path to binary to install +define binary_install_template +installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1))4 + +uninstallbin:: + @echo "Removing $(notdir $(1))4" + @rm -f $$(DESTDIR)$$(bindir)/$(1)4 +endef + +define sbinary_install_template +installsbin:: $$(DESTDIR)$$(sbindir)/$(notdir $(1))4 installdirs + +uninstallsbin:: + @echo "Removing $(notdir $(1))4" + @rm -f $$(DESTDIR)$$(sbindir)/$(1)4 +endef diff --git a/source3/samba4.m4 b/source3/samba4.m4 new file mode 100644 index 0000000..fbc19f1 --- /dev/null +++ b/source3/samba4.m4 @@ -0,0 +1,211 @@ +AC_SUBST(BLDSHARED) +smbtorture4_path="bin/smbtorture4" +smbtorture4_option="-t bin/smbtorture4" +m4_include(build/m4/public.m4) + +m4_include(../m4/check_python.m4) + +AC_SAMBA_PYTHON_DEVEL([ +SMB_EXT_LIB(EXT_LIB_PYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CFLAGS]) +SMB_ENABLE(EXT_LIB_PYTHON,YES) +SMB_ENABLE(LIBPYTHON,YES) +],[ +AC_MSG_ERROR([Python not found. Please install Python 2.x and its development headers/libraries.]) +]) + +AC_MSG_CHECKING(python library directory) +pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1, 0, '\\${prefix}')"` +AC_MSG_RESULT($pythondir) + +AC_SUBST(pythondir) + +SMB_EXT_LIB(LIBREPLACE_EXT, [${LIBDL} ${CRYPT_LIBS}]) +SMB_ENABLE(LIBREPLACE_EXT) + +SMB_EXT_LIB(LIBREPLACE_NETWORK, [${LIBREPLACE_NETWORK_LIBS}]) +SMB_ENABLE(LIBREPLACE_NETWORK) + +SMB_SUBSYSTEM(LIBREPLACE, + [${LIBREPLACE_OBJS}], + [LIBREPLACE_EXT LIBREPLACE_NETWORK], + [-I../lib/replace]) + +LIBREPLACE_HOSTCC_OBJS=`echo ${LIBREPLACE_OBJS} |sed -e 's/\.o/\.ho/g'` + +SMB_SUBSYSTEM(LIBREPLACE_HOSTCC, + [${LIBREPLACE_HOSTCC_OBJS}], + [], + [-I../lib/replace]) + +m4_include(lib/smbreadline/readline.m4) +m4_include(heimdal_build/internal.m4) +m4_include(../lib/util/fault.m4) +m4_include(../lib/util/signal.m4) +m4_include(../lib/util/util.m4) +m4_include(../lib/util/fsusage.m4) +m4_include(../lib/util/xattr.m4) +m4_include(../lib/util/capability.m4) +m4_include(../lib/util/time.m4) +m4_include(../lib/popt/samba.m4) +m4_include(../lib/util/charset/config.m4) +m4_include(lib/socket/config.m4) +m4_include(../nsswitch/nsstest.m4) +m4_include(../pidl/config.m4) +AC_ZLIB([ +SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}]) +],[ +SMB_INCLUDE_MK(lib/zlib.mk) +]) + + +AC_CONFIG_FILES(../source4/lib/registry/registry.pc) +AC_CONFIG_FILES(../source4/librpc/dcerpc.pc) +AC_CONFIG_FILES(../librpc/ndr.pc) +AC_CONFIG_FILES(../lib/torture/torture.pc) +AC_CONFIG_FILES(../source4/auth/gensec/gensec.pc) +AC_CONFIG_FILES(../source4/param/samba-hostconfig.pc) +AC_CONFIG_FILES(../source4/librpc/dcerpc_samr.pc) +AC_CONFIG_FILES(../source4/librpc/dcerpc_atsvc.pc) + +m4_include(../source4/min_versions.m4) + +SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= TALLOC_MIN_VERSION, + [], + [ + SMB_INCLUDE_MK(../lib/talloc/config.mk) + ] +) +# Tallocdir isn't always set by the Samba3 c +tallocdir=../lib/talloc +AC_SUBST(tallocdir) +CFLAGS="$CFLAGS -I../lib/talloc" + +SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= TDB_MIN_VERSION, + [], + [ + m4_include(../lib/tdb/libtdb.m4) + SMB_INCLUDE_MK(../lib/tdb/config.mk) + ] +) + +SMB_INCLUDE_MK(../lib/tdb/python.mk) + +SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent = TEVENT_REQUIRED_VERSION, + [],[m4_include(../lib/tevent/samba.m4)] +) + +SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb = LDB_REQUIRED_VERSION, + [ + SMB_INCLUDE_MK(lib/ldb/ldb_ildap/config.mk) + SMB_INCLUDE_MK(lib/ldb/tools/config.mk) + define_ldb_modulesdir=no + ], + [ + # Here we need to do some tricks + # with AC_CONFIG_COMMANDS_PRE + # as that's the deferrs the commands + # to location after $prefix and $exec_prefix + # have usefull values and directly before + # creating config.status. + # + # The 'eval eval echo' trick is used to + # actually get the raw absolute directory + # path as this is needed in config.h + define_ldb_modulesdir=yes + AC_CONFIG_COMMANDS_PRE([ + if test x"$define_ldb_modulesdir" = x"yes";then + LDB_MODULESDIR=`eval eval echo ${modulesdir}/ldb` + AC_DEFINE_UNQUOTED(LDB_MODULESDIR, "${LDB_MODULESDIR}" , [ldb Modules directory]) + fi + ]) + ldbdir="\$(abspath \$(srcdir)/../source4/lib/ldb)" + AC_SUBST(ldbdir) + m4_include(lib/ldb/sqlite3.m4) + m4_include(lib/ldb/libldb.m4) + SMB_INCLUDE_MK(lib/ldb/config.mk) + AC_CONFIG_FILES(../source4/lib/ldb/ldb.pc) + ] +) +SMB_INCLUDE_MK(lib/ldb/python.mk) + +# Not sure why we need this.. +SMB_ENABLE(swig_ldb,YES) + +# Don't build wbinfo twice +SMB_ENABLE(wbinfo, NO) + +m4_include(lib/tls/config.m4) +m4_include(torture/libnetapi/config.m4) +m4_include(torture/libsmbclient/config.m4) + +dnl m4_include(auth/kerberos/config.m4) +m4_include(auth/gensec/config.m4) +m4_include(smbd/process_model.m4) +m4_include(ntvfs/posix/config.m4) +m4_include(ntvfs/unixuid/config.m4) +m4_include(auth/config.m4) +m4_include(kdc/config.m4) +m4_include(ntvfs/sysdep/config.m4) +m4_include(../nsswitch/config.m4) + +AC_SUBST(INTERN_LDFLAGS) +AC_SUBST(INSTALL_LINK_FLAGS) +if test $USESHARED = "true"; +then + INTERN_LDFLAGS="-L\$(shliboutputdir) -L\${builddir}/bin/static" + INSTALL_LINK_FLAGS="-Wl,-rpath-link,\$(shliboutputdir)"; +else + INTERN_LDFLAGS="-L\${builddir}/bin/static -L\$(shliboutputdir)" +fi + +dnl Samba 4 files +AC_SUBST(LD) +AC_LIBREPLACE_SHLD_FLAGS +dnl Remove -L/usr/lib/? from LDFLAGS and LIBS +LIB_REMOVE_USR_LIB(LDFLAGS) +LIB_REMOVE_USR_LIB(LIBS) +LIB_REMOVE_USR_LIB(KRB5_LIBS) + +dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS +CFLAGS_REMOVE_USR_INCLUDE(CFLAGS) +CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS) +SMB_WRITE_MAKEVARS(samba4-config.mk, [prefix exec_prefix CPPFLAGS LDSHFLAGS POPT_OBJ CFLAGS TALLOC_OBJ POPT_LIBS srcdir builddir]) + +oldbuilddir="$builddir" +builddir="$builddir/../source4" +oldsrcdir="$srcdir" +srcdir="$srcdir/../source4" +AC_SUBST(srcdir) +AC_SUBST(builddir) +SMB_WRITE_PERLVARS(../source4/build/smb_build/config.pm) +builddir="$oldbuilddir" +srcdir="$oldsrcdir" + +echo "configure: creating ../source4/config.mk" +cat >../source4/config.mk<<CEOF +# config.mk - Autogenerated by configure, DO NOT EDIT! +$SMB_INFO_EXT_LIBS +$SMB_INFO_SUBSYSTEMS +$SMB_INFO_LIBRARIES +CEOF + +AC_OUTPUT_COMMANDS([ +cd ${srcdir}/../source4 +$PERL -I${builddir} -I${builddir}/build \ + -I. -Ibuild \ + build/smb_build/main.pl --output=../source3/samba4-data.mk main.mk || exit $? +cd ../source3 +],[ +srcdir="$srcdir" +builddir="$builddir" +PERL="$PERL" + +export PERL +export srcdir +export builddir +]) + +AC_CONFIG_COMMANDS([Makefile-samba4], [ +echo "include samba4.mk" >> ${builddir}/Makefile +]) + diff --git a/source3/samba4.mk b/source3/samba4.mk new file mode 100644 index 0000000..1ad46f2 --- /dev/null +++ b/source3/samba4.mk @@ -0,0 +1,265 @@ +# samba 4 bits + +PROG_LD = $(LD) +BNLD = $(CC) +HOSTLD = $(CC) +PARTLINK = $(PROG_LD) -r +MDLD = $(SHLD) +MDLD_FLAGS = $(LDSHFLAGS) +shliboutputdir = bin/shared + +samba4srcdir = $(srcdir)/../source4 + +# Flags used for the samba 4 files +# $(srcdir)/include is required for config.h +SAMBA4_CFLAGS = -I.. -I$(samba4srcdir) -I$(samba4srcdir)/include \ + -I$(samba4srcdir)/../lib/replace -I$(samba4srcdir)/lib \ + -I$(heimdalsrcdir)/lib/hcrypto -I$(tallocdir) \ + -I$(srcdir)/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H + +.SUFFIXES: .ho + +# No cross compilation for now, thanks +.c.ho: + @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ + dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi + @if test -n "$(CC_CHECKER)"; then \ + echo "Checking $*.c with '$(CC_CHECKER)'";\ + $(CHECK_CC); \ -- Samba Shared Repository