From 8d7e2eb68c7c63ef36d24ce59953c20c2579aa5f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 20:38:21 +0100 Subject: Reintroduce mergedobj support. (This used to be commit 1cf23c58411a9b8a9bb97016c27c10a218e73146) --- source4/build/smb_build/main.pl | 3 ++- source4/build/smb_build/makefile.pm | 18 ++++++++++++++++++ source4/build/smb_build/output.pm | 12 ++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index a85eab32de..4c09e32422 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -20,7 +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 = ["STATIC_LIBRARY"]; +$subsys_output_type = ["MERGED_OBJ"]; my $library_output_type; if ($config::config{USESHARED} eq "true") { @@ -59,6 +59,7 @@ my $shared_libs_used = 0; 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}}); if (defined($key->{PC_FILE})) { push(@{$mkenv->{pc_files}}, "$key->{BASEDIR}/$key->{PC_FILE}"); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9c6d52cfef..6ea3b8d950 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -277,6 +277,24 @@ __EOD__ $self->output("\n"); } +sub MergedObj($$) +{ + my ($self, $ctx) = @_; + + $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__" +# +$ctx->{TARGET_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) + \@echo Partially linking \$@ + \@mkdir -p bin/mergedobj + \@\$(LD) -r -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) + +__EOD__ +); +} + sub StaticLibrary($$) { my ($self,$ctx) = @_; diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 4350370fbf..0ddb9e4efb 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -89,6 +89,17 @@ sub generate_shared_library($) $lib->{OUTPUT_SHARED_LIBRARY} = $lib->{TARGET_SHARED_LIBRARY}; } +sub generate_merged_obj($) +{ + my $lib = shift; + + my $link_name = $lib->{NAME}; + $link_name =~ s/^LIB//; + + $lib->{MERGED_OBJNAME} = lc($link_name).".o"; + $lib->{TARGET_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; +} + sub generate_static_library($) { my $lib = shift; @@ -153,6 +164,7 @@ sub create_output($$) 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}}); + generate_merged_obj($part) if grep(/MERGED_OBJ/, @{$part->{OUTPUT_TYPE}}); $part->{OUTPUT} = $part->{"OUTPUT_" . @{$part->{OUTPUT_TYPE}}[0]}; $part->{TARGET} = $part->{"TARGET_" . @{$part->{OUTPUT_TYPE}}[0]}; } -- cgit From f6dec9de4715892abab6cc9f75c2eb6c70f75947 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 20:48:08 +0100 Subject: Use standard variable for partial linking. (This used to be commit 949fca9540889bb640466fc21ca36d08f77066a3) --- source4/build/smb_build/input.pm | 1 + source4/build/smb_build/makefile.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 51c89a834f..02eafe2033 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -234,6 +234,7 @@ 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}); calc_unique_deps($dep->{NAME}, $INPUT, $dep->{PUBLIC_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 6ea3b8d950..34092c69bd 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -289,7 +289,7 @@ sub MergedObj($$) $ctx->{TARGET_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) \@echo Partially linking \$@ \@mkdir -p bin/mergedobj - \@\$(LD) -r -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) + \$(PARTLINK) -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) __EOD__ ); -- cgit From fe5b7c4986b54985880fa8bc38248dab1cc5e9b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 20:56:46 +0100 Subject: Some more mergedobj fixes. (This used to be commit c481d88d37346885f7809f73035a2bc9f2468848) --- source4/build/smb_build/input.pm | 16 +++------------- source4/build/smb_build/makefile.pm | 1 + 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 02eafe2033..825b033fb9 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -76,8 +76,6 @@ sub check_module($$$) die("Module $mod->{NAME} does not have a SUBSYSTEM set") if not defined($mod->{SUBSYSTEM}); - my $use_default = 0; - if (not exists($INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS})) { $INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS} = []; } @@ -126,9 +124,7 @@ sub check_library($$$) return if ($lib->{ENABLE} ne "YES"); - unless (defined($lib->{OUTPUT_TYPE})) { - $lib->{OUTPUT_TYPE} = $default_ot; - } + 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"; @@ -141,12 +137,8 @@ sub check_library($$$) } 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"; - } + unless (defined($lib->{INSTALLDIR})) { $lib->{INSTALLDIR} = "LIBDIR"; } add_libreplace($lib); } @@ -281,9 +273,7 @@ sub check($$$$$) } } - foreach my $k (keys %$INPUT) { - my $part = $INPUT->{$k}; - + foreach my $part (values %$INPUT) { $part->{LINK_FLAGS} = []; $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_LIST)"]; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 34092c69bd..16b46ed343 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -281,6 +281,7 @@ 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)"); -- cgit From 0419da69d5a8ab606a49598692c050447e306663 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 16 Feb 2008 21:16:28 +0100 Subject: Prevent adding libreplace when not necessary. (This used to be commit 978eb6f1616122e13429b00268d03942afc41425) --- source4/build/smb_build/input.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 825b033fb9..ed584e185c 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -66,8 +66,6 @@ sub check_subsystem($$$) unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; } - - add_libreplace($subsys); } sub check_module($$$) @@ -111,11 +109,11 @@ sub check_module($$$) $sane_subsystem =~ s/^lib//; $mod->{INSTALLDIR} = "MODULESDIR/$sane_subsystem"; push (@{$mod->{PUBLIC_DEPENDENCIES}}, $mod->{SUBSYSTEM}); + add_libreplace($mod); } if (grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})) { push (@{$INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS}}, $mod->{INIT_FUNCTION}) if defined($mod->{INIT_FUNCTION}); } - add_libreplace($mod); } sub check_library($$$) -- cgit From e8cf95773df914e8d71dcc1ce713fe0cc723d946 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 18 Feb 2008 11:50:07 +0100 Subject: Switch back to using static libraries for subsystems for now, since partial linking is still giving some problems. (This used to be commit 0d8ddae4964dc50e981e12b6a93235a50a0607ff) --- source4/build/smb_build/main.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 4c09e32422..46a092d69f 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -20,7 +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 = ["MERGED_OBJ"]; +$subsys_output_type = ["STATIC_LIBRARY"]; my $library_output_type; if ($config::config{USESHARED} eq "true") { -- cgit