1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

Use make variables in cflags file (now supported by cflags.pl)

(This used to be commit d746fcde1006b4b7b33aa65bef9d2fea3ebc9162)
This commit is contained in:
Jelmer Vernooij 2008-02-11 19:28:59 +01:00
parent 6c7a400945
commit a3052e79f4
2 changed files with 11 additions and 7 deletions

View File

@ -33,7 +33,7 @@ SMB_INFO_SUBSYSTEMS="$SMB_INFO_SUBSYSTEMS
@<:@SUBSYSTEM::$1@:>@
OBJ_FILES = \$($1_OBJ_FILES)
PRIVATE_DEPENDENCIES = $3
CFLAGS = $4
CFLAGS = \$($1_CFLAGS)
ENABLE = YES
# End Subsystem $1
###################################
@ -58,7 +58,7 @@ OBJ_FILES = \$($1_OBJ_FILES)
PRIVATE_DEPENDENCIES = $3
VERSION = $4
SO_VERSION = $5
CFLAGS = $6
CFLAGS = \$($1_CFLAGS)
LDFLAGS = \$($1_LDFLAGS)
PC_NAME = $8
ENABLE = YES
@ -152,8 +152,8 @@ SMB_INFO_EXT_LIBS="$SMB_INFO_EXT_LIBS
# Start Ext Lib $1
@<:@EXT_LIB::$1@:>@
LIBS = \$($1_LIBS)
CFLAGS = $3
CPPFLAGS = $4
CFLAGS = \$($1_CFLAGS)
CPPFLAGS = \$($1_CPPFLAGS)
LDFLAGS = \$($1_LDFLAGS)
PC_NAME = $6
# End Ext Lib $1

View File

@ -10,6 +10,7 @@ my $target = shift;
my $vars = {};
sub check_flags($$);
sub check_flags($$)
{
my ($path, $name)=@_;
@ -17,15 +18,18 @@ sub check_flags($$)
foreach my $line (<IN>) {
if ($line =~ /^include (.*)$/) {
check_flags($1, $name);
} elsif ($line =~ /^([A-Za-z0-9_]+) = (.*)$/) {
} elsif ($line =~ /^([A-Za-z0-9_]+) =(.*)$/) {
$vars->{$1} = $2;
} elsif ($line =~ /^([^:]+): (.*)$/) {
next unless (grep(/^$target$/, (split / /, $1)));
my $data = $2;
$data =~ s/^CFLAGS\+=//;
foreach (keys %$vars) {
$data =~ s/\$($_)/$vars->{$_}/g;
foreach my $key (keys %$vars) {
my $val = $vars->{$key};
$data =~ s/\$\($key\)/$val/g;
}
# Remove undefined variables
$data =~ s/\$\([A-Za-z0-9_]+\)//g;
print "$data ";
}
}