mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
r22031: Make sure we rewrite the include directives in CFLAGS to contain
paths from builddir and srcdir. builddir has precedence.
(This used to be commit af87c22ecf
)
This commit is contained in:
parent
7dc8e67f81
commit
3e0f5d7070
@ -6,9 +6,12 @@
|
||||
package cflags;
|
||||
use strict;
|
||||
|
||||
sub create_cflags($$)
|
||||
sub create_cflags($$$$)
|
||||
{
|
||||
my ($CTX, $file) = @_;
|
||||
my $CTX = shift;
|
||||
my $srcdir = shift;
|
||||
my $builddir = shift;
|
||||
my $file = shift;
|
||||
|
||||
open(CFLAGS_TXT,">$file") || die ("Can't open `$file'\n");
|
||||
|
||||
@ -18,7 +21,18 @@ sub create_cflags($$)
|
||||
next unless defined ($key->{FINAL_CFLAGS});
|
||||
next unless ($#{$key->{FINAL_CFLAGS}} >= 0);
|
||||
|
||||
my $cflags = join(' ', @{$key->{FINAL_CFLAGS}});
|
||||
# Rewrite CFLAGS so that both the source and the build
|
||||
# directories are in the path.
|
||||
my $cflags = "";
|
||||
foreach my $flag (@{$key->{FINAL_CFLAGS}}) {
|
||||
my $dir;
|
||||
if (($dir) = ($flag =~ /^-I([^\/].*)$/)) {
|
||||
$cflags .= " -I$builddir/$dir";
|
||||
$cflags .= " -I$srcdir/$dir";
|
||||
} else {
|
||||
$cflags .= " $flag";
|
||||
}
|
||||
}
|
||||
|
||||
foreach (@{$key->{OBJ_LIST}}) {
|
||||
my $ofile = $_;
|
||||
|
@ -71,7 +71,9 @@ foreach my $key (values %$OUTPUT) {
|
||||
$mkenv->write("Makefile");
|
||||
header::create_smb_build_h($OUTPUT, "include/build.h");
|
||||
|
||||
cflags::create_cflags($OUTPUT, "extra_cflags.txt");
|
||||
cflags::create_cflags($OUTPUT, $config::config{srcdir},
|
||||
$config::config{builddir}, "extra_cflags.txt");
|
||||
|
||||
|
||||
summary::show($OUTPUT, \%config::config);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user