diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-29 15:28:26 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-29 15:28:26 +0100 |
commit | 80e9b72e018fb7d7f2cd5ff383e4a533b4ccc705 (patch) | |
tree | cf27bfc64ee5a9c7b186ceed790615bc03685013 /source4/build | |
parent | 9be199944d29d8f3c8e25ad96c02c824d2853b54 (diff) | |
download | samba-80e9b72e018fb7d7f2cd5ff383e4a533b4ccc705.tar.gz samba-80e9b72e018fb7d7f2cd5ff383e4a533b4ccc705.tar.bz2 samba-80e9b72e018fb7d7f2cd5ff383e4a533b4ccc705.zip |
Remove duplicate functions.
(This used to be commit d6b2eaeff970f84b6e4da430ea6d00009931d41d)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/smb_build/makefile.pm | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index b223f53bb2..9aa4e409bd 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -56,29 +56,6 @@ sub _set_config($$) } } -sub _set_config($$) -{ - my ($self, $config) = @_; - - $self->{config} = $config; - - if (not defined($self->{config}->{srcdir})) { - $self->{config}->{srcdir} = '.'; - } - - if (not defined($self->{config}->{builddir})) { - $self->{config}->{builddir} = '.'; - } - - if ($self->{config}->{prefix} eq "NONE") { - $self->{config}->{prefix} = $self->{config}->{ac_default_prefix}; - } - - if ($self->{config}->{exec_prefix} eq "NONE") { - $self->{config}->{exec_prefix} = $self->{config}->{prefix}; - } -} - sub output($$) { my ($self, $text) = @_; @@ -377,57 +354,4 @@ sub CFlags($$) $self->output("\$($key->{NAME}_OBJ_LIST) \$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_LIST:.o=.d)): CFLAGS+=$cflags\n"); } -my $sort_available = eval "use sort 'stable'; return 1;"; -$sort_available = 0 unless defined($sort_available); - -sub by_path { - return 1 if($a =~ m#^\-I/#); - return -1 if($b =~ m#^\-I/#); - return 0; -} - -sub CFlags($$) -{ - my ($self, $key) = @_; - - my $srcdir = $self->{config}->{srcdir}; - my $builddir = $self->{config}->{builddir}; - - 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); - - my @sorted_cflags = @{$key->{FINAL_CFLAGS}}; - if ($sort_available) { - @sorted_cflags = sort by_path @{$key->{FINAL_CFLAGS}}; - } - - # Rewrite CFLAGS so that both the source and the build - # directories are in the path. - my @cflags = (); - foreach my $flag (@sorted_cflags) { - if($src_ne_build) { - if($flag =~ m#^-I([^/].*$)#) { - my $dir = $1; - $dir =~ s#^\$\((?:src|build)dir\)/?##; - push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); - next; - } - } - push(@cflags, $flag); - } - - my $cflags = join(' ', @cflags); - - foreach (@{$key->{OBJ_LIST}}) { - my $ofile = $_; - my $dfile = $_; - $dfile =~ s/\.o$/.d/; - $dfile =~ s/\.ho$/.d/; - $self->output("$ofile $dfile: CFLAGS+= $cflags\n"); - } -} - 1; |