From a5e3abd897e4e682aa72786a92435f7a5d95ea6f Mon Sep 17 00:00:00 2001 From: Thomas Jahns Date: Thu, 30 Aug 2012 12:26:50 +0200 Subject: [PATCH] Fix handling of -Wl,-Wl,, argument prefix of NAG fortran compiler. --- build-aux/ltmain.m4sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 1d71f0e..910094b 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -5041,20 +5041,26 @@ func_mode_link () ;; -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do + wlprefix=`expr length "$wl"` + wlprefix=`expr substr "$arg" 1 $wlprefix` + if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl," ; then + : + else + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + fi ;; -Xcompiler) -- 1.7.10