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

Build complete static libraries.

(This used to be commit 34e26f4eec)
This commit is contained in:
Jelmer Vernooij 2008-02-18 18:55:37 +01:00
parent 5022db874b
commit 6e0522c3ca
5 changed files with 17 additions and 38 deletions

View File

@ -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}));

View File

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

View File

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

View File

@ -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__
);

View File

@ -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});
}
}
}