summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-14 16:51:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:48 -0500
commit1817b3d4a533ca548141fec473843414c4a4196d (patch)
tree0c10212caaa2b31207ca9152f100451aa0386d53 /source4/build
parent836f6ea0bfea0721c55fc155f6f4b19a1316c1ef (diff)
downloadsamba-1817b3d4a533ca548141fec473843414c4a4196d.tar.gz
samba-1817b3d4a533ca548141fec473843414c4a4196d.tar.bz2
samba-1817b3d4a533ca548141fec473843414c4a4196d.zip
r3735: Allow building subsystems as static libraries (.a files). To enable
this support, run SUBSYSTEM_OUTPUT_TYPE=STATIC_LIBRARY ./config.status I haven't enabled this by default because there are some circular dependencies in the makefile that have to be resolved first (LIBRPC depends on LIBSMB and LIBSMB depends on LIBRPC..) (This used to be commit fc0432069bf3569a47a7c32f4bf789cec2ca44db)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/smb_build/input.pm8
-rw-r--r--source4/build/smb_build/makefile.pm4
-rw-r--r--source4/build/smb_build/output.pm4
3 files changed, 8 insertions, 8 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index b94586d2c2..f50f8baaaf 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -10,6 +10,7 @@
use strict;
package input;
+my $subsystem_output_type = "OBJLIST";
our $srcdir = ".";
sub strtrim($)
@@ -52,8 +53,7 @@ sub check_subsystem($$)
printf("Subsystem: %s disabled!\n",$subsys->{NAME});
}
- # FIXME: Make this configurable (so it can be STATIC_LIBRARY, for example)
- $subsys->{OUTPUT_TYPE} = "OBJLIST";
+ $subsys->{OUTPUT_TYPE} = $subsystem_output_type;
}
sub check_module($$)
@@ -89,7 +89,7 @@ sub check_module($$)
$mod->{ENABLE} = "YES";
push (@{$CTX->{INPUT}{$mod->{SUBSYSTEM}}{REQUIRED_SUBSYSTEMS}}, $mod->{NAME});
printf("Module: %s...static\n",$mod->{NAME});
- $mod->{OUTPUT_TYPE} = "OBJLIST";
+ $mod->{OUTPUT_TYPE} = $subsystem_output_type;
} else {
$mod->{ENABLE} = "NO";
printf("Module: %s...not\n",$mod->{NAME});
@@ -151,6 +151,8 @@ sub check($)
{
my $CTX = shift;
+ ($subsystem_output_type = $ENV{SUBSYSTEM_OUTPUT_TYPE}) if (defined($ENV{"SUBSYSTEM_OUTPUT_TYPE"}));
+
foreach my $part (values %{$CTX->{INPUT}}) {
($part->{ENABLE} = "YES") if not defined($part->{ENABLE});
}
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index bfc3aa7bf0..228c1d7e9b 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -425,13 +425,11 @@ sub _prepare_static_library_rule($)
LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
#
LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink
-LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS =$tmpstflag
#
# Static $ctx->{LIBRARY_NAME}
-bin/$ctx->{LIBRARY_NAME}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
+$ctx->{OUTPUT}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
\@echo Linking \$\@
\@\$(STLD) \$(STLD_FLAGS) \$\@ \\
- \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS) \\
\$(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST)
library_$ctx->{NAME}: basics $tmprules
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm
index 7d310670f6..11e994407e 100644
--- a/source4/build/smb_build/output.pm
+++ b/source4/build/smb_build/output.pm
@@ -43,7 +43,7 @@ sub generate_static_library($)
@{$lib->{LINK_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)");
@{$lib->{LINK_FLAGS}} = ();
- $lib->{OUTPUT} = $lib->{LIBRARY_NAME};
+ $lib->{OUTPUT} = "bin/$lib->{LIBRARY_NAME}";
}
sub generate_binary($)
@@ -95,7 +95,7 @@ sub create_output($)
push(@{$part->{CFLAGS}}, @{$elem->{CFLAGS}}) if defined(@{$elem->{CFLAGS}});
push(@{$part->{DEPEND_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT});
push(@{$part->{LINK_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT});
- push(@{$part->{LINK_LIST}}, @{$elem->{LIBS}}) if defined($elem->{LIBS});
+ push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS});
push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS});
push(@{$part->{MODULE_INIT_FUNCTIONS}}, @{$elem->{INIT_FUNCTION}}) if