1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Revert "s3-build: Remove --enable-merged support."

This reverts commit f8fc7fcbeb.

Was that pushed by coincidence ? merged build is really, really required over
here.
This commit is contained in:
Günther Deschner 2010-04-27 18:00:43 +02:00
parent 158d41b6b4
commit 8f8e7c788a
4 changed files with 668 additions and 3 deletions

View File

@ -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

144
source3/samba4-templates.mk Normal file
View File

@ -0,0 +1,144 @@
# Templates file for Samba 4
# This relies on GNU make.
#
# © 2008 Jelmer Vernooij <jelmer@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

211
source3/samba4.m4 Normal file
View File

@ -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
])

265
source3/samba4.mk Normal file
View File

@ -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); \
fi
@echo Compiling $*.c
@$(COMPILE) && exit 0;\
echo "The following command failed:" 1>&2;\
echo "$(subst ",\",$(COMPILE_CC))" 1>&2;\
$(COMPILE_CC) >/dev/null 2>&1
# The order really does matter here! GNU Make 3.80 will break if the more specific
# overrides are not specified first.
ifeq ($(MAKE_VERSION),3.81)
%.o: CFLAGS+=$(FLAGS)
../librpc/gen_ndr/%_c.o: CFLAGS=$(SAMBA4_CFLAGS)
../librpc/gen_ndr/py_%.o: CFLAGS=$(SAMBA4_CFLAGS)
$(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
$(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
$(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
$(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
else
$(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
$(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
$(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
$(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
../librpc/gen_ndr/%_c.o: CFLAGS=$(SAMBA4_CFLAGS)
../librpc/gen_ndr/py_%.o: CFLAGS=$(SAMBA4_CFLAGS)
%.o: CFLAGS+=$(FLAGS)
endif
# Create a static library
%.a:
@echo Linking $@
@rm -f $@
@mkdir -p $(@D)
@$(AR) -rc $@ $^
pidldir = $(samba4srcdir)/../pidl
include $(pidldir)/config.mk
include samba4-config.mk
include samba4-templates.mk
zlibsrcdir := $(samba4srcdir)/../lib/zlib
dynconfigsrcdir := $(samba4srcdir)/dynconfig
heimdalsrcdir := $(samba4srcdir)/heimdal
dsdbsrcdir := $(samba4srcdir)/dsdb
smbdsrcdir := $(samba4srcdir)/smbd
clustersrcdir := $(samba4srcdir)/cluster
libnetsrcdir := $(samba4srcdir)/libnet
authsrcdir := $(samba4srcdir)/auth
nsswitchsrcdir := $(samba4srcdir)/../nsswitch
libwbclientsrcdir := $(nsswitchsrcdir)/libwbclient
libsrcdir := $(samba4srcdir)/lib
libsocketsrcdir := $(samba4srcdir)/lib/socket
libcharsetsrcdir := $(samba4srcdir)/../lib/util/charset
ldb_sambasrcdir := $(samba4srcdir)/lib/ldb-samba
libtlssrcdir := $(samba4srcdir)/lib/tls
libregistrysrcdir := $(samba4srcdir)/lib/registry
libmessagingsrcdir := $(samba4srcdir)/lib/messaging
libteventsrcdir := $(samba4srcdir)/../lib/tevent
libeventssrcdir := $(samba4srcdir)/lib/events
libcmdlinesrcdir := $(samba4srcdir)/lib/cmdline
poptsrcdir := $(samba4srcdir)/../lib/popt
socketwrappersrcdir := $(samba4srcdir)/../lib/socket_wrapper
nsswrappersrcdir := $(samba4srcdir)/../lib/nss_wrapper
uidwrappersrcdir := $(samba4srcdir)/../lib/uid_wrapper
libstreamsrcdir := $(samba4srcdir)/lib/stream
libutilsrcdir := $(samba4srcdir)/../lib/util
libtdrsrcdir := ../lib/tdr
libcryptosrcdir := $(samba4srcdir)/../lib/crypto
libtorturesrcdir := ../lib/torture
libcompressionsrcdir := $(samba4srcdir)/../lib/compression
libgencachesrcdir := $(samba4srcdir)/lib
paramsrcdir := $(samba4srcdir)/param
smb_serversrcdir := $(samba4srcdir)/smb_server
rpc_serversrcdir := $(samba4srcdir)/rpc_server
ldap_serversrcdir := $(samba4srcdir)/ldap_server
web_serversrcdir := $(samba4srcdir)/web_server
winbindsrcdir := $(samba4srcdir)/winbind
nbt_serversrcdir := $(samba4srcdir)/nbt_server
wrepl_serversrcdir := $(samba4srcdir)/wrepl_server
cldap_serversrcdir := $(samba4srcdir)/cldap_server
librpcsrcdir := $(samba4srcdir)/librpc
torturesrcdir := $(samba4srcdir)/torture
utilssrcdir := $(samba4srcdir)/utils
ntvfssrcdir := $(samba4srcdir)/ntvfs
ntptrsrcdir := $(samba4srcdir)/ntptr
clientsrcdir := $(samba4srcdir)/client
libclisrcdir := $(samba4srcdir)/libcli
libclinbtsrcdir := $(samba4srcdir)/../libcli/nbt
libclicommonsrcdir := $(samba4srcdir)/../libcli
pyscriptsrcdir := $(samba4srcdir)/scripting/python
kdcsrcdir := $(samba4srcdir)/kdc
smbreadlinesrcdir := $(samba4srcdir)/lib/smbreadline
ntp_signdsrcdir := $(samba4srcdir)/ntp_signd
tdbsrcdir := $(samba4srcdir)/../lib/tdb
ldbsrcdir := $(samba4srcdir)/lib/ldb
tallocsrcdir := $(samba4srcdir)/../lib/talloc
comsrcdir := $(samba4srcdir)/lib/com
override ASN1C = bin/asn1_compile4
override ET_COMPILER = bin/compile_et4
#include $(samba4srcdir)/build/make/python.mk
include samba4-data.mk
include $(samba4srcdir)/static_deps.mk
INSTALLPERMS = 0755
$(foreach SCRIPT,$(wildcard scripting/bin/*),$(eval $(call binary_install_template,$(SCRIPT))))
$(DESTDIR)$(bindir)/%4: bin/%4 installdirs
@mkdir -p $(@D)
@echo Installing $(@F) as $@
@if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
@cp $< $@
@chmod $(INSTALLPERMS) $@
$(DESTDIR)$(sbindir)/%4: bin/%4 installdirs
@mkdir -p $(@D)
@echo Installing $(@F) as $@
@if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
@cp $< $@
@chmod $(INSTALLPERMS) $@
clean::
@echo Removing samba 4 objects
@-find $(samba4srcdir) -name '*.o' -exec rm -f '{}' \;
@echo Removing samba 4 hostcc objects
@-find $(samba4srcdir) -name '*.ho' -exec rm -f '{}' \;
@echo Removing samba 4 libraries
@-rm -f $(STATIC_LIBS) $(SHARED_LIBS)
@-rm -f bin/static/*.a $(shliboutputdir)/*.$(SHLIBEXT) bin/mergedobj/*.o
@echo Removing samba 4 modules
@-rm -f bin/modules/*/*.$(SHLIBEXT)
@-rm -f bin/*_init_module.c
@echo Removing samba 4 dummy targets
@-rm -f bin/.*_*
@echo Removing samba 4 generated files
@-rm -f bin/*_init_module.c
@-rm -rf $(samba4srcdir)/librpc/gen_*
proto:: $(PROTO_HEADERS)
modules:: $(PLUGINS)
#pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
all:: bin/samba4 bin/regpatch4 bin/regdiff4 bin/regshell4 bin/regtree4 bin/smbclient4 setup plugins
torture:: bin/smbtorture4
#
## This is a fake rule to stop any python being invoked as currently the
## build system is broken in source3 with python. JRA.
#
installpython:: bin/smbtorture4
everything:: $(patsubst %,%4,$(BINARIES))
setup:
@ln -sf ../source4/setup setup
S4_LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)="$(builddir)/bin/shared:$$$(LIB_PATH_VAR)"
SELFTEST4 = $(S4_LD_LIBPATH_OVERRIDE) EXEEXT="4" PYTHON="$(PYTHON)" PERL="$(PERL)" \
$(PERL) $(selftestdir)/selftest.pl --prefix=st4 \
--builddir=$(builddir) --srcdir=$(samba4srcdir) \
--exeext=4 \
--expected-failures=$(samba4srcdir)/selftest/knownfail \
--format=$(SELFTEST_FORMAT) \
--exclude=$(samba4srcdir)/selftest/skip --testlist="$(samba4srcdir)/selftest/tests.sh|" \
$(TEST4_OPTIONS)
SELFTEST4_NOSLOW_OPTS = --exclude=$(samba4srcdir)/selftest/slow
SELFTEST4_QUICK_OPTS = $(SELFTEST4_NOSLOW_OPTS) --quick --include=$(samba4srcdir)/selftest/quick
slowtest4:: everything
$(SELFTEST4) $(DEFAULT_TEST_OPTIONS) --immediate $(TESTS)
test4:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --immediate \
$(TESTS)
testone4:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
test4-swrap:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --immediate $(TESTS)
test4-swrap-pcap:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-pcap --immediate $(TESTS)
test4-swrap-keep-pcap:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-keep-pcap --immediate $(TESTS)
test4-noswrap:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate $(TESTS)
quicktest4:: all
$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --immediate $(TESTS)
quicktestone4:: all
$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --one $(TESTS)
testenv4:: everything
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
testenv4-%:: everything
SELFTEST_TESTENV=$* $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
test4-%::
$(MAKE) test TESTS=$*
valgrindtest4:: valgrindtest-all
valgrindtest4-quick:: all
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
valgrindtest4-all:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
valgrindtest4-env:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
gdbtest4:: gdbtest4-all
gdbtest4-quick:: all
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
gdbtest4-all:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
gdbtest4-env:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
plugins: $(PLUGINS)