summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/input.pm2
-rw-r--r--source4/build/smb_build/main.pl15
-rw-r--r--source4/build/smb_build/makefile.pm27
3 files changed, 21 insertions, 23 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index 51c89a834f..35fc1962b2 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -208,7 +208,6 @@ sub import_integrated($$)
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});
@@ -284,7 +283,6 @@ sub check($$$$$)
my $part = $INPUT->{$k};
$part->{LINK_FLAGS} = [];
- $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_LIST)"];
if ($part->{TYPE} eq "SUBSYSTEM") {
check_subsystem($INPUT, $part, $subsys_ot);
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index 17b4f1ca7f..8220fc7ffb 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -48,18 +48,12 @@ $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);
-foreach my $key (values %$OUTPUT) {
- next unless defined $key->{OUTPUT_TYPE};
-
- $mkenv->Integrated($key) if grep(/INTEGRATED/, @{$key->{OUTPUT_TYPE}});
-}
-
my $shared_libs_used = 0;
foreach my $key (values %$OUTPUT) {
next unless defined $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");
}
@@ -82,6 +76,13 @@ foreach my $key (values %$OUTPUT) {
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
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 986c237e8c..4498d9f019 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -115,6 +115,7 @@ sub Integrated($$)
my ($self,$ctx) = @_;
$self->_prepare_list($ctx, "OBJ_LIST");
+ $self->output("$ctx->{SUBSYSTEM}_OBJ_LIST += \$($ctx->{NAME}_OBJ_LIST)\n");
}
sub SharedModulePrimitives($$)
@@ -216,7 +217,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");
}
}
@@ -228,7 +228,6 @@ sub SharedLibrary($$)
$self->_prepare_list($ctx, "DEPEND_LIST");
$self->_prepare_list($ctx, "LINK_FLAGS");
-# $self->_prepare_list_ex($ctx, "LINK_FLAGS", "-Wl,--whole-archive", "-Wl,--no-whole-archive");
my $soarg = "";
my $lns = "";
@@ -246,11 +245,11 @@ sub SharedLibrary($$)
$self->output(<< "__EOD__"
#
-$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST)
+$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_OBJ_LIST)
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
\@\$(SHLD) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
- \$($ctx->{NAME}\_FULL_OBJ_LIST) \\
+ \$($ctx->{NAME}\_OBJ_LIST) \\
\$($ctx->{NAME}_LINK_FLAGS) \\
$soarg$lns
__EOD__
@@ -258,24 +257,24 @@ __EOD__
$self->output("\n");
}
-sub StaticLibrary($$)
+sub StaticLibraryPrimitives($$)
{
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->{NAME}_OUTPUT = $ctx->{OUTPUT}\n");
$self->_prepare_list($ctx, "OBJ_LIST");
- $self->_prepare_list($ctx, "FULL_OBJ_LIST");
+}
- $self->output(<< "__EOD__"
-#
-$ctx->{TARGET_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)
+sub StaticLibrary($$)
+{
+ my ($self,$ctx) = @_;
-__EOD__
-);
+ return unless (defined($ctx->{OBJ_FILES}));
+
+ $self->output("STATIC_LIBS += $ctx->{TARGET_STATIC_LIBRARY}\n") if ($ctx->{TYPE} eq "LIBRARY");
+ $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n");
+ $self->output("$ctx->{TARGET_STATIC_LIBRARY}: \$($ctx->{NAME}_OBJ_LIST)\n");
}
sub Header($$)