@@ -5133,6 +5133,7 @@ $as_echo_n "checking if compile and link flags for Perl are sane... " >&6; }
51335133 ldflags_save=$LDFLAGS
51345134 CFLAGS=" $CFLAGS $perlcppflags "
51355135 LIBS=" $LIBS $perllibs "
5136+ perlldflags=` echo " $perlldflags " | sed -e ' s/^ *//g' `
51365137 LDFLAGS=" $perlldflags $LDFLAGS "
51375138 cat confdefs.h - << _ACEOF >conftest.$ac_ext
51385139/* end confdefs.h. */
@@ -5162,7 +5163,9 @@ rm -f core conftest.err conftest.$ac_objext \
51625163 PERL_CFLAGS=` echo " $perlcppflags " | sed -e ' s/-pipe //' -e ' s/-W[^ ]*//' `
51635164 fi
51645165 if test " X$perlldflags " ! = " X" ; then
5165- LDFLAGS=" $perlldflags $LDFLAGS "
5166+ if test " X` echo \" $LDFLAGS \" | grep -F -e \" $perlldflags \" ` " = " X" ; then
5167+ LDFLAGS=" $perlldflags $LDFLAGS "
5168+ fi
51665169 fi
51675170 PERL_LIBS=$perllibs
51685171 PERL_SRC=" auto/if_perl.c if_perlsfio.c"
@@ -6454,7 +6457,9 @@ $as_echo "$rubyhdrdir" >&6; }
64546457 if test " X$rubyldflags " ! = " X" ; then
64556458 rubyldflags=` echo " $rubyldflags " | sed -e ' s/-arch\ ppc//' -e ' s/-arch\ i386//' -e ' s/-arch\ x86_64//' `
64566459 if test " X$rubyldflags " ! = " X" ; then
6457- LDFLAGS=" $rubyldflags $LDFLAGS "
6460+ if test " X` echo \" $LDFLAGS \" | grep -F -e \" $rubyldflags \" ` " = " X" ; then
6461+ LDFLAGS=" $rubyldflags $LDFLAGS "
6462+ fi
64586463 fi
64596464 fi
64606465 RUBY_SRC=" if_ruby.c"
@@ -12690,7 +12695,7 @@ $as_echo "no" >&6; }
1269012695 { $as_echo " $as_me :${as_lineno-$LINENO } : checking whether we need -D_FORTIFY_SOURCE=1" >&5
1269112696$as_echo_n " checking whether we need -D_FORTIFY_SOURCE=1... " >&6 ; }
1269212697 if test " $gccmajor " -gt " 3" ; then
12693- CFLAGS=` echo " $CFLAGS " | sed -e ' s/-Wp,-D_FORTIFY_SOURCE=.//g' -e ' s/-D_FORTIFY_SOURCE=.//g' -e ' s/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/' `
12698+ CFLAGS=` echo " $CFLAGS " | sed -e ' s/ * -Wp,-D_FORTIFY_SOURCE=.//g' -e ' s/ * -D_FORTIFY_SOURCE=.//g ' -e ' s/ *-U_FORTIFY_SOURCE //g' -e ' s/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/' `
1269412699 { $as_echo " $as_me :${as_lineno-$LINENO } : result: yes" >&5
1269512700$as_echo " yes" >&6 ; }
1269612701 else
@@ -12705,7 +12710,7 @@ $as_echo_n "checking linker --as-needed support... " >&6; }
1270512710LINK_AS_NEEDED=
1270612711# Check if linker supports --as-needed and --no-as-needed options
1270712712if $CC -Wl,--help 2> /dev/null | grep as-needed > /dev/null; then
12708- LDFLAGS=" $LDFLAGS - Wl,--as-needed"
12713+ LDFLAGS=` echo " $LDFLAGS " | sed -e ' s/ *- Wl,--as-needed//g ' | sed -e ' s/$/ -Wl,--as-needed/ ' `
1270912714 LINK_AS_NEEDED=yes
1271012715fi
1271112716if test " $LINK_AS_NEEDED " = yes; then
0 commit comments