The following construction works (e.g. in bash, ash, IRIX sh, AIX sh,
UNICOS sh):

ac_link_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`

Apparently "eval" operates in some sort of sub-shell that doesn't see the
reassignments from "exec"?  That's the only explanation I could think
of...the documentation I could find wasn't  very explicit on what happens.

Can Paul verify that it works with the Absoft compiler?

(The new version is also cleaner, since it avoids the execs entirely.)

Steven

2000-06-08  Steven G. Johnson  <[EMAIL PROTECTED]>

        * aclang.m4 (AC_F77_LIBRARY_LDFLAGS): Fixed bug where
        compiler output to stdout was not caught and interpreted.

===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.32
diff -u -r1.32 aclang.m4
--- aclang.m4   2000/06/08 08:23:30     1.32
+++ aclang.m4   2000/06/08 17:57:31
@@ -1334,24 +1334,14 @@
       end
 EOF

-# Save the "compiler output file descriptor" to FD 8.
-exec 8>&AC_FD_LOG
-
-# Temporarily redirect compiler output to stdout, since this is what
-# we want to capture in AC_LINK_OUTPUT.
-exec AC_FD_LOG>&1
-
 # Compile and link our simple test program by passing the "-v" flag
 # to the Fortran 77 compiler in order to get "verbose" output that
 # we can then parse for the Fortran 77 linker flags.  I don't know
 # what to do if your compiler doesn't have -v.
 ac_save_FFLAGS=$FFLAGS
 FFLAGS="$FFLAGS -v"
-ac_link_output=`eval $ac_link 2>&1 | grep -v 'Driving:'`
+ac_link_output=`eval $ac_link AC_FD_LOG>&1 2>&1 | grep -v 'Driving:'`
 FFLAGS=$ac_save_FFLAGS
-
-# Restore the "compiler output file descriptor".
-exec AC_FD_LOG>&8

 rm -f conftest.*



Reply via email to