From 2bb20aa8a8ff1170fd4d2a349a421990b0d7c235 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sun, 13 Apr 2008 14:09:09 -0700 Subject: smb_build: Make sure LIBRARY_SONAME is never uninitialized. (This used to be commit 2b8cf1b2a447711d123c563dfbd9a54941155267) --- source4/build/smb_build/makefile.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index fb3ac561fa..2470fa1459 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -220,6 +220,10 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; + if (!defined($ctx->{LIBRARY_SONAME})) { + $ctx->{LIBRARY_SONAME} = ""; + } + $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n") if (defined($ctx->{SO_VERSION})); $self->_prepare_list($ctx, "DEPEND_LIST"); -- cgit From f78bc8c489b02b521e9ecbdbdc72d160c6911b6b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 11:54:50 +0200 Subject: Remove prototypes from build.h in preparation of removing build.h altogether. (This used to be commit dbeab2a9cdee4e5f69afeb2603ba29cbed56debd) --- source4/build/smb_build/header.pm | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/header.pm b/source4/build/smb_build/header.pm index c2bdbaf4c8..ffac5e2601 100644 --- a/source4/build/smb_build/header.pm +++ b/source4/build/smb_build/header.pm @@ -42,17 +42,6 @@ sub _prepare_build_h($) $DEFINE->{VAL} = "\\\n"; foreach (@{$key->{INIT_FUNCTIONS}}) { $DEFINE->{VAL} .= "\t$_, \\\n"; - unless (/{/) { - my $fn = $key->{INIT_FUNCTION_TYPE}; - my $n = $_; - if ($fn =~ /\(\*\)/) { - $fn =~ s/\(\*\)/$n/; - $output .= "$fn;\n"; - } else { - $n =~ s/\&//; - $output .= "$fn $n;\n"; - } - } } $DEFINE->{VAL} .= "\t$key->{INIT_FUNCTION_SENTINEL} \n"; -- cgit From f800cf250f079ab1e1bc1051c34d1d1061187447 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 14:51:57 +0200 Subject: Move standard make compilation rules to build/make. (This used to be commit ceda3312a98b069d0711f3cb33de3ae71e91ebaa) --- source4/build/make/lex_compile.sh | 51 +++++++ source4/build/make/python.mk | 58 ++++++++ source4/build/make/rules.mk | 288 +++++++++++++++++++++++++++++++++++++ source4/build/make/yacc_compile.sh | 43 ++++++ 4 files changed, 440 insertions(+) create mode 100755 source4/build/make/lex_compile.sh create mode 100644 source4/build/make/python.mk create mode 100644 source4/build/make/rules.mk create mode 100755 source4/build/make/yacc_compile.sh (limited to 'source4/build') diff --git a/source4/build/make/lex_compile.sh b/source4/build/make/lex_compile.sh new file mode 100755 index 0000000000..9bba7257b1 --- /dev/null +++ b/source4/build/make/lex_compile.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +LEX="$1" +SRC="$2" +DEST="$3" +shift 3 +ARGS="$*" + +dir=`dirname $SRC` +file=`basename $SRC` +base=`basename $SRC .l` +if [ -z "$LEX" ]; then + # if $DEST is more recent than $SRC, we can just touch + # otherwise we touch but print out warnings + if [ -r $DEST ]; then + if [ x`find $SRC -newer $DEST -print` = x$SRC ]; then + echo "warning: lex not found - cannot generate $SRC => $DEST" >&2 + echo "warning: lex not found - only updating the timestamp of $DEST" >&2 + fi + touch $DEST; + exit; + fi + echo "error: lex not found - cannot generate $SRC => $DEST" >&2 + exit 1; +fi +# if $DEST is more recent than $SRC, we can just touch +if [ -r $DEST ]; then + if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then + touch $DEST; + exit; + fi +fi +TOP=`pwd` +if cd $dir && $LEX $ARGS $file; then + if [ -r $base.yy.c ];then + # we must guarantee that config.h comes first + echo "#include \"config.h\"" > $base.c + sed -e "s|$base\.yy\.c|$DEST|" $base.yy.c >> $base.c + rm -f $base.yy.c + elif [ -r $base.c ];then + # we must guarantee that config.h comes first + mv $base.c $base.c.tmp + echo "#include \"config.h\"" > $base.c + sed -e "s|$base\.yy\.c|$DEST|" $base.c.tmp >> $base.c + rm -f $base.c.tmp + elif [ ! -r base.c ]; then + echo "$base.c nor $base.yy.c generated." + exit 1 + fi +fi +cd $TOP diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk new file mode 100644 index 0000000000..57bf0169fe --- /dev/null +++ b/source4/build/make/python.mk @@ -0,0 +1,58 @@ +pythonbuilddir = $(builddir)/bin/python + +# Install Python +# Arguments: Module path +define python_module_template + +installpython:: $$(pythonbuilddir)/$(1) ; + cp $$< $$(DESTDIR)$$(PYTHONDIR)/$(1) + +uninstallpython:: + rm -f $$(DESTDIR)$$(PYTHONDIR)/$(1) ; + +pythonmods:: $$(pythonbuilddir)/$(1) ; + +endef + +define python_py_module_template + +$$(pythonbuilddir)/$(1): $(2) ; + mkdir -p $$(@D) + cp $$< $$@ + +$(call python_module_template,$(1)) + +endef + +# Python C module +# Arguments: Module path, object files +define python_c_module_template + +$$(pythonbuilddir)/$(1): $(2) ; + @echo Linking $$@ + @mkdir -p $$(@D) + @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +$(call python_module_template,$(1)) +endef + +# Swig extensions +swig:: pythonmods + +.SUFFIXES: _wrap.c .i + +.i_wrap.c: + [ "$(SWIG)" == "no" ] || $(SWIG) -O -Wall -I$(srcdir)/scripting/swig -python -keyword $< + +realdistclean:: + @echo "Removing SWIG output files" + # FIXME: Remove _wrap.c files + +pythonmods:: + +clean:: + @echo "Removing python modules" + @rm -rf $(pythonbuilddir) + +pydoctor:: pythonmods + LD_LIBRARY_PATH=bin/shared PYTHONPATH=$(pythonbuilddir) pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package $(pythonbuilddir)/samba diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk new file mode 100644 index 0000000000..faefb4e323 --- /dev/null +++ b/source4/build/make/rules.mk @@ -0,0 +1,288 @@ +# Rules file for Samba 4 +# This relies on GNU make. +# +# Dependencies command +DEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.o) -MT $@ \ + $(CFLAGS) $(CPPFLAGS) $< -o $@ +# Dependencies for host objects +HDEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.ho) -MT $@ \ + $(HOSTCC_FLAGS) $(CPPFLAGS) $< -o $@ +# Dependencies for precompiled headers +PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \ + $(CFLAGS) $(CPPFLAGS) $< -o $@ + +# Run a static analysis checker +CHECK = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) $(CPPLAGS) -c $< -o $@ + +# Run the configured compiler +COMPILE = $(CC) $(CFLAGS) $(PICFLAG) \ + $(CPPFLAGS) \ + -c $< -o $@ + +# Run the compiler for the build host +HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) $(CPPFLAGS) -c $< -o $@ + +# Precompile headers +PCHCOMPILE = @$(CC) -Ilib/replace \ + $(CFLAGS) $(PICFLAG) $(CPPFLAGS) -c $< -o $@ + +# Partial linking +PARTLINK = @$(PROG_LD) -r + +make_utility_dir = $(srcdir)/build/make/ + +include/config.h: + @echo "include/config.h not present" + @echo "You need to rerun ./autogen.sh and ./configure" + @/bin/false + +pch:: + +clean:: clean_pch + @echo Removing objects + @-find . -name '*.o' -exec rm -f '{}' \; + @echo Removing hostcc objects + @-find . -name '*.ho' -exec rm -f '{}' \; + @echo Removing binaries + @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS) + @echo Removing libraries + @-rm -f $(STATIC_LIBS) $(SHARED_LIBS) + @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o + @echo Removing modules + @-rm -f bin/modules/*/*.$(SHLIBEXT) + @-rm -f bin/*_init_module.c + @echo Removing dummy targets + @-rm -f bin/.*_* + @echo Removing generated files + @-rm -f bin/*_init_module.c + @-rm -rf librpc/gen_* + @echo Removing proto headers + @-rm -f $(PROTO_HEADERS) + +distclean:: clean + -rm -f include/config.h include/config_tmp.h include/build.h + -rm -f data.mk + -rm -f config.status + -rm -f config.log config.cache + -rm -f config.pm config.mk + -rm -f $(PC_FILES) + +removebackup:: + -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~ + +realdistclean:: distclean removebackup + -rm -f include/config_tmp.h.in + -rm -f version.h + -rm -f configure + -rm -f $(MANPAGES) + +check:: test + +unused_macros: + $(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort + +# Create a static library +%.a: + @echo Linking $@ + @rm -f $@ + @mkdir -p $(@D) + @$(STLD) $(STLD_FLAGS) $@ $^ + +############################################################################### +# 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): $(2) ; + @echo Linking $$@ + @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) +endef + +# Link a host-machine binary +# Arguments: target file, depends, flags +define host_binary_link_template +$(1): $(2) ; + @echo Linking $$@ + @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) +endef + +# Create a prototype header +# Arguments: header file, c files +define proto_header_template +$(1): $(2) ; + @echo "Creating $$@" + @$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --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) + +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))) + +ifneq ($(notdir $(1)),$(notdir $(4))) +$(4): $(1) + @echo "Creating symbolic link for $$@" + @ln -fs $$(&2;\ + echo "$(HCOMPILE)" 1>&2;\ + $(HCOMPILE) >/dev/null 2>&1 + +.h.h.gch: + @echo "Precompiling $<" + @$(PCHCOMPILE) + +.y.c: + @echo "Building $< with $(YACC)" + @-$(make_utility_dir)/yacc_compile.sh "$(YACC)" "$<" "$@" + +.l.c: + @echo "Building $< with $(LEX)" + @-$(make_utility_dir)/script/lex_compile.sh "$(LEX)" "$<" "$@" + +%.a: + @echo Linking $@ + @rm -f $@ + @mkdir -p $(@D) + @$(STLD) $(STLD_FLAGS) $@ $^ + + +DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl + +.1.xml.1: + $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< + +.3.xml.3: + $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< + +.5.xml.5: + $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< + +.7.xml.7: + $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< + +.8.xml.8: + $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< + +dist:: idl_full manpages configure distclean + +configure: + ./autogen.sh + +showflags:: + @echo 'Samba will be compiled with flags:' + @echo ' CPP = $(CPP)' + @echo ' CPPFLAGS = $(CPPFLAGS)' + @echo ' CC = $(CC)' + @echo ' CFLAGS = $(CFLAGS)' + @echo ' PICFLAG = $(PICFLAG)' + @echo ' BNLD = $(BNLD)' + @echo ' BNLD_FLAGS = $(BNLD_FLAGS)' + @echo ' STLD = $(STLD)' + @echo ' STLD_FLAGS = $(STLD_FLAGS)' + @echo ' SHLD = $(SHLD)' + @echo ' SHLD_FLAGS = $(SHLD_FLAGS)' + @echo ' MDLD = $(MDLD)' + @echo ' MDLD_FLAGS = $(MDLD_FLAGS)' + @echo ' SHLIBEXT = $(SHLIBEXT)' + +etags: + etags `find $(srcdir) -name "*.[ch]"` + +ctags: + ctags `find $(srcdir) -name "*.[ch]"` diff --git a/source4/build/make/yacc_compile.sh b/source4/build/make/yacc_compile.sh new file mode 100755 index 0000000000..a56a51da0a --- /dev/null +++ b/source4/build/make/yacc_compile.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +YACC="$1" +SRC="$2" +DEST="$3" + +dir=`dirname $SRC` +file=`basename $SRC` +base=`basename $SRC .y` +if [ -z "$YACC" ]; then + # if $DEST is more recent than $SRC, we can just touch + # otherwise we touch but print out warnings + if [ -r $DEST ]; then + if [ x`find $SRC -newer $DEST -print` = x$SRC ]; then + echo "warning: yacc not found - cannot generate $SRC => $DEST" >&2 + echo "warning: yacc not found - only updating the timestamp of $DEST" >&2 + fi + touch $DEST; + exit; + fi + echo "error: yacc not found - cannot generate $SRC => $DEST" >&2 + exit 1; +fi +# if $DEST is more recent than $SRC, we can just touch +if [ -r $DEST ]; then + if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then + touch $DEST; + exit; + fi +fi +TOP=`pwd` +if cd $dir && $YACC -d $file; then + if [ -r y.tab.h -a -r y.tab.c ];then + #echo "info: move files" + sed -e "/^#/!b" -e "s|y\.tab\.h|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.h > $base.h + sed -e "s|y\.tab\.c|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.c > $base.c + rm -f y.tab.c y.tab.h + elif [ ! -r $base.h -a ! -r $base.c]; then + echo "$base.h nor $base.c generated." + exit 1 + fi +fi +cd $TOP -- cgit From ffc5cbfe803326a1c3bf55684717af910d091c5a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 16:53:00 +0200 Subject: Move object files lists to makefile rather than smb_build. (This used to be commit 5628d58990144463fd87f8c847c9384ac2193681) --- source4/build/m4/public.m4 | 10 +++------- source4/build/smb_build/config_mk.pm | 12 +++++------- source4/build/smb_build/input.pm | 9 +++++---- 3 files changed, 13 insertions(+), 18 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index eb673446c7..76a11f0a38 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -4,7 +4,7 @@ dnl Copyright (C) 2004 Stefan Metzmacher dnl Copyright (C) 2004-2005 Jelmer Vernooij dnl Published under the GPL dnl -dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems) +dnl SMB_SUBSYSTEM(name,required_subsystems) dnl dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) dnl @@ -18,11 +18,10 @@ dnl ####################################################### dnl ### And now the implementation ### dnl ####################################################### -dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems,cflags) +dnl SMB_SUBSYSTEM(name,required_subsystems,cflags) AC_DEFUN([SMB_SUBSYSTEM], [ MAKE_SETTINGS="$MAKE_SETTINGS -$1_OBJ_FILES = $2 $1_CFLAGS = $4 $1_ENABLE = YES " @@ -31,7 +30,6 @@ SMB_INFO_SUBSYSTEMS="$SMB_INFO_SUBSYSTEMS ################################### # Start Subsystem $1 @<:@SUBSYSTEM::$1@:>@ -OBJ_FILES = \$($1_OBJ_FILES) PRIVATE_DEPENDENCIES = $3 CFLAGS = \$($1_CFLAGS) ENABLE = YES @@ -40,11 +38,10 @@ ENABLE = YES " ]) -dnl SMB_LIBRARY(name,obj_files,required_subsystems,version,so_version,cflags,ldflags) +dnl SMB_LIBRARY(name,required_subsystems,version,so_version,cflags,ldflags) AC_DEFUN([SMB_LIBRARY], [ MAKE_SETTINGS="$MAKE_SETTINGS -$1_OBJ_FILES = $2 $1_CFLAGS = $6 $1_LDFLAGS = $7 $1_ENABLE = YES @@ -54,7 +51,6 @@ SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES ################################### # Start Library $1 @<:@LIBRARY::$1@:>@ -OBJ_FILES = \$($1_OBJ_FILES) PRIVATE_DEPENDENCIES = $3 VERSION = $4 SO_VERSION = $5 diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index d8ec646910..de786ddbe5 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -23,14 +23,11 @@ my $section_types = { SWIG_FILE => "string", "PRIVATE_DEPENDENCIES" => "list", "PUBLIC_DEPENDENCIES" => "list", - "OBJ_FILES" => "list", "ENABLE" => "bool", "LDFLAGS" => "list", "CFLAGS" => "list", }, "SUBSYSTEM" => { - "OBJ_FILES" => "list", - "PRIVATE_DEPENDENCIES" => "list", "PUBLIC_DEPENDENCIES" => "list", @@ -47,7 +44,6 @@ my $section_types = { "SUBSYSTEM" => "string", "INIT_FUNCTION" => "string", - "OBJ_FILES" => "list", "PRIVATE_DEPENDENCIES" => "list", @@ -62,7 +58,6 @@ my $section_types = { "CFLAGS" => "list" }, "BINARY" => { - "OBJ_FILES" => "list", "PRIVATE_DEPENDENCIES" => "list", @@ -88,8 +83,6 @@ my $section_types = { "INIT_FUNCTION_SENTINEL" => "string", "OUTPUT_TYPE" => "list", - "OBJ_FILES" => "list", - "PRIVATE_DEPENDENCIES" => "list", "PUBLIC_DEPENDENCIES" => "list", @@ -223,6 +216,9 @@ sub run_config_mk($$$$) { $section = $1; $infragment = 0; + + $result->{$section}{EXISTS}{KEY} = "EXISTS"; + $result->{$section}{EXISTS}{VAL} = 1; next; } @@ -233,6 +229,7 @@ sub run_config_mk($$$$) $subdir =~ s/^\.$//g; $subdir =~ s/^\.\///g; $subdir .= "/" if ($subdir ne ""); + $makefile .= "basedir := $subdir\n"; $makefile .= run_config_mk($input, $srcdir, $builddir, $subdir.$subfile); next; } @@ -280,6 +277,7 @@ sub run_config_mk($$$$) $input->{$name}{BASEDIR} = $basedir; foreach my $key (values %{$result->{$section}}) { + next if ($key->{KEY} eq "EXISTS"); $key->{VAL} = smb_build::input::strtrim($key->{VAL}); my $vartype = $sectype->{$key->{KEY}}; if (not defined($vartype)) { diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 948f2657b4..9949836675 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -91,6 +91,9 @@ sub check_module($$$) } if (not defined($mod->{OUTPUT_TYPE})) { + if (not defined($INPUT->{$mod->{SUBSYSTEM}}->{TYPE})) { + die("Invalid type for subsystem $mod->{SUBSYSTEM}"); + } if ($INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { $mod->{OUTPUT_TYPE} = undef; } else { @@ -107,7 +110,7 @@ sub check_module($$$) } if (grep(/MERGED_OBJ/, @{$mod->{OUTPUT_TYPE}})) { push (@{$INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS}}, $mod->{INIT_FUNCTION}) if defined($mod->{INIT_FUNCTION}); - unshift (@{$INPUT->{$mod->{SUBSYSTEM}}{PRIVATE_DEPENDENCIES}}, $mod->{NAME}); + push (@{$INPUT->{$mod->{SUBSYSTEM}}{PRIVATE_DEPENDENCIES}}, $mod->{NAME}); } } @@ -151,7 +154,6 @@ sub check_python($$$) $dirname .= "/" unless $dirname =~ /\/$/; $dirname = "" if $dirname eq "./"; - $python->{OBJ_FILES} = ["$dirname$basename\_wrap.o"]; $python->{LIBRARY_REALNAME} = "_$basename.\$(SHLIBEXT)"; $python->{PYTHON_FILES} = ["$dirname$basename.py"]; push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_UNUSED_MACROS)"); @@ -189,7 +191,6 @@ sub add_implicit($$) $INPUT->{$n} = { TYPE => "MAKE_RULE", NAME => $n, - TARGET => "", OUTPUT_TYPE => undef, LIBS => ["\$(".uc($n)."_LIBS)"], LDFLAGS => ["\$(".uc($n)."_LDFLAGS)"], @@ -249,7 +250,7 @@ sub check($$$$$) foreach my $part (values %$INPUT) { $part->{LINK_FLAGS} = []; - $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_LIST)"]; + $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_FILES)"]; if ($part->{TYPE} eq "SUBSYSTEM") { check_subsystem($INPUT, $part, $subsys_ot); -- cgit From 0fa663cc5dcbcf6a35f6d245881a5edff1a87108 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 17:54:19 +0200 Subject: Fix order of variables in the makefile. (This used to be commit f64c1d53ba50bb50d32f819adf8727513468ccd7) --- source4/build/smb_build/main.pl | 11 +++++-- source4/build/smb_build/makefile.pm | 20 +++++++----- source4/build/smb_build/output.pm | 61 ++++++------------------------------- 3 files changed, 30 insertions(+), 62 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index c3dc46461b..0e42155537 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -52,7 +52,7 @@ foreach my $key (values %$OUTPUT) { next unless defined $key->{OUTPUT_TYPE}; $mkenv->MergedObj($key) if grep(/MERGED_OBJ/, @{$key->{OUTPUT_TYPE}}); - $mkenv->StaticLibrary($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->StaticLibraryPrimitives($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); if (defined($key->{PC_FILE})) { $mkenv->output("PC_FILES += $key->{BASEDIR}/$key->{PC_FILE}\n"); } @@ -66,19 +66,26 @@ foreach my $key (values %$OUTPUT) { $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); - $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}); $mkenv->CFlags($key); } foreach my $key (values %$OUTPUT) { next unless defined $key->{OUTPUT_TYPE}; + $mkenv->Integrated($key) if grep(/INTEGRATED/, @{$key->{OUTPUT_TYPE}}); +} + +foreach my $key (values %$OUTPUT) { + next unless defined $key->{OUTPUT_TYPE}; + $mkenv->StaticLibrary($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->SharedLibrary($key) if ($key->{TYPE} eq "LIBRARY") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" or $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER}); } $mkenv->write("data.mk"); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 2470fa1459..7728bc4f8d 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -23,12 +23,11 @@ sub new($$$) $self->{output} = ""; - $self->{mkfile} = $mkfile; - $self->output("################################################\n"); $self->output("# Autogenerated by build/smb_build/makefile.pm #\n"); $self->output("################################################\n"); $self->output("\n"); + $self->output($mkfile); return $self; } @@ -203,6 +202,14 @@ __EOD__ $self->output("\n"); } +sub StaticLibraryPrimitives($$) +{ + my ($self,$ctx) = @_; + + $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); + $self->_prepare_list($ctx, "FULL_OBJ_LIST"); +} + sub SharedLibraryPrimitives($$) { my ($self,$ctx) = @_; @@ -273,9 +280,6 @@ sub StaticLibrary($$) $self->output("STATIC_LIBS += $ctx->{TARGET_STATIC_LIBRARY}\n") if ($ctx->{TYPE} eq "LIBRARY"); - $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); } @@ -324,9 +328,9 @@ sub PythonFiles($$) foreach (@{$ctx->{PYTHON_FILES}}) { my $target = "bin/python/".basename($_); - my $source = output::add_dir_str($ctx->{BASEDIR}, $_); + my $source = "\$(addprefix $ctx->{BASEDIR}/, $target)"; $self->output("$target: $source\n\n"); - $self->output("PYTHON_PYS += $target\n"); + $self->output("PYTHON_PYS += $source\n"); } } @@ -334,7 +338,7 @@ sub ProtoHeader($$) { my ($self,$ctx) = @_; - my $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); + my $priv = "\$(addprefix $ctx->{BASEDIR}/, $ctx->{PRIVATE_PROTO_HEADER})"; $self->output("PROTO_HEADERS += $priv\n"); $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n"); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 4ae4a62cf4..aeff7d48ce 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -7,39 +7,6 @@ package output; use strict; -use smb_build::config; - -sub add_dir_str($$) -{ - my ($dir,$file) = @_; - my $dirsep = "/"; - - $dir =~ s/^\.$//g; - $dir =~ s/^\.\///g; - - $dirsep = "" if ($dir eq ""); - - my $ret = $file; - if (substr($ret, 0, 1) ne "\$") { - $ret = "$dir$dirsep$file"; - $ret =~ s/([^\/\.]+)\/\.\.\///g; - $ret =~ s/([^\/\.]+)\/\.\.\///g; - } - - return $ret; -} - -sub add_dir_array($$) -{ - my ($dir,$files) = @_; - my @ret = (); - - foreach (@{$files}) { - push (@ret, add_dir_str($dir, $_)); - } - - return @ret; -} sub generate_shared_library($) { @@ -80,10 +47,8 @@ sub generate_shared_library($) $lib->{LIBRARY_DEBUGNAME} = $lib->{LIBRARY_REALNAME}; - if (defined($lib->{VERSION}) and $config::config{SONAMEFLAG} ne "#") { - $lib->{LIBRARY_SONAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION)"; - $lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION)"; - } + $lib->{LIBRARY_SONAME} = "\$(if \$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME})"; + $lib->{LIBRARY_REALNAME} = "\$(if \$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME})"; $lib->{RESULT_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; $lib->{OUTPUT_SHARED_LIBRARY} = "-l$link_name"; @@ -97,11 +62,9 @@ sub generate_merged_obj($) my $link_name = $lib->{NAME}; $link_name =~ s/^LIB//; - if (defined($lib->{OBJ_FILES})) { - $lib->{MERGED_OBJNAME} = lc($link_name).".o"; - $lib->{RESULT_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; - $lib->{TARGET_MERGED_OBJ} = $lib->{RESULT_MERGED_OBJ}; - } + $lib->{MERGED_OBJNAME} = lc($link_name).".o"; + $lib->{RESULT_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; + $lib->{TARGET_MERGED_OBJ} = $lib->{RESULT_MERGED_OBJ}; } sub generate_static_library($) @@ -116,12 +79,10 @@ sub generate_static_library($) $lib->{LIBRARY_NAME} = "lib".lc($link_name).".a"; - if (defined($lib->{OBJ_FILES})) { - $lib->{RESULT_STATIC_LIBRARY} = "bin/static/$lib->{LIBRARY_NAME}"; - $lib->{TARGET_STATIC_LIBRARY} = $lib->{RESULT_STATIC_LIBRARY}; - $lib->{STATICDIR} = 'bin/static'; - $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); - } + $lib->{RESULT_STATIC_LIBRARY} = "bin/static/$lib->{LIBRARY_NAME}"; + $lib->{TARGET_STATIC_LIBRARY} = $lib->{RESULT_STATIC_LIBRARY}; + $lib->{STATICDIR} = 'bin/static'; + $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); } sub generate_binary($) @@ -160,10 +121,6 @@ sub create_output($$) foreach $part (values %{$depend}) { next unless(defined($part->{OUTPUT_TYPE})); - # Combine object lists - my @list = add_dir_array($part->{BASEDIR}, $part->{OBJ_FILES}); - push(@{$part->{OBJ_LIST}}, @list) if defined($part->{OBJ_FILES}); - generate_binary($part) if grep(/BINARY/, @{$part->{OUTPUT_TYPE}}); generate_shared_library($part) if grep(/SHARED_LIBRARY/, @{$part->{OUTPUT_TYPE}}); generate_static_library($part) if grep(/STATIC_LIBRARY/, @{$part->{OUTPUT_TYPE}}); -- cgit From a15b6f1606e1c761c2c4037b734137e97f00489f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 20:00:04 +0200 Subject: Fix unresolved symbols. (This used to be commit 8573e828d1b68c47b3c1754e9be230b2e78d9d52) --- source4/build/m4/public.m4 | 8 ++++---- source4/build/smb_build/makefile.pm | 25 +++++++++++-------------- 2 files changed, 15 insertions(+), 18 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index 76a11f0a38..01bf565774 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -4,8 +4,6 @@ dnl Copyright (C) 2004 Stefan Metzmacher dnl Copyright (C) 2004-2005 Jelmer Vernooij dnl Published under the GPL dnl -dnl SMB_SUBSYSTEM(name,required_subsystems) -dnl dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) dnl dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) @@ -18,12 +16,13 @@ dnl ####################################################### dnl ### And now the implementation ### dnl ####################################################### -dnl SMB_SUBSYSTEM(name,required_subsystems,cflags) +dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems,cflags) AC_DEFUN([SMB_SUBSYSTEM], [ MAKE_SETTINGS="$MAKE_SETTINGS $1_CFLAGS = $4 $1_ENABLE = YES +$1_OBJ_FILES = $2 " SMB_INFO_SUBSYSTEMS="$SMB_INFO_SUBSYSTEMS @@ -38,13 +37,14 @@ ENABLE = YES " ]) -dnl SMB_LIBRARY(name,required_subsystems,version,so_version,cflags,ldflags) +dnl SMB_LIBRARY(name,obj_files,required_subsystems,version,so_version,cflags,ldflags) AC_DEFUN([SMB_LIBRARY], [ MAKE_SETTINGS="$MAKE_SETTINGS $1_CFLAGS = $6 $1_LDFLAGS = $7 $1_ENABLE = YES +$1_OBJ_FILES = $2 " SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 7728bc4f8d..9ce04ca8d4 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -263,10 +263,10 @@ sub MergedObj($$) $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->output(<< "__EOD__" # -$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_LIST) +$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_FILES) \@echo Partially linking \$@ \@mkdir -p \$(\@D) - \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_LIST) + \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_FILES) __EOD__ ); @@ -276,8 +276,6 @@ sub StaticLibrary($$) { my ($self,$ctx) = @_; - return unless (defined($ctx->{OBJ_FILES})); - $self->output("STATIC_LIBS += $ctx->{TARGET_STATIC_LIBRARY}\n") if ($ctx->{TYPE} eq "LIBRARY"); $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); @@ -338,13 +336,13 @@ sub ProtoHeader($$) { my ($self,$ctx) = @_; - my $priv = "\$(addprefix $ctx->{BASEDIR}/, $ctx->{PRIVATE_PROTO_HEADER})"; + my $priv = "$ctx->{BASEDIR}/$ctx->{PRIVATE_PROTO_HEADER}"; $self->output("PROTO_HEADERS += $priv\n"); - $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n"); + $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_FILES:.o=.c) \$(srcdir)/script/mkproto.pl\n"); $self->output("\t\@echo \"Creating \$@\"\n"); $self->output("\t\@mkdir -p \$(\@D)\n"); - $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --public=/dev/null --private=\$@ \$($ctx->{NAME}_OBJ_LIST)\n\n"); + $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --public=/dev/null --private=\$@ \$($ctx->{NAME}_OBJ_FILES)\n\n"); } sub write($$) @@ -382,7 +380,6 @@ sub CFlags($$) my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; - return unless defined ($key->{OBJ_LIST}); return unless defined ($key->{FINAL_CFLAGS}); return unless (@{$key->{FINAL_CFLAGS}} > 0); @@ -396,19 +393,19 @@ sub CFlags($$) my @cflags = (); foreach my $flag (@sorted_cflags) { if($src_ne_build) { - if($flag =~ m#^-I([^/].*$)#) { - my $dir = $1; - $dir =~ s#^\$\((?:src|build)dir\)/?##; + if($flag =~ m#^-I([^/].*$)#) { + my $dir = $1; + $dir =~ s#^\$\((?:src|build)dir\)/?##; push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); - next; - } + next; + } } push(@cflags, $flag); } my $cflags = join(' ', @cflags); - $self->output("\$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_LIST:.o=.d)) \$($key->{NAME}_OBJ_LIST): CFLAGS+= $cflags\n"); + $self->output("\$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_FILES:.o=.d)) \$($key->{NAME}_OBJ_FILES): CFLAGS+= $cflags\n"); } 1; -- cgit From d04926914ad0d9ecd7dee3e156198d6baf788598 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 01:40:32 +0200 Subject: Fix the build. (This used to be commit ecaa5bb83b5cf319718d15aff96152d70fa19f7f) --- source4/build/make/python.mk | 4 ++++ source4/build/smb_build/makefile.pm | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk index 57bf0169fe..6c1798212e 100644 --- a/source4/build/make/python.mk +++ b/source4/build/make/python.mk @@ -56,3 +56,7 @@ clean:: pydoctor:: pythonmods LD_LIBRARY_PATH=bin/shared PYTHONPATH=$(pythonbuilddir) pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package $(pythonbuilddir)/samba + +bin/python/%.py: + mkdir -p $(@D) + cp $< $@ diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9ce04ca8d4..9518c2eabe 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -326,9 +326,9 @@ sub PythonFiles($$) foreach (@{$ctx->{PYTHON_FILES}}) { my $target = "bin/python/".basename($_); - my $source = "\$(addprefix $ctx->{BASEDIR}/, $target)"; + my $source = "\$(addprefix $ctx->{BASEDIR}/, $_)"; $self->output("$target: $source\n\n"); - $self->output("PYTHON_PYS += $source\n"); + $self->output("PYTHON_PYS += $target\n"); } } -- cgit From b62d7aa8eb2da784186b8cd903775dd12c3f34f7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 01:52:55 +0200 Subject: Make sure init function sentinels are set for modules. (This used to be commit fac3463dd505404998b6b00526f1dad6ae47ba84) --- source4/build/smb_build/header.pm | 1 + source4/build/smb_build/input.pm | 3 +++ 2 files changed, 4 insertions(+) (limited to 'source4/build') diff --git a/source4/build/smb_build/header.pm b/source4/build/smb_build/header.pm index ffac5e2601..dfb7c62e54 100644 --- a/source4/build/smb_build/header.pm +++ b/source4/build/smb_build/header.pm @@ -44,6 +44,7 @@ sub _prepare_build_h($) $DEFINE->{VAL} .= "\t$_, \\\n"; } + die("Invalid sentinel") unless ($key->{INIT_FUNCTION_SENTINEL}); $DEFINE->{VAL} .= "\t$key->{INIT_FUNCTION_SENTINEL} \n"; push(@defines,$DEFINE); diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 9949836675..bb6a120c34 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -84,12 +84,15 @@ sub check_module($$$) return if ($mod->{ENABLE} ne "YES"); + if (exists($INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTION_TYPE})) { $mod->{INIT_FUNCTION_TYPE} = $INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTION_TYPE}; } else { $mod->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } + unless (defined($mod->{INIT_FUNCTION_SENTINEL})) { $mod->{INIT_FUNCTION_SENTINEL} = "NULL"; } + if (not defined($mod->{OUTPUT_TYPE})) { if (not defined($INPUT->{$mod->{SUBSYSTEM}}->{TYPE})) { die("Invalid type for subsystem $mod->{SUBSYSTEM}"); -- cgit From 08baea013b73607df0c86f24506912c7e6af6f7e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 02:25:16 +0200 Subject: Move SOVERSION, VERSION and PC_FILE out of smb_build but use make variables directly instead. (This used to be commit 9d0ae012b0b463278cd054d06788aa998acc2da2) --- source4/build/m4/public.m4 | 2 -- source4/build/smb_build/config_mk.pm | 4 ---- source4/build/smb_build/input.pm | 10 ---------- source4/build/smb_build/makefile.pm | 5 +---- 4 files changed, 1 insertion(+), 20 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index 01bf565774..1eae998ca4 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -52,8 +52,6 @@ SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES # Start Library $1 @<:@LIBRARY::$1@:>@ PRIVATE_DEPENDENCIES = $3 -VERSION = $4 -SO_VERSION = $5 CFLAGS = \$($1_CFLAGS) LDFLAGS = \$($1_LDFLAGS) ENABLE = YES diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index de786ddbe5..307c391e07 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -73,12 +73,8 @@ my $section_types = { "USE_HOSTCC" => "bool" }, "LIBRARY" => { - "VERSION" => "string", - "SO_VERSION" => "string", "LIBRARY_REALNAME" => "string", - "PC_FILE" => "string", - "INIT_FUNCTION_TYPE" => "string", "INIT_FUNCTION_SENTINEL" => "string", "OUTPUT_TYPE" => "list", diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index bb6a120c34..3ca2f22f0c 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -125,16 +125,6 @@ sub check_library($$$) unless (defined($lib->{OUTPUT_TYPE})) { $lib->{OUTPUT_TYPE} = $default_ot; } - if (defined($lib->{VERSION}) and not defined($lib->{SO_VERSION})) { - print "$lib->{NAME}: Please specify SO_VERSION when specifying VERSION\n"; - return; - } - - if (defined($lib->{SO_VERSION}) and not defined($lib->{VERSION})) { - print "$lib->{NAME}: Please specify VERSION when specifying SO_VERSION\n"; - return; - } - unless (defined($lib->{INIT_FUNCTION_TYPE})) { $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } unless (defined($lib->{INIT_FUNCTION_SENTINEL})) { $lib->{INIT_FUNCTION_SENTINEL} = "NULL"; } unless (defined($lib->{INSTALLDIR})) { $lib->{INSTALLDIR} = "LIBDIR"; } diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9518c2eabe..81aac2fc46 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -214,9 +214,6 @@ sub SharedLibraryPrimitives($$) { my ($self,$ctx) = @_; - $self->output("$ctx->{NAME}_SOVERSION = $ctx->{SO_VERSION}\n") if (defined($ctx->{SO_VERSION})); - $self->output("$ctx->{NAME}_VERSION = $ctx->{VERSION}\n") if (defined($ctx->{VERSION})); - if (not grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}})) { $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); @@ -231,7 +228,7 @@ sub SharedLibrary($$) $ctx->{LIBRARY_SONAME} = ""; } - $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n") if (defined($ctx->{SO_VERSION})); + $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); -- cgit From 98a4dd9b5eda6f0eb94bffe6b97f5fbccef41208 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 03:59:56 +0200 Subject: Fix ALL_OBJS value. (This used to be commit 8710087728cc44761ae85f66c541ab1650e1b952) --- source4/build/smb_build/main.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 0e42155537..14897840a6 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -44,8 +44,7 @@ my $mkenv = new smb_build::makefile(\%config::config, $mkfile); my $shared_libs_used = 0; foreach my $key (values %$OUTPUT) { - $mkenv->_prepare_list($key, "OBJ_LIST"); - push(@{$mkenv->{all_objs}}, "\$($key->{NAME}_OBJ_LIST)"); + push(@{$mkenv->{all_objs}}, "\$($key->{NAME}_OBJ_FILES)"); } foreach my $key (values %$OUTPUT) { -- cgit From 223df634c888092cd2528aca6fcdf78a4de0246f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 04:08:28 +0200 Subject: Work around 'test' quirks - use make's string comparison instead. (This used to be commit 434b61623ecfd846f043ee92c833e92cf905e7b4) --- source4/build/smb_build/makefile.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 81aac2fc46..8f3f1701b7 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -244,7 +244,9 @@ $ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL __EOD__ ); if ($ctx->{LIBRARY_REALNAME} ne $ctx->{LIBRARY_SONAME}) { - $self->output("\t\@test \$($ctx->{NAME}_VERSION) = \$($ctx->{NAME}_SOVERSION) || ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}\n"); + $self->output("ifneq (\$($ctx->{NAME}_VERSION),\$($ctx->{NAME}_SOVERSION))\n"); + $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}\n"); + $self->output("endif\n"); } $self->output("ifdef $ctx->{NAME}_SOVERSION\n"); $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}\n"); -- cgit From 08f83c59df7a0e490da55a536b6e04a32508d2b0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 18 Apr 2008 22:20:49 +0200 Subject: build: fix the build rule for .o files metze (This used to be commit c7f34f41c3f9f0c3f75a618dfaf566706014a6b4) --- source4/build/make/rules.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/build') diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk index faefb4e323..541fa018db 100644 --- a/source4/build/make/rules.mk +++ b/source4/build/make/rules.mk @@ -211,7 +211,9 @@ include/includes.d: include/includes.h @echo "Compiling $<" @-mkdir -p `dirname $@` @$(COMPILE) && exit 0 ; \ - $(COMPILE) + echo "The following command failed:" 1>&2;\ + echo "$(COMPILE)" 1>&2;\ + $(COMPILE) >/dev/null 2>&1 -- cgit