Re: Unquoting in _AC_PROG_FC_V_OUTPUT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 14 Jan 2004, Paul Eggert wrote:
> Ron McTaggart-Cowan <rmctc@xxxxxxxxxxxxxxxx> writes:
> > the Cray Fortran unquoting (removal of "-characters from the
> > command line string at line 555 of fortran.m4) used to
> > apply to all systems; it is now applied only for cft90 compilers -

When did it apply to all systems?  The first time quote removal appeared,
AFAIK, was in autoconf 2.50, with:

# If we are using Cray Fortran then delete quotes.
# Use "\"" instead of '"' for font-lock-mode.
# FIXME: a more general fix for quoted arguments with spaces?
if echo $ac_f77_v_output | grep cft90 >/dev/null 2>&1; then
  ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"`
fi[]dnl

> > I'm wondering if the best way to proceed is to add the PGf90
> > compilers to this case selection, or to continue to remove quote
> > characters from arguments in general?

Actually, I already noticed the same problem and patched the autoconf code
on my machine (see attached diff).  I don't think I submitted it yet
because I've lost cvs access since the Subversions outage.

As you'll notice in the patch, I put a FIXME comment to the effect that we
should really implement a more general fix for quoted arguments.
However, I'm not sure that simply removing quotes is the best idea...I've
been afraid that it will break something, which is why the current quote
removal is so conservative.  The right thing would be to treat quoted
strings as single arguments in the FLIBS processing, but I don't know a
simple way to do that.

Paul wrote:
> since \" has undefined behavior in a BRE (Basic Regular Expression).

Whoops, I didn't realize that; please patch.

Steven
--- /home/stevenj/downloads/autotools/autoconf-2.59/lib/autoconf/fortran.m4	Fri Oct 31 03:38:05 2003
+++ fortran.m4	Wed Nov 26 14:00:29 2003
@@ -538,6 +538,9 @@
 	grep 'LPATH is:' |
 	sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $ac_[]_AC_LANG_ABBREV[]_v_output"
 
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
 case $ac_[]_AC_LANG_ABBREV[]_v_output in
   # If we are using xlf then replace all the commas with spaces.
   *xlfentry*)
@@ -548,11 +551,16 @@
   *mGLOB_options_string*)
     ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/\"-mGLOB[[^\"]]*\"/ /g'` ;;
 
+  # Portland Group compiler has quoted -cmdline argument
+  *-cmdline*)
+    ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/-cmdline  *\"[[^\"]]*\"/ /g'` ;;
+
   # If we are using Cray Fortran then delete quotes.
   # Use "\"" instead of '"' for font-lock-mode.
   # FIXME: a more general fix for quoted arguments with spaces?
   *cft90*)
     ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed "s/\"//g"` ;;
+
 esac
 
 ])# _AC_PROG_FC_V_OUTPUT

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux