summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/output.pl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-05-13 16:15:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:42 -0500
commitd5ba19d0088f65e308443a32dd39c11d6ba8983d (patch)
tree9bc4462909f0cfd73d572c801115a357ad859aa2 /source4/build/smb_build/output.pl
parent3f564db67d9ffca599b1885ad2c6379830cd0aaf (diff)
downloadsamba-d5ba19d0088f65e308443a32dd39c11d6ba8983d.tar.gz
samba-d5ba19d0088f65e308443a32dd39c11d6ba8983d.tar.bz2
samba-d5ba19d0088f65e308443a32dd39c11d6ba8983d.zip
r690: - ignore source/tags
- add support for shared libraries - enable libldb shared lib when --enable-experimental metze (This used to be commit dcef69dc54a2575e7f57d67d1983482b4ff57bdb)
Diffstat (limited to 'source4/build/smb_build/output.pl')
-rw-r--r--source4/build/smb_build/output.pl68
1 files changed, 68 insertions, 0 deletions
diff --git a/source4/build/smb_build/output.pl b/source4/build/smb_build/output.pl
index f458c3b04a..84f822aaa9 100644
--- a/source4/build/smb_build/output.pl
+++ b/source4/build/smb_build/output.pl
@@ -107,6 +107,74 @@ sub _generate_shared_modules($)
sub _generate_libraries($)
{
+ my $CTX = shift;
+
+ #
+ # loop over all binaries
+ #
+ foreach my $key (sort keys %{$CTX->{DEPEND}{LIBRARIES}}) {
+ my $NAME = $CTX->{INPUT}{LIBRARIES}{$key}{NAME};
+ my @OBJ_LIST = @{$CTX->{INPUT}{LIBRARIES}{$key}{OBJ_FILES}};
+ my $MAJOR_VERSION = $CTX->{INPUT}{LIBRARIES}{$key}{MAJOR_VERSION};
+ my $MINOR_VERSION = $CTX->{INPUT}{LIBRARIES}{$key}{MINOR_VERSION};
+ my $RELEASE_VERSION = $CTX->{INPUT}{LIBRARIES}{$key}{RELEASE_VERSION};
+ #
+ my @DEPEND_LIST = ("\$(LIBRARY_$NAME\_OBJS)");
+
+ my $STATIC_LIBRARY_NAME = $NAME.".a";
+ my @STATIC_LINK_LIST = ("\$(LIBRARY_$NAME\_OBJS)");
+ my @STATIC_LINK_FLAGS = ();
+
+ my $SHARED_LIBRARY_NAME = $NAME.".so";
+ my $SHARED_LIBRARY_SONAME = $SHARED_LIBRARY_NAME.".$MAJOR_VERSION";
+ my $SHARED_LIBRARY_REALNAME = $SHARED_LIBRARY_SONAME.".$MINOR_VERSION.$RELEASE_VERSION";
+ my @SHARED_LINK_LIST = ("\$(LIBRARY_$NAME\_OBJS)");
+ my @SHARED_LINK_FLAGS = ("\@SONAMEFLAG\@$SHARED_LIBRARY_SONAME");
+
+ push(@{$CTX->{OUTPUT}{PROTO}{OBJ_LIST}},"\$(LIBRARY_$key\_OBJS)");
+
+ #
+ # not add to 'make all' for now
+ #
+
+ foreach my $elem (@{$CTX->{DEPEND}{LIBRARIES}{$key}{SUBSYSTEMS_LIST}}) {
+ if (!defined($CTX->{DEPEND}{SUBSYSTEMS}{$elem})) {
+ die("Library[$NAME] depends on unkown Subsystem[$elem]!\n");
+ }
+ push(@DEPEND_LIST,"\$(SUBSYSTEM_$elem\_OBJS)");
+ push(@STATIC_LINK_LIST,"\$(SUBSYSTEM_$elem\_OBJS)");
+ push(@SHARED_LINK_LIST,"\$(SUBSYSTEM_$elem\_OBJS)");
+ }
+
+ foreach my $elem (@{$CTX->{DEPEND}{LIBRARIES}{$key}{LIBRARIES_LIST}}) {
+ if (!defined($CTX->{DEPEND}{EXT_LIBS}{$elem})) {
+ die("Library[$NAME] depends on unkown External Library[$elem]!\n");
+ }
+ push(@STATIC_LINK_LIST,@{$CTX->{DEPEND}{EXT_LIBS}{$elem}{LIBS}});
+ push(@STATIC_LINK_FLAGS,@{$CTX->{DEPEND}{EXT_LIBS}{$elem}{LDFLAGS}});
+ push(@SHARED_LINK_LIST,@{$CTX->{DEPEND}{EXT_LIBS}{$elem}{LIBS}});
+ push(@SHARED_LINK_FLAGS,@{$CTX->{DEPEND}{EXT_LIBS}{$elem}{LDFLAGS}});
+ }
+
+ #
+ # set the lists
+ #
+ $CTX->{OUTPUT}{LIBRARIES}{$key}{NAME} = $NAME;
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{OBJ_LIST}} = @OBJ_LIST;
+ #
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{DEPEND_LIST}} = @DEPEND_LIST;
+
+ $CTX->{OUTPUT}{LIBRARIES}{$key}{STATIC_LIBRARY_NAME} = $STATIC_LIBRARY_NAME;
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{STATIC_LINK_LIST}} = @STATIC_LINK_LIST;
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{STATIC_LINK_FLAGS}} = @STATIC_LINK_FLAGS;
+
+ $CTX->{OUTPUT}{LIBRARIES}{$key}{SHARED_LIBRARY_NAME} = $SHARED_LIBRARY_NAME;
+ $CTX->{OUTPUT}{LIBRARIES}{$key}{SHARED_LIBRARY_REALNAME} = $SHARED_LIBRARY_REALNAME;
+ $CTX->{OUTPUT}{LIBRARIES}{$key}{SHARED_LIBRARY_SONAME} = $SHARED_LIBRARY_SONAME;
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{SHARED_LINK_LIST}} = @SHARED_LINK_LIST;
+ @{$CTX->{OUTPUT}{LIBRARIES}{$key}{SHARED_LINK_FLAGS}} = @SHARED_LINK_FLAGS;
+ }
+
return;
}