diff options
-rw-r--r-- | source4/build/m4/public.m4 | 8 | ||||
-rwxr-xr-x | source4/script/cflags.pl | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index e8fbe4b286..d045cf42b7 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -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 diff --git a/source4/script/cflags.pl b/source4/script/cflags.pl index f083cefb39..37b5aa7e71 100755 --- a/source4/script/cflags.pl +++ b/source4/script/cflags.pl @@ -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 "; } } |