diff options
Diffstat (limited to 'ltmain.sh')
-rw-r--r-- | ltmain.sh | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/ltmain.sh b/ltmain.sh index 90925cb2f6d..5925eebba57 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -495,11 +495,34 @@ if test -z "$show_help"; then # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then + # APPLE LOCAL begin handle ~ in pathnames 2002-01-14 --sts + # Since CC may have args with shell metachars in them, add + # doublequotes to args so it looks the same as $base_compile. + qCC= + for argu in $CC; do + case $argu in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + argu="\"$argu\"" + ;; + esac + # Add the previous argument to qCC. + if test -z "$qCC"; then + qCC="$argu" + else + qCC="$qCC $argu" + fi + done + # APPLE LOCAL end handle ~ in pathnames 2002-01-14 --sts case $base_compile in - "$CC "*) ;; + # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts + "$qCC "*) ;; # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when ltconfig was run. - "`$echo $CC` "*) ;; + # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts + "`$echo $qCC` "*) ;; *) for z in $available_tags; do if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then @@ -4923,7 +4946,8 @@ relink_command=\"$relink_command\"" # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts + IFS="${IFS= }"; save_ifs="$IFS"; IFS='@' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" |