From 51b0a285f02e1bc6187e64514f3f59f546bbecc5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 15:31:15 +0100 Subject: Avoid redetermining paths; use already stored values. (This used to be commit 0d223ddc39b7438dbce6716f1f00c29579a1f4c4) --- source4/build/smb_build/main.pl | 4 ++-- source4/build/smb_build/makefile.pm | 24 +++++++++--------------- source4/build/smb_build/output.pm | 18 +++++++++++------- 3 files changed, 22 insertions(+), 24 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index ba25035ea5..46a092d69f 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -20,8 +20,8 @@ my $INPUT = {}; my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, "main.mk"); my $subsys_output_type; -$subsys_output_type = ["MERGED_OBJ"]; -#$subsys_output_type = ["STATIC_LIBRARY"]; +#$subsys_output_type = ["MERGED_OBJ"]; +$subsys_output_type = ["STATIC_LIBRARY"]; my $library_output_type; if ($config::config{USESHARED} eq "true") { diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index b84caa12d7..dc9e1e9911 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -230,7 +230,7 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; - push (@{$self->{shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION})); + push (@{$self->{shared_libs}}, $ctx->{RESULT_SHARED_LIBRARY}) if (defined($ctx->{SO_VERSION})); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); @@ -252,8 +252,7 @@ sub SharedLibrary($$) $self->output(<< "__EOD__" # - -$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) +$ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Linking \$\@ \@mkdir -p $ctx->{SHAREDDIR} \@\$(SHLD) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ @@ -275,7 +274,7 @@ sub MergedObj($$) push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); $self->output(<< "__EOD__" # -$ctx->{TARGET_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) +$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Partially linking \$@ \@mkdir -p bin/mergedobj \$(PARTLINK) -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) @@ -290,7 +289,7 @@ sub StaticLibrary($$) return unless (defined($ctx->{OBJ_FILES})); - push (@{$self->{static_libs}}, $ctx->{TARGET_STATIC_LIBRARY}) if ($ctx->{TYPE} eq "LIBRARY"); + push (@{$self->{static_libs}}, $ctx->{RESULT_STATIC_LIBRARY}) if ($ctx->{TYPE} eq "LIBRARY"); $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "OBJ_LIST"); @@ -300,7 +299,7 @@ sub StaticLibrary($$) $self->output(<< "__EOD__" # -$ctx->{TARGET_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST) +$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Linking \$@ \@rm -f \$@ \@mkdir -p $ctx->{STATICDIR} @@ -323,23 +322,18 @@ sub Binary($$) { my ($self,$ctx) = @_; - my $installdir; my $extradir = ""; - my $localdir = "bin$extradir"; - - $installdir = "bin$extradir"; - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); unless (defined($ctx->{INSTALLDIR})) { } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { - push (@{$self->{sbin_progs}}, "$installdir/$ctx->{BINARY}"); + push (@{$self->{sbin_progs}}, $ctx->{RESULT_BINARY}); } elsif ($ctx->{INSTALLDIR} eq "BINDIR") { - push (@{$self->{bin_progs}}, "$installdir/$ctx->{BINARY}"); + push (@{$self->{bin_progs}}, $ctx->{RESULT_BINARY}); } - $self->output("binaries:: $localdir/$ctx->{BINARY}\n"); + $self->output("binaries:: $ctx->{TARGET_BINARY}\n"); $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); @@ -347,7 +341,7 @@ sub Binary($$) $self->_prepare_list($ctx, "LINK_FLAGS"); $self->output(<< "__EOD__" -$installdir/$ctx->{BINARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) +$ctx->{RESULT_BINARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Linking \$\@ __EOD__ ); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 0ddb9e4efb..586ea121cb 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -85,8 +85,9 @@ sub generate_shared_library($) $lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION)"; } - $lib->{TARGET_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; - $lib->{OUTPUT_SHARED_LIBRARY} = $lib->{TARGET_SHARED_LIBRARY}; + $lib->{RESULT_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; + $lib->{OUTPUT_SHARED_LIBRARY} = "-l$link_name"; + $lib->{TARGET_SHARED_LIBRARY} = $lib->{RESULT_SHARED_LIBRARY}; } sub generate_merged_obj($) @@ -97,7 +98,8 @@ sub generate_merged_obj($) $link_name =~ s/^LIB//; $lib->{MERGED_OBJNAME} = lc($link_name).".o"; - $lib->{TARGET_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; + $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($) @@ -113,11 +115,12 @@ sub generate_static_library($) $lib->{LIBRARY_NAME} = "lib".lc($link_name).".a"; if (defined($lib->{OBJ_FILES})) { - $lib->{TARGET_STATIC_LIBRARY} = "bin/static/$lib->{LIBRARY_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); } else { - $lib->{TARGET_STATIC_LIBRARY} = ""; + $lib->{RESULT_STATIC_LIBRARY} = ""; $lib->{OUTPUT_STATIC_LIBRARY} = ""; } } @@ -129,8 +132,9 @@ sub generate_binary($) $bin->{DEPEND_LIST} = []; push(@{$bin->{LINK_FLAGS}}, "\$($bin->{NAME}\_OBJ_LIST)"); - $bin->{DEBUGDIR} = "bin/"; - $bin->{TARGET_BINARY} = $bin->{OUTPUT_BINARY} = "$bin->{DEBUGDIR}/$bin->{NAME}"; + $bin->{DEBUGDIR} = "bin"; + $bin->{RESULT_BINARY} = $bin->{OUTPUT_BINARY} = "$bin->{DEBUGDIR}/$bin->{NAME}"; + $bin->{TARGET_BINARY} = $bin->{RESULT_BINARY}; $bin->{BINARY} = $bin->{NAME}; } -- cgit From 80cbff3d011ad9264462812f57991ed0393b385e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 16:02:33 +0100 Subject: Fix build with partial linking. (This used to be commit bfad9610c472e8d7e3656e19c8dbb6b85727dc13) --- source4/build/smb_build/main.pl | 3 +-- source4/build/smb_build/output.pm | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 46a092d69f..4c09e32422 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -20,8 +20,7 @@ my $INPUT = {}; my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, "main.mk"); my $subsys_output_type; -#$subsys_output_type = ["MERGED_OBJ"]; -$subsys_output_type = ["STATIC_LIBRARY"]; +$subsys_output_type = ["MERGED_OBJ"]; my $library_output_type; if ($config::config{USESHARED} eq "true") { diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 586ea121cb..67b905ef55 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -97,9 +97,14 @@ sub generate_merged_obj($) my $link_name = $lib->{NAME}; $link_name =~ s/^LIB//; - $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}; + 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}; + } else { + $lib->{TARGET_MERGED_OBJ} = ""; + $lib->{RESULT_MERGED_OBJ} = ""; + } } sub generate_static_library($) @@ -121,6 +126,7 @@ sub generate_static_library($) $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); } else { $lib->{RESULT_STATIC_LIBRARY} = ""; + $lib->{TARGET_STATIC_LIBRARY} = ""; $lib->{OUTPUT_STATIC_LIBRARY} = ""; } } -- cgit From a44e0b245545597e4752e712446e6d8a3585648c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 16:33:23 +0100 Subject: Simplify some more smb_build code. (This used to be commit 95b06bd8f2a91c9f3f9e9f05f7e2803d6b4100c7) --- source4/build/smb_build/input.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index f970d5b677..f175b4c8c9 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -5,13 +5,10 @@ # Copyright (C) Jelmer Vernooij 2004 # Released under the GNU GPL -use smb_build::config; use strict; package smb_build::input; use File::Basename; -my $srcdir = $config::config{srcdir}; - sub strtrim($) { $_ = shift; @@ -60,10 +57,7 @@ sub check_subsystem($$$) my ($INPUT, $subsys, $default_ot) = @_; return if ($subsys->{ENABLE} ne "YES"); - unless(defined($subsys->{OUTPUT_TYPE})) { - $subsys->{OUTPUT_TYPE} = $default_ot; - } - + unless (defined($subsys->{OUTPUT_TYPE})) { $subsys->{OUTPUT_TYPE} = $default_ot; } unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; } } @@ -159,8 +153,8 @@ sub check_python($$$) $python->{OBJ_FILES} = ["$dirname$basename\_wrap.o"]; $python->{LIBRARY_REALNAME} = "_$basename.\$(SHLIBEXT)"; $python->{PYTHON_FILES} = ["$dirname$basename.py"]; - push (@{$python->{CFLAGS}}, $config::config{CFLAG_NO_UNUSED_MACROS}); - push (@{$python->{CFLAGS}}, $config::config{CFLAG_NO_CAST_QUAL}); + push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_UNUSED_MACROS)"); + push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_CAST_QUAL)"); $python->{INIT_FUNCTION} = "{ (char *)\"_$basename\", init_$basename }"; } else { my $basename = $python->{NAME}; -- cgit From 7dd064fcd9c41f19d43abaa9d994224b0e215edb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 17:08:54 +0100 Subject: Factor out common code that generates object lists. (This used to be commit ef14e1ab3267263d65c4c41cd3c0dab3680f4104) --- source4/build/smb_build/main.pl | 7 ++----- source4/build/smb_build/makefile.pm | 12 ------------ source4/build/smb_build/output.pm | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 4c09e32422..d4d18a5cb9 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -48,14 +48,11 @@ $config::config{LIBRARY_OUTPUT_TYPE} = $library_output_type; $config::config{MODULE_OUTPUT_TYPE} = $module_output_type; my $mkenv = new smb_build::makefile(\%config::config, $mkfile); +my $shared_libs_used = 0; foreach my $key (values %$OUTPUT) { - next unless defined $key->{OUTPUT_TYPE}; - - $mkenv->Integrated($key) if grep(/INTEGRATED/, @{$key->{OUTPUT_TYPE}}); + $mkenv->_prepare_list($key, "OBJ_LIST"); } -my $shared_libs_used = 0; - foreach my $key (values %$OUTPUT) { next unless defined $key->{OUTPUT_TYPE}; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index dc9e1e9911..b06279ed10 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -112,13 +112,6 @@ sub _prepare_list($$$) $self->output("$ctx->{NAME}_$var =$tmplist\n"); } -sub Integrated($$) -{ - my ($self,$ctx) = @_; - - $self->_prepare_list($ctx, "OBJ_LIST"); -} - sub SharedModulePrimitives($$) { my ($self,$ctx) = @_; @@ -163,7 +156,6 @@ sub SharedModule($$) } $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); @@ -221,7 +213,6 @@ sub SharedLibraryPrimitives($$) if (not grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}})) { $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); } } @@ -269,7 +260,6 @@ sub MergedObj($$) my ($self, $ctx) = @_; $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); $self->output(<< "__EOD__" @@ -292,7 +282,6 @@ sub StaticLibrary($$) push (@{$self->{static_libs}}, $ctx->{RESULT_STATIC_LIBRARY}) if ($ctx->{TYPE} eq "LIBRARY"); $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); @@ -335,7 +324,6 @@ sub Binary($$) $self->output("binaries:: $ctx->{TARGET_BINARY}\n"); - $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 67b905ef55..33493eca2c 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -201,7 +201,7 @@ sub create_output($$) push(@{$part->{LINK_FLAGS}}, "\$($elem->{NAME}_OUTPUT)") if defined($elem->{OUTPUT}); push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); - push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); + push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); } } -- cgit From 5022db874b93f896f6e828f762f65a5d41619d61 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 17:28:24 +0100 Subject: Simplify handling of ALL_OBJS. (This used to be commit 5512c61d75d1a5404d58ba777720e62089bf45a1) --- source4/build/smb_build/main.pl | 1 + source4/build/smb_build/makefile.pm | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index d4d18a5cb9..375962bde9 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -51,6 +51,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)"); } foreach my $key (values %$OUTPUT) { diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index b06279ed10..52149083b1 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -160,8 +160,6 @@ sub SharedModule($$) $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); - if (defined($ctx->{INIT_FUNCTION}) and $ctx->{TYPE} ne "PYTHON") { my $init_fn = $ctx->{INIT_FUNCTION_TYPE}; $init_fn =~ s/\(\*\)/init_module/; @@ -226,8 +224,6 @@ sub SharedLibrary($$) $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); - my $soarg = ""; my $lns = ""; if ($self->{config}->{SONAMEFLAG} ne "#" and defined($ctx->{LIBRARY_SONAME})) { @@ -261,7 +257,6 @@ sub MergedObj($$) $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); $self->output(<< "__EOD__" # $ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) @@ -284,8 +279,6 @@ sub StaticLibrary($$) $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); - $self->output(<< "__EOD__" # $ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST) @@ -313,8 +306,6 @@ sub Binary($$) my $extradir = ""; - push(@{$self->{all_objs}}, "\$($ctx->{NAME}_FULL_OBJ_LIST)"); - unless (defined($ctx->{INSTALLDIR})) { } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { push (@{$self->{sbin_progs}}, $ctx->{RESULT_BINARY}); -- cgit From 6e0522c3cae9c99b589db67727ee1256c6da82ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 18:55:37 +0100 Subject: Build complete static libraries. (This used to be commit 34e26f4eecdf5bca340133942b242969c4c16dff) --- source4/build/smb_build/dot.pl | 2 +- source4/build/smb_build/input.pm | 26 ++------------------------ source4/build/smb_build/main.pl | 8 ++------ source4/build/smb_build/makefile.pm | 7 ++++--- source4/build/smb_build/output.pm | 12 ++++++++---- 5 files changed, 17 insertions(+), 38 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/dot.pl b/source4/build/smb_build/dot.pl index 82f89c081a..e50ee50f95 100755 --- a/source4/build/smb_build/dot.pl +++ b/source4/build/smb_build/dot.pl @@ -44,7 +44,7 @@ my $name = "samba4"; my $only; if (defined($subsys)) { my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, - "STATIC_LIBRARY", "SHARED_LIBRARY", "SHARED_LIBRARY"); + "MERGED_OBJ", "SHARED_LIBRARY", "SHARED_LIBRARY"); die("No such subsystem $subsys") unless (defined($DEPEND->{$subsys})); diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index f175b4c8c9..95902dfcbf 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -105,8 +105,9 @@ sub check_module($$$) push (@{$mod->{PUBLIC_DEPENDENCIES}}, $mod->{SUBSYSTEM}); add_libreplace($mod); } - if (grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})) { + 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}); } } @@ -181,27 +182,6 @@ sub check_binary($$) add_libreplace($bin); } -sub import_integrated($$) -{ - my ($lib, $depend) = @_; - - foreach my $mod (values %$depend) { - next if(not defined($mod->{OUTPUT_TYPE})); - next if(not grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})); - next if(not defined($mod->{SUBSYSTEM})); - next if($mod->{SUBSYSTEM} ne $lib->{NAME}); - next if($mod->{ENABLE} ne "YES"); - - push (@{$lib->{FULL_OBJ_LIST}}, "\$($mod->{NAME}_OBJ_LIST)"); - push (@{$lib->{LINK_FLAGS}}, "\$($mod->{NAME}_LINK_FLAGS)"); - push (@{$lib->{CFLAGS}}, @{$mod->{CFLAGS}}) if defined($mod->{CFLAGS}); - push (@{$lib->{PUBLIC_DEPENDENCIES}}, @{$mod->{PUBLIC_DEPENDENCIES}}) if defined($mod->{PUBLIC_DEPENDENCIES}); - push (@{$lib->{PRIVATE_DEPENDENCIES}}, @{$mod->{PRIVATE_DEPENDENCIES}}) if defined($mod->{PRIVATE_DEPENDENCIES}); - - $mod->{ENABLE} = "NO"; - } -} - sub add_implicit($$) { my ($INPUT, $n) = @_; @@ -230,7 +210,6 @@ sub calc_unique_deps($$$$$$$$) if (defined ($dep->{OUTPUT_TYPE}) && ($withlibs or - (@{$dep->{OUTPUT_TYPE}}[0] eq "INTEGRATED") or (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ") or (@{$dep->{OUTPUT_TYPE}}[0] eq "STATIC_LIBRARY"))) { push (@$busy, $dep->{NAME}); @@ -302,7 +281,6 @@ sub check($$$$$) if (defined($part->{INIT_FUNCTIONS})) { push (@{$part->{LINK_FLAGS}}, "\$(DYNEXP)"); } - import_integrated($part, $INPUT); } foreach my $part (values %$INPUT) { diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 375962bde9..3ed0327d6d 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -19,8 +19,7 @@ use strict; my $INPUT = {}; my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, "main.mk"); -my $subsys_output_type; -$subsys_output_type = ["MERGED_OBJ"]; +my $subsys_output_type = ["MERGED_OBJ"]; my $library_output_type; if ($config::config{USESHARED} eq "true") { @@ -35,7 +34,7 @@ my $module_output_type; if ($config::config{USESHARED} eq "true") { $module_output_type = ["SHARED_LIBRARY"]; } else { - $module_output_type = ["INTEGRATED"]; + $module_output_type = ["MERGED_OBJ"]; } my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, @@ -43,9 +42,6 @@ my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, $library_output_type, $module_output_type); my $OUTPUT = output::create_output($DEPEND, \%config::config); -$config::config{SUBSYSTEM_OUTPUT_TYPE} = $subsys_output_type; -$config::config{LIBRARY_OUTPUT_TYPE} = $library_output_type; -$config::config{MODULE_OUTPUT_TYPE} = $module_output_type; my $mkenv = new smb_build::makefile(\%config::config, $mkfile); my $shared_libs_used = 0; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 52149083b1..d11e761ce1 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -255,14 +255,15 @@ sub MergedObj($$) { my ($self, $ctx) = @_; + return unless defined($ctx->{OUTPUT}); + $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); $self->output(<< "__EOD__" # -$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) +$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_LIST) \@echo Partially linking \$@ \@mkdir -p bin/mergedobj - \$(PARTLINK) -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) + \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_LIST) __EOD__ ); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 33493eca2c..3d5f4466ca 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -136,7 +136,7 @@ sub generate_binary($) my $bin = shift; $bin->{DEPEND_LIST} = []; - push(@{$bin->{LINK_FLAGS}}, "\$($bin->{NAME}\_OBJ_LIST)"); + push(@{$bin->{LINK_FLAGS}}, "\$($bin->{NAME}\_FULL_OBJ_LIST)"); $bin->{DEBUGDIR} = "bin"; $bin->{RESULT_BINARY} = $bin->{OUTPUT_BINARY} = "$bin->{DEBUGDIR}/$bin->{NAME}"; @@ -198,10 +198,14 @@ sub create_output($$) my $elem = $depend->{$_}; next if $elem == $part; - push(@{$part->{LINK_FLAGS}}, "\$($elem->{NAME}_OUTPUT)") if defined($elem->{OUTPUT}); push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); - push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); - push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); + push(@{$part->{LINK_FLAGS}}, @{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); + if (defined($elem->{OUTPUT_TYPE}) and @{$elem->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ") { + push (@{$part->{FULL_OBJ_LIST}}, $elem->{TARGET}); + } else { + push(@{$part->{LINK_FLAGS}}, "\$($elem->{NAME}_OUTPUT)") if defined($elem->{OUTPUT}); + push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); + } } } -- cgit From 602f4635da0935abffdda2a29ec302a775fdbe62 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 19:06:17 +0100 Subject: Get rid of 'INTEGRATED' build of modules - now replaced by 'MERGED_OBJ' (This used to be commit 269cbf84d8b7dbf3bc88adc04ae283dc908af5ac) --- source4/build/smb_build/input.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 95902dfcbf..9cc374fa79 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -73,11 +73,11 @@ sub check_module($$$) } if (!(defined($INPUT->{$mod->{SUBSYSTEM}}))) { - $mod->{ENABLE} = "NO"; - return; + die("Unknown subsystem $mod->{SUBSYSTEM} for module $mod->{NAME}"); } if ($INPUT->{$mod->{SUBSYSTEM}} eq "NO") { + warn("Disabling module $mod->{NAME} because subsystem $mod->{SUBSYSTEM} is disabled"); $mod->{ENABLE} = "NO"; return; } -- cgit From c5487903df0f770600d0e96bfb26e00f8254c82f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 19:19:54 +0100 Subject: Be a little bit less strict about recursive dependencies. (This used to be commit 0bb89968299f90df00861a8982eefca182ed7f8d) --- source4/build/smb_build/input.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 9cc374fa79..d636ecc898 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -202,9 +202,12 @@ sub calc_unique_deps($$$$$$$$) foreach my $n (@$deps) { add_implicit($INPUT, $n) unless (defined($INPUT->{$n})); - die("Recursive dependency: $n, list: " . join(',', @$busy)) if (grep (/^$n$/, @$busy)); - next if (grep /^$n$/, @$udeps); my $dep = $INPUT->{$n}; + if (grep (/^$n$/, @$busy)) { + next if (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ"); + die("Recursive dependency: $n, list: " . join(',', @$busy)); + } + next if (grep /^$n$/, @$udeps); push (@{$udeps}, $dep->{NAME}) if $forward; -- cgit From 094769618e180cae404f5951b969e9c6c778e421 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 19:46:27 +0100 Subject: Use implicit build system element creation for external libraries. (This used to be commit 3b08f190c9dd4567e684c804a22e2612f405bbec) --- source4/build/m4/public.m4 | 22 ++++------------------ source4/build/smb_build/config_mk.pm | 2 -- source4/build/smb_build/input.pm | 13 ++++++++----- source4/build/smb_build/output.pm | 2 +- 4 files changed, 13 insertions(+), 26 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index d045cf42b7..f3d262e07a 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -8,7 +8,7 @@ dnl SMB_SUBSYSTEM(name,obj_files,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,pcname) +dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) dnl dnl SMB_ENABLE(name,default_build) dnl @@ -40,7 +40,7 @@ ENABLE = YES " ]) -dnl SMB_LIBRARY(name,obj_files,required_subsystems,version,so_version,cflags,ldflags,pcname) +dnl SMB_LIBRARY(name,obj_files,required_subsystems,version,so_version,cflags,ldflags) AC_DEFUN([SMB_LIBRARY], [ MAKE_SETTINGS="$MAKE_SETTINGS @@ -60,7 +60,6 @@ VERSION = $4 SO_VERSION = $5 CFLAGS = \$($1_CFLAGS) LDFLAGS = \$($1_LDFLAGS) -PC_NAME = $8 ENABLE = YES # End Library $1 ################################### @@ -104,8 +103,7 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG], [`$PKG_CONFIG --libs-only-l '$2'`], [`$PKG_CONFIG --cflags-only-other '$2'`], [`$PKG_CONFIG --cflags-only-I '$2'`], - [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`], - [ $2 ]) + [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`]) ac_cv_$1_found=yes else @@ -137,7 +135,7 @@ include $1 " ]) -dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags,pcname) +dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) AC_DEFUN([SMB_EXT_LIB], [ MAKE_SETTINGS="$MAKE_SETTINGS @@ -147,18 +145,6 @@ $1_CPPFLAGS = $4 $1_LDFLAGS = $5 " -SMB_INFO_EXT_LIBS="$SMB_INFO_EXT_LIBS -################################### -# Start Ext Lib $1 -@<:@EXT_LIB::$1@:>@ -LIBS = \$($1_LIBS) -CFLAGS = \$($1_CFLAGS) -CPPFLAGS = \$($1_CPPFLAGS) -LDFLAGS = \$($1_LDFLAGS) -PC_NAME = $6 -# End Ext Lib $1 -################################### -" ]) dnl SMB_ENABLE(name,default_build) diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index aa075490bc..ed05a4e4d9 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -18,7 +18,6 @@ my $section_types = { "CFLAGS" => "list", "CPPFLAGS" => "list", "LDFLAGS" => "list", - "PC_NAME" => "string", }, "PYTHON" => { SWIG_FILE => "string", @@ -90,7 +89,6 @@ my $section_types = { "SO_VERSION" => "string", "LIBRARY_REALNAME" => "string", - "PC_NAME" => "string", "PC_FILE" => "string", "INIT_FUNCTION_TYPE" => "string", diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index d636ecc898..da90e9db48 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -92,7 +92,7 @@ sub check_module($$$) if (not defined($mod->{OUTPUT_TYPE})) { if ($INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { - $mod->{OUTPUT_TYPE} = ["SHARED_LIBRARY"]; + $mod->{OUTPUT_TYPE} = undef; } else { $mod->{OUTPUT_TYPE} = $default_ot; } @@ -163,7 +163,7 @@ sub check_python($$$) $python->{LIBRARY_REALNAME} = "$basename.\$(SHLIBEXT)"; $python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }"; } - push (@{$python->{CFLAGS}}, @{$INPUT->{EXT_LIB_PYTHON}->{CFLAGS}}); + push (@{$python->{CFLAGS}}, "\$(EXT_LIB_PYTHON_CFLAGS)"); $python->{SUBSYSTEM} = "LIBPYTHON"; @@ -189,9 +189,12 @@ sub add_implicit($$) $INPUT->{$n} = { TYPE => "MAKE_RULE", NAME => $n, - TARGET => lc($n), - LIBS => "\$(".uc($n)."_LIBS)", - CFLAGS => "\$(".uc($n)."_CFLAG)" + TARGET => "", + OUTPUT_TYPE => undef, + LIBS => ["\$(".uc($n)."_LIBS)"], + LDFLAGS => ["\$(".uc($n)."_LDFLAGS)"], + CFLAGS => ["\$(".uc($n)."_CFLAGS)"], + CPPFLAGS => ["\$(".uc($n)."_CPPFLAGS)"] }; } diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 3d5f4466ca..83be28e740 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -210,7 +210,7 @@ sub create_output($$) } foreach $part (values %{$depend}) { - if (($part->{STANDARD_VISIBILITY} ne "default") and + if (defined($part->{STANDARD_VISIBILITY}) and ($part->{STANDARD_VISIBILITY} ne "default") and ($config->{visibility_attribute} eq "yes")) { push(@{$part->{FINAL_CFLAGS}}, "-fvisibility=$part->{STANDARD_VISIBILITY}"); } -- cgit From ff0315ba859421dff6aba055887e086fa68c2951 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 20:04:18 +0100 Subject: Rename include to mkinclude to emphasize it is different from make's include. (This used to be commit 0e1d0a874ae3d22b8f97a79b81fe0af3ef53a771) --- source4/build/m4/public.m4 | 2 +- source4/build/smb_build/config_mk.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index f3d262e07a..eb673446c7 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -131,7 +131,7 @@ dnl SMB_INCLUDE_MK(file) AC_DEFUN([SMB_INCLUDE_MK], [ SMB_INFO_EXT_LIBS="$SMB_INFO_EXT_LIBS -include $1 +mkinclude $1 " ]) diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index ed05a4e4d9..4d8db8a04e 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -239,7 +239,7 @@ sub run_config_mk($$$$) } # include - if ($line =~ /^include (.*)$/) { + if ($line =~ /^mkinclude (.*)$/) { my $subfile= $1; my $subdir = dirname($filename); $subdir =~ s/^\.$//g; -- cgit From 3e4b8da4df1675aa8ac1b23675700d5f8c88daf7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 20:14:29 +0100 Subject: Fix summary. (This used to be commit afe9418b728a1b35f713c650622c1abadba9a526) --- source4/build/smb_build/summary.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/summary.pm b/source4/build/smb_build/summary.pm index 52817f3597..4ea1ad525e 100644 --- a/source4/build/smb_build/summary.pm +++ b/source4/build/smb_build/summary.pm @@ -5,6 +5,7 @@ # Released under the GNU GPL package summary; +use smb_build::config; use strict; sub enabled($) @@ -21,9 +22,7 @@ sub showitem($$$) my @need = (); foreach (@$items) { - if (!enabled($output->{$_}->{ENABLE})) { - push (@need, $_); - } + push (@need, $_) if (enabled($config::enable{$_})); } print "Support for $desc: "; -- cgit