diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-04-15 09:54:41 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-04-15 09:54:41 +0200 |
commit | b967afca648eea481e586f367f99464418cf8468 (patch) | |
tree | 3fbe9cc92a21013cbd1eb2b6fa1b73ccddfbb151 /source4/build/smb_build/makefile.pm | |
parent | 9cd04363f56ba5ee4f8b1ffaf662fe81cc995e99 (diff) | |
parent | afaba23131dc079be3cd92e87495ec8b2ebdc4ae (diff) | |
download | samba-b967afca648eea481e586f367f99464418cf8468.tar.gz samba-b967afca648eea481e586f367f99464418cf8468.tar.bz2 samba-b967afca648eea481e586f367f99464418cf8468.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit e891157b4ec7b2f845fb20c4106d80bf169f2072)
Diffstat (limited to 'source4/build/smb_build/makefile.pm')
-rw-r--r-- | source4/build/smb_build/makefile.pm | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 2470fa1459..8f3f1701b7 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -23,12 +23,11 @@ sub new($$$) $self->{output} = ""; - $self->{mkfile} = $mkfile; - $self->output("################################################\n"); $self->output("# Autogenerated by build/smb_build/makefile.pm #\n"); $self->output("################################################\n"); $self->output("\n"); + $self->output($mkfile); return $self; } @@ -203,12 +202,17 @@ __EOD__ $self->output("\n"); } -sub SharedLibraryPrimitives($$) +sub StaticLibraryPrimitives($$) { my ($self,$ctx) = @_; + + $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); + $self->_prepare_list($ctx, "FULL_OBJ_LIST"); +} - $self->output("$ctx->{NAME}_SOVERSION = $ctx->{SO_VERSION}\n") if (defined($ctx->{SO_VERSION})); - $self->output("$ctx->{NAME}_VERSION = $ctx->{VERSION}\n") if (defined($ctx->{VERSION})); +sub SharedLibraryPrimitives($$) +{ + my ($self,$ctx) = @_; if (not grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}})) { $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); @@ -224,7 +228,7 @@ sub SharedLibrary($$) $ctx->{LIBRARY_SONAME} = ""; } - $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n") if (defined($ctx->{SO_VERSION})); + $self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); @@ -240,7 +244,9 @@ $ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL __EOD__ ); if ($ctx->{LIBRARY_REALNAME} ne $ctx->{LIBRARY_SONAME}) { - $self->output("\t\@test \$($ctx->{NAME}_VERSION) = \$($ctx->{NAME}_SOVERSION) || ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}\n"); + $self->output("ifneq (\$($ctx->{NAME}_VERSION),\$($ctx->{NAME}_SOVERSION))\n"); + $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}\n"); + $self->output("endif\n"); } $self->output("ifdef $ctx->{NAME}_SOVERSION\n"); $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}\n"); @@ -256,10 +262,10 @@ sub MergedObj($$) $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->output(<< "__EOD__" # -$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_LIST) +$ctx->{RESULT_MERGED_OBJ}: \$($ctx->{NAME}_OBJ_FILES) \@echo Partially linking \$@ \@mkdir -p \$(\@D) - \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_LIST) + \$(PARTLINK) -o \$@ \$($ctx->{NAME}_OBJ_FILES) __EOD__ ); @@ -269,13 +275,8 @@ sub StaticLibrary($$) { 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, "FULL_OBJ_LIST"); - $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); } @@ -324,7 +325,7 @@ sub PythonFiles($$) foreach (@{$ctx->{PYTHON_FILES}}) { my $target = "bin/python/".basename($_); - my $source = output::add_dir_str($ctx->{BASEDIR}, $_); + my $source = "\$(addprefix $ctx->{BASEDIR}/, $_)"; $self->output("$target: $source\n\n"); $self->output("PYTHON_PYS += $target\n"); } @@ -334,13 +335,13 @@ sub ProtoHeader($$) { my ($self,$ctx) = @_; - my $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER}); + my $priv = "$ctx->{BASEDIR}/$ctx->{PRIVATE_PROTO_HEADER}"; $self->output("PROTO_HEADERS += $priv\n"); - $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n"); + $self->output("$priv: $ctx->{MK_FILE} \$($ctx->{NAME}_OBJ_FILES:.o=.c) \$(srcdir)/script/mkproto.pl\n"); $self->output("\t\@echo \"Creating \$@\"\n"); $self->output("\t\@mkdir -p \$(\@D)\n"); - $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --public=/dev/null --private=\$@ \$($ctx->{NAME}_OBJ_LIST)\n\n"); + $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --public=/dev/null --private=\$@ \$($ctx->{NAME}_OBJ_FILES)\n\n"); } sub write($$) @@ -378,7 +379,6 @@ sub CFlags($$) my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; - return unless defined ($key->{OBJ_LIST}); return unless defined ($key->{FINAL_CFLAGS}); return unless (@{$key->{FINAL_CFLAGS}} > 0); @@ -392,19 +392,19 @@ sub CFlags($$) my @cflags = (); foreach my $flag (@sorted_cflags) { if($src_ne_build) { - if($flag =~ m#^-I([^/].*$)#) { - my $dir = $1; - $dir =~ s#^\$\((?:src|build)dir\)/?##; + if($flag =~ m#^-I([^/].*$)#) { + my $dir = $1; + $dir =~ s#^\$\((?:src|build)dir\)/?##; push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); - next; - } + next; + } } push(@cflags, $flag); } my $cflags = join(' ', @cflags); - $self->output("\$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_LIST:.o=.d)) \$($key->{NAME}_OBJ_LIST): CFLAGS+= $cflags\n"); + $self->output("\$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_FILES:.o=.d)) \$($key->{NAME}_OBJ_FILES): CFLAGS+= $cflags\n"); } 1; |