From: Alexandre Oliva Date: Sat, 18 Dec 1999 07:50:04 +0000 (+0000) Subject: * ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and X-Git-Tag: release-1-3d~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30880b90950d26d14c0ca498ca28af008a70055a;p=thirdparty%2Flibtool.git * ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and finalize_command. (-Wc, -Wl): Likewise. * tests/quote.test: Adjust quoting style of -Wl. --- diff --git a/ChangeLog b/ChangeLog index 53e13cd06..4d9f898e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 1999-12-18 Alexandre Oliva + * ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and + finalize_command. + (-Wc, -Wl): Likewise. + * tests/quote.test: Adjust quoting style of -Wl. + * ltmain.in: Oops, `echo' -> `$echo'. * ltmain.in (-Wl, -Wc): Make commas argument separators, just like diff --git a/ltmain.in b/ltmain.in index 234519661..fcb8b7020 100644 --- a/ltmain.in +++ b/ltmain.in @@ -729,7 +729,7 @@ compiler." arg="$1" shift case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; @@ -828,26 +828,18 @@ compiler." continue ;; xcompiler) - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - compiler_flags="$compiler_flags $arg" + compiler_flags="$compiler_flags $qarg" prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" continue ;; xlinker) - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - linker_flags="$linker_flags $arg" - compiler_flags="$compiler_flags $wl$arg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" continue ;; *) @@ -1045,36 +1037,40 @@ compiler." ;; -Wc,*) - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $arg; do + for flag in $args; do IFS="$save_ifs" case "$flag" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac + arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" - continue + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $arg; do + for flag in $args; do IFS="$save_ifs" case "$flag" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac + arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" - continue + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) @@ -1093,7 +1089,7 @@ compiler." # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac @@ -1216,7 +1212,7 @@ compiler." # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac diff --git a/tests/quote.test b/tests/quote.test index f671f82b7..f71ecda03 100755 --- a/tests/quote.test +++ b/tests/quote.test @@ -63,18 +63,21 @@ for mode in compile link install; do case "$mode" in compile) preargs="gcc -c" + preflag= flag="-DVAR=" postargs="foo.c" ;; link) preargs="gcc -o hell -g -O" - flag="-Wl,-someflag=" + preflag=-Wl, + flag="-someflag=" postargs="foo.o" ;; install) preargs="install -c" + preflag= flag="--something=" postargs="hell /usr/local/bin/hell" ;; @@ -82,9 +85,9 @@ for mode in compile link install; do # Trivial. $echo "= trying: no quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}test" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=1 case "$result" in - *"$preargs ${flag}test "*) + *"$preargs ${preflag}${flag}test "*) $echo "= passed: $result" ;; *) @@ -96,9 +99,9 @@ for mode in compile link install; do # Metacharacters that should be backslashified. for mchar in \\ \" \` \$; do $echo "= trying: \\$mchar quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 case "$result" in - *"$preargs ${flag}\\${mchar}test\\${mchar} "*) + *"$preargs ${preflag}${flag}\\${mchar}test\\${mchar} "*) $echo "= passed: $result" ;; *) @@ -113,9 +116,9 @@ for mode in compile link install; do "'" " " " "; do $echo "= trying: \"$mchar\" quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 case "$result" in - *"$preargs \"${flag}${mchar}test${mchar}\" "*) + *"$preargs ${preflag}\"${flag}${mchar}test${mchar}\" "*) $echo "= passed: $result" ;; *)