Don't generate empty arguments when parsing CFLAGS/CXXFLAGS/LDFLAGS

PR:		236730
Submitted by:	pkubaj@anongoth.pl
This commit is contained in:
Dmitry Marakasov 2019-03-28 16:08:52 +00:00
parent 68a0d94c1a
commit ba9d6b0363
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=497026

View File

@ -17,7 +17,7 @@
+ push(@args,$isCpp ? $ENV{'CXX'} : $ENV{'CC'});
if (HaveDebug) { push(@args,"-g"); }
- push(@args,"-O2");
+ push(@args,split(/\s+/, $isCpp ? $ENV{'CXXFLAGS'} : $ENV{'CFLAGS'}));
+ push(@args,grep /./, split(/\s+/, $isCpp ? $ENV{'CXXFLAGS'} : $ENV{'CFLAGS'}));
if ($isCpp && $GccVersion>=4.7 && $GccVersion<6.1) {
push(@args,"-std=c++11");
}
@ -27,7 +27,7 @@
else {
- push(@args,"gcc");
+ push(@args,$ENV{'CC'});
+ push(@args,split(/\s+/, $ENV{'LDFLAGS'}));
+ push(@args,grep /./, split(/\s+/, $ENV{'LDFLAGS'}));
if (HaveDebug) { push(@args,"-g"); }
if ($type eq 'dynlib') {
push(@args,$IsDarwin ? "-dynamiclib" : "-shared");