From: Alexandre Oliva Date: Sat, 18 Dec 1999 08:22:50 +0000 (+0000) Subject: * ltmain.in (-Wc, -Xcompiler): Implemented in compile mode. X-Git-Tag: release-1-3d~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e99410754a3923ac513f770e8523adde0e547557;p=thirdparty%2Flibtool.git * ltmain.in (-Wc, -Xcompiler): Implemented in compile mode. --- diff --git a/ChangeLog b/ChangeLog index 4d9f898e5..bc796cfe7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ 1999-12-18 Alexandre Oliva + * ltmain.in (-Wc, -Xcompiler): Implemented in compile mode. + * 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'. diff --git a/ltmain.in b/ltmain.in index fcb8b7020..f18d74129 100644 --- a/ltmain.in +++ b/ltmain.in @@ -267,6 +267,7 @@ if test -z "$show_help"; then modename="$modename: compile" # Get the compilation command and the source file. base_compile= + prev= lastarg= srcfile="$nonopt" suppress_output= @@ -274,6 +275,32 @@ if test -z "$show_help"; then user_target=no for arg do + case "$prev" in + "") ;; + xcompiler) + # Aesthetically quote the previous argument. + prev= + lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + + case "$arg" in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + # Accept any command-line options. case "$arg" in -o) @@ -288,6 +315,40 @@ if test -z "$show_help"; then build_old_libs=yes continue ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; esac case "$user_target" in @@ -316,11 +377,11 @@ if test -z "$show_help"; then lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - lastarg="\"$lastarg\"" + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$largarg\"" ;; esac