diff options
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r-- | source4/build/smb_build/TODO | 1 | ||||
-rw-r--r-- | source4/build/smb_build/config_mk.pm | 5 | ||||
-rw-r--r-- | source4/build/smb_build/input.pm | 9 | ||||
-rw-r--r-- | source4/build/smb_build/main.pl | 2 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 41 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 18 |
6 files changed, 25 insertions, 51 deletions
diff --git a/source4/build/smb_build/TODO b/source4/build/smb_build/TODO index cb92772cf1..b9607cd593 100644 --- a/source4/build/smb_build/TODO +++ b/source4/build/smb_build/TODO @@ -1,5 +1,4 @@ - subdir handler for install headers into a specific directory -- sonames - hack for loading modules locally - create - saner names for some of the .pc files diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 7eb0ddc56d..c0d05a4e6f 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -71,9 +71,8 @@ my $section_types = { "EXTRA_CFLAGS" => "string" }, "LIBRARY" => { - "MAJOR_VERSION" => "string", - "MINOR_VERSION" => "string", - "RELEASE_VERSION" => "string", + "VERSION" => "string", + "SO_VERSION" => "string", "INIT_FUNCTION_TYPE" => "string", diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 73157758c0..f83e04f0c4 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -88,8 +88,13 @@ sub check_library($$$) $lib->{OUTPUT_TYPE} = $default_ot; - unless (defined($lib->{MAJOR_VERSION})) { - print "$lib->{NAME}: Please specify MAJOR_VERSION\n"; + if (defined($lib->{VERSION}) and not defined($lib->{SO_VERSION})) { + print "$lib->{NAME}: Please specify SO_VERSION when specifying VERSION\n"; + return; + } + + if (defined($lib->{SO_VERSION}) and not defined($lib->{VERSION})) { + print "$lib->{NAME}: Please specify VERSION when specifying SO_VERSION\n"; return; } diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index 130dd188c6..733b447e40 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -67,7 +67,7 @@ foreach my $key (values %$OUTPUT) { $mkenv->ObjList($key) if $key->{OUTPUT_TYPE} eq "OBJLIST"; $mkenv->StaticLibrary($key) if $key->{OUTPUT_TYPE} eq "STATIC_LIBRARY"; $mkenv->PkgConfig($key) if ($key->{OUTPUT_TYPE} eq "SHARED_LIBRARY") and - defined($key->{MAJOR_VERSION}); + defined($key->{VERSION}); $mkenv->SharedLibrary($key) if $key->{OUTPUT_TYPE} eq "SHARED_LIBRARY"; $mkenv->Binary($key) if $key->{OUTPUT_TYPE} eq "BINARY"; $mkenv->Manpage($key) if defined($key->{MANPAGE}); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index f17deb53f9..8ab19e980d 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -131,7 +131,6 @@ STLD_FLAGS=-rc -L\$(builddir)/bin SHLD=$self->{config}->{CC} SHLD_FLAGS=$self->{config}->{LDSHFLAGS} -L\$(builddir)/bin -SONAMEFLAG=$self->{config}->{SONAMEFLAG} SHLIBEXT=$self->{config}->{SHLIBEXT} XSLTPROC=$self->{config}->{XSLTPROC} @@ -258,6 +257,12 @@ __EOD__ $init_obj = "bin/$ctx->{NAME}_init_module.o"; } + my $soarg = ""; + if ($self->{config}->{SONAMEFLAG} ne "" and + defined($ctx->{LIBRARY_SONAME})) { + $soarg = "$self->{config}->{SONAMEFLAG}$ctx->{LIBRARY_SONAME} "; + } + if ($self->{duplicate_build}) { $self->output(<< "__EOD__" # @@ -265,25 +270,11 @@ __EOD__ bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) $init_obj \@echo Linking \$\@ \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\ - \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\ + \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $soarg \\ $init_obj \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST) __EOD__ ); - if (defined($ctx->{LIBRARY_SONAME})) { - $self->output(<< "__EOD__" -# Symlink $ctx->{LIBRARY_SONAME} -bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} - \@echo Symlink \$\@ - \@ln -sf $ctx->{LIBRARY_REALNAME} \$\@ -# Symlink $ctx->{LIBRARY_NAME} -bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} - \@echo Symlink \$\@ - \@ln -sf $ctx->{LIBRARY_SONAME} \$\@ - -__EOD__ -); - } } $self->output(<< "__EOD__" @@ -292,25 +283,11 @@ __EOD__ $installdir/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) $init_obj \@echo Linking \$\@ \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\ - \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\ + \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $soarg \\ $init_obj \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST) __EOD__ ); - if (defined($ctx->{LIBRARY_SONAME})) { - $self->output(<< "__EOD__" -# Symlink $ctx->{LIBRARY_SONAME} -$installdir/$ctx->{LIBRARY_SONAME}: $installdir/$ctx->{LIBRARY_REALNAME} - \@echo Symlink \$\@ - \@ln -sf $ctx->{LIBRARY_REALNAME} \$\@ -# Symlink $ctx->{LIBRARY_NAME} -$installdir/$ctx->{LIBRARY_NAME}: $installdir/$ctx->{LIBRARY_SONAME} - \@echo Symlink \$\@ - \@ln -sf $ctx->{LIBRARY_SONAME} \$\@ - -__EOD__ -); - } } sub MergedObj($$) @@ -486,7 +463,7 @@ sub PkgConfig($$) $link_name, $ctx->{OUTPUT}, "", - "$ctx->{MAJOR_VERSION}.$ctx->{MINOR_VERSION}.$ctx->{RELEASE_VERSION}", + "$ctx->{VERSION}", $ctx->{DESCRIPTION} ); } diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 0897232f98..2a0d592895 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -56,17 +56,15 @@ sub generate_shared_library($) $link_name =~ s/^LIB//; $link_name = lc($link_name); $lib_name = "lib$link_name"; - $lib->{OUTPUT} = "-l$link_name"; } $lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_NAME} = "$lib_name.\$(SHLIBEXT)"; - $lib->{TARGET} = "bin/$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->{TARGET} = "bin/$lib->{LIBRARY_REALNAME}"; - @{$lib->{LINK_FLAGS}} = ("\$(SONAMEFLAG)$lib->{LIBRARY_SONAME}"); + if (defined($lib->{VERSION})) { + $lib->{LIBRARY_SONAME} = $lib->{LIBRARY_NAME}.".$lib->{SO_VERSION}"; + $lib->{LIBRARY_REALNAME} = $lib->{LIBRARY_NAME}.".$lib->{VERSION}"; } + $lib->{TARGET} = "bin/$lib->{LIBRARY_REALNAME}"; + $lib->{OUTPUT} = $lib->{TARGET}; } sub generate_static_library($) @@ -143,11 +141,7 @@ sub create_output($$) 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}); - if (defined($elem->{OUTPUT_TYPE}) and ($elem->{OUTPUT_TYPE} eq "SHARED_LIBRARY")) { - push(@{$part->{DEPEND_LIST}}, "bin/$elem->{LIBRARY_NAME}"); - } else { - push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); - } + push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if defined($elem->{TARGET}); push(@{$part->{SUBSYSTEM_INIT_FUNCTIONS}}, $elem->{INIT_FUNCTION}) if defined($elem->{INIT_FUNCTION}) and $elem->{TYPE} ne "MODULE" and |