diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-05-17 00:51:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:16:50 -0500 |
commit | e73d051e20f18ab981f540a7178900ac3f3c45fd (patch) | |
tree | a70f698c9d978ed5f6d6fa2fdc67f94b8fdd1e77 /source4/build/smb_build | |
parent | 29a8069aee510c9dcc1a216a52cc53639621caf9 (diff) | |
download | samba-e73d051e20f18ab981f540a7178900ac3f3c45fd.tar.gz samba-e73d051e20f18ab981f540a7178900ac3f3c45fd.tar.bz2 samba-e73d051e20f18ab981f540a7178900ac3f3c45fd.zip |
r6839: Add support for building subsystems as shared libraries. This can be
done by setting:
OUTPUT_TYPE = SHARED_LIBRARY
in the [SUBSYSTEM::...] section belonging to a subsystem.
The idea is to allow multiple values to OUTPUT_TYPE simultaneously
(e.g. OUTPUT_TYPE = SHARED_LIBRARY, STATIC_LIBRARY, OBJLIST )
(This used to be commit b9d0ae93ba86fec0115f58e7940b2a6c908bc809)
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r-- | source4/build/smb_build/input.pm | 10 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 14 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 18 |
3 files changed, 22 insertions, 20 deletions
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 8f0509692c..72e978dfc5 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -10,7 +10,7 @@ use strict; package input; -my $subsystem_output_type = "OBJLIST"; +my $subsystem_default_output_type = "OBJLIST"; my $srcdir = "."; sub strtrim($) @@ -55,7 +55,9 @@ sub check_subsystem($$) } unless(defined($subsys->{OUTPUT_TYPE})) { - $subsys->{OUTPUT_TYPE} = $subsystem_output_type; + $subsys->{OUTPUT_TYPE} = $subsystem_default_output_type; + } else { + $subsys->{OUTPUT_TYPE} = join('', @{$subsys->{OUTPUT_TYPE}}); } } @@ -97,7 +99,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} = $subsystem_output_type; + $mod->{OUTPUT_TYPE} = $subsystem_default_output_type; } else { $mod->{ENABLE} = "NO"; printf("Module: %s...not\n",$mod->{NAME}); @@ -169,7 +171,7 @@ sub check($) { my $CTX = shift; - ($subsystem_output_type = $ENV{SUBSYSTEM_OUTPUT_TYPE}) if (defined($ENV{"SUBSYSTEM_OUTPUT_TYPE"})); + ($subsystem_default_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 1eb1c6ea00..317abb3c8b 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -88,13 +88,13 @@ CC=@CC@ CC_FLAGS=-Iinclude -I. -I$(srcdir)/include -I$(srcdir) -D_SAMBA_BUILD_ -DHAVE_CONFIG_H -Ilib @CFLAGS@ @CPPFLAGS@ LD=@CC@ -LD_FLAGS=@LDFLAGS@ @CFLAGS@ +LD_FLAGS=@LDFLAGS@ @CFLAGS@ -Lbin STLD=ar STLD_FLAGS=-rc SHLD=@CC@ -SHLD_FLAGS=@LDSHFLAGS@ @LDFLAGS@ +SHLD_FLAGS=@LDSHFLAGS@ @LDFLAGS@ -Lbin __EOD__ @@ -358,7 +358,6 @@ sub _prepare_shared_library_rule($) my $tmpshflag; my $tmprules; my $output; - my $outname = $ctx->{OUTPUT}; $tmpdepend = array2oneperline($ctx->{DEPEND_LIST}); @@ -376,7 +375,7 @@ LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS =$tmpshflag # # Shared $ctx->{LIBRARY_NAME} -$ctx->{OUTPUT}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy +$ctx->{TARGET}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy \@echo Linking \$\@ \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\ \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS) \\ @@ -396,11 +395,10 @@ bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} bin/.dummy \@ln -sf $ctx->{LIBRARY_SONAME} \$\@ __EOD__ - $outname = $ctx->{LIBRARY_NAME}; } $output .= << "__EOD__"; -library_$ctx->{NAME}: basics bin/$outname +library_$ctx->{NAME}: basics bin/lib$ctx->{LIBRARY_NAME} # End Library $ctx->{NAME} ################################### @@ -453,7 +451,7 @@ LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink # # Static $ctx->{LIBRARY_NAME} -$ctx->{OUTPUT}: $(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy +$ctx->{TARGET}: $(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy @echo Linking $@ @$(STLD) $(STLD_FLAGS) $@ \\ $(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST) @@ -807,7 +805,7 @@ sub _prepare_makefile_in($) my @all = (); foreach my $part (values %{$CTX}) { - push (@all, $part->{OUTPUT}) if defined ($part->{OUTPUT_TYPE}) and $part->{OUTPUT_TYPE} eq "BINARY"; + push (@all, $part->{TARGET}) if defined ($part->{OUTPUT_TYPE}) and $part->{OUTPUT_TYPE} eq "BINARY"; } $output .= _prepare_make_target({ TARGET => "all", DEPEND_LIST => \@all }); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index d2ee5a9165..f6a9fc6eb3 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -14,7 +14,7 @@ sub generate_objlist($) { my $subsys = shift; - $subsys->{OUTPUT} = "\$($subsys->{TYPE}_$subsys->{NAME}_OBJS)"; + $subsys->{TARGET} = $subsys->{OUTPUT} = "\$($subsys->{TYPE}_$subsys->{NAME}_OBJS)"; } sub generate_shared_library($) @@ -23,14 +23,15 @@ sub generate_shared_library($) @{$lib->{DEPEND_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)"); @{$lib->{LINK_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)"); - $lib->{LIBRARY_NAME} = $lib->{NAME}.".so"; - $lib->{OUTPUT} = "bin/$lib->{LIBRARY_NAME}"; + $lib->{LIBRARY_NAME} = lc($lib->{NAME}).".so"; + $lib->{TARGET} = "bin/lib$lib->{LIBRARY_NAME}"; if (defined($lib->{MAJOR_VERSION})) { $lib->{LIBRARY_SONAME} = $lib->{LIBRARY_NAME}.".$lib->{MAJOR_VERSION}"; $lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_SONAME}.".$lib->{MINOR_VERSION}.$lib->{RELEASE_VERSION}"; - $lib->{OUTPUT} = "bin/$lib->{LIBRARY_REALNAME}"; + $lib->{TARGET} = "bin/lib$lib->{LIBRARY_REALNAME}"; @{$lib->{LINK_FLAGS}} = ("\@SONAMEFLAG\@$lib->{LIBRARY_SONAME}"); } + $lib->{OUTPUT} = "-l".lc($lib->{NAME}); } sub generate_static_library($) @@ -39,11 +40,12 @@ sub generate_static_library($) @{$lib->{DEPEND_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)"); - $lib->{LIBRARY_NAME} = $lib->{NAME}.".a"; + $lib->{LIBRARY_NAME} = lc($lib->{NAME}).".a"; @{$lib->{LINK_LIST}} = ("\$($lib->{TYPE}_$lib->{NAME}\_OBJS)"); @{$lib->{LINK_FLAGS}} = (); - $lib->{OUTPUT} = "bin/$lib->{LIBRARY_NAME}"; + $lib->{TARGET} = "bin/lib$lib->{LIBRARY_NAME}"; + $lib->{OUTPUT} = "-l".lc($lib->{NAME}); } sub generate_binary($) @@ -54,7 +56,7 @@ sub generate_binary($) @{$bin->{LINK_LIST}} = ("\$($bin->{TYPE}_$bin->{NAME}\_OBJS)"); @{$bin->{LINK_FLAGS}} = (); - $bin->{OUTPUT} = "bin/$bin->{NAME}"; + $bin->{TARGET} = $bin->{OUTPUT} = "bin/$bin->{NAME}"; $bin->{BINARY} = $bin->{NAME}; } @@ -93,7 +95,7 @@ sub create_output($) push(@{$part->{CPPFLAGS}}, @{$elem->{CPPFLAGS}}) if defined(@{$elem->{CPPFLAGS}}); push(@{$part->{CFLAGS}}, @{$elem->{CFLAGS}}) if defined(@{$elem->{CFLAGS}}); - push(@{$part->{DEPEND_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT}); + push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); push(@{$part->{LINK_LIST}}, $elem->{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}); |