diff options
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/smb_build/input.pm | 21 | ||||
-rw-r--r-- | source4/build/smb_build/main.pl | 2 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 19 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 12 |
4 files changed, 38 insertions, 16 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 35fc1962b2..9c7ffc850e 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($$$) @@ -76,8 +74,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} = []; } @@ -113,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($$$) @@ -126,9 +122,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 +135,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); } @@ -233,6 +223,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); @@ -279,9 +270,7 @@ sub check($$$$$) } } - foreach my $k (keys %$INPUT) { - my $part = $INPUT->{$k}; - + foreach my $part (values %$INPUT) { $part->{LINK_FLAGS} = []; if ($part->{TYPE} eq "SUBSYSTEM") { diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index c7a92b7ce1..0717cd9b0b 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -19,6 +19,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"]; my $library_output_type; @@ -53,6 +54,7 @@ foreach my $key (values %$OUTPUT) { next unless defined $key->{OUTPUT_TYPE}; $mkenv->StaticLibraryPrimitives($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->MergedObj($key) if grep(/MERGED_OBJ/, @{$key->{OUTPUT_TYPE}}); if (defined($key->{PC_FILE})) { $mkenv->output("PC_FILES += $key->{BASEDIR}/$key->{PC_FILE}\n"); } diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index ecbf554fc7..072e3c0c4b 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -222,6 +222,25 @@ __EOD__ $self->output("endif\n"); } +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__" +# +$ctx->{TARGET_MERGED_OBJ}: \$($ctx->{NAME}_FULL_OBJ_LIST) + \@echo Partially linking \$@ + \@mkdir -p bin/mergedobj + \$(PARTLINK) -o \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) + +__EOD__ +); +} + sub StaticLibraryPrimitives($$) { 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]}; } |