@@ -44,7 +44,6 @@ use strict;
44
44
my @exclude_cflags =
45
45
qw/ DDBUG_OFF DSAFE_MUTEX DFORCE_INIT_OF_VARS
46
46
DEXTRA_DEBUG DHAVE_purify O O[0-9] xO[0-9] W[-A-Za-z]*
47
- Xa xstrconst xc99=none
48
47
unroll2 ip mp restrict/ ;
49
48
50
49
my @exclude_libs = qw/ lmtmalloc static-libcxa i-static static-intel/ ;
@@ -205,11 +204,10 @@ $flags->{embedded_libs} =
205
204
206
205
$flags -> {include } = [" -I$pkgincludedir " ];
207
206
$flags -> {cflags } = [@{$flags -> {include }},split (" " ,' @CFLAGS@' )];
207
+ $flags -> {cxxflags }= [@{$flags -> {include }},split (" " ,' @CXXFLAGS@' )];
208
208
209
209
# ----------------------------------------------------------------------
210
210
# Remove some options that a client doesn't have to care about
211
- # FIXME until we have a --cxxflags, we need to remove -Xa
212
- # and -xstrconst to make --cflags usable for Sun Forte C++
213
211
# ----------------------------------------------------------------------
214
212
215
213
my $filter = join (" |" , @exclude_cflags );
@@ -219,6 +217,12 @@ foreach my $cflag ( @tmp )
219
217
{
220
218
push (@{$flags -> {cflags }}, $cflag ) unless $cflag =~ m / ^($filter )$ / o ;
221
219
}
220
+ @tmp = @{$flags -> {cxxflags }}; # Copy the flag list
221
+ $flags -> {cxxflags } = []; # Clear it
222
+ foreach my $cxxflag ( @tmp )
223
+ {
224
+ push (@{$flags -> {cxxflags }}, $cxxflag ) unless $cxxflag =~ m / ^($filter )$ / o ;
225
+ }
222
226
223
227
# Same for --libs(_r)
224
228
$filter = join (" |" , @exclude_libs );
@@ -234,6 +238,7 @@ foreach my $lib_type ( "libs","libs_r","embedded_libs" )
234
238
235
239
my $include = quote_options(@{$flags -> {include }});
236
240
my $cflags = quote_options(@{$flags -> {cflags }});
241
+ my $cxxflags = quote_options(@{$flags -> {cxxflags }});
237
242
my $libs = quote_options(@{$flags -> {libs }});
238
243
my $libs_r = quote_options(@{$flags -> {libs_r }});
239
244
my $embedded_libs = quote_options(@{$flags -> {embedded_libs }});
@@ -250,6 +255,7 @@ sub usage
250
255
Usage: $0 [OPTIONS]
251
256
Options:
252
257
--cflags [$cflags ]
258
+ --cxxflags [$cxxflags ]
253
259
--include [$include ]
254
260
--libs [$libs ]
255
261
--libs_r [$libs_r ]
271
277
272
278
GetOptions(
273
279
" cflags" => sub { print " $cflags \n " },
280
+ " cxxflags" => sub { print " $cxxflags \n " },
274
281
" include" => sub { print " $include \n " },
275
282
" libs" => sub { print " $libs \n " },
276
283
" libs_r" => sub { print " $libs_r \n " },
0 commit comments