root/mpich2/branches/dev/kumudb/confdb/aclocal_f77.m4 @ 4870

Revision 4870, 54.3 KB (checked in by kumudb, 5 months ago)

Merge from trunk to kumudb r4748:r4869

Line 
1dnl
2dnl/*D
3dnl PAC_PROG_F77_NAME_MANGLE - Determine how the Fortran compiler mangles
4dnl names
5dnl
6dnl Synopsis:
7dnl PAC_PROG_F77_NAME_MANGLE([action])
8dnl
9dnl Output Effect:
10dnl If no action is specified, one of the following names is defined:
11dnl.vb
12dnl If fortran names are mapped:
13dnl   lower -> lower                  F77_NAME_LOWER
14dnl   lower -> lower_                 F77_NAME_LOWER_USCORE
15dnl   lower -> UPPER                  F77_NAME_UPPER
16dnl   lower_lower -> lower__          F77_NAME_LOWER_2USCORE
17dnl   mixed -> mixed                  F77_NAME_MIXED
18dnl   mixed -> mixed_                 F77_NAME_MIXED_USCORE
19dnl   mixed -> UPPER@STACK_SIZE       F77_NAME_UPPER_STDCALL
20dnl.ve
21dnl If an action is specified, it is executed instead.
22dnl
23dnl Notes:
24dnl We assume that if lower -> lower (any underscore), upper -> upper with the
25dnl same underscore behavior.  Previous versions did this by
26dnl compiling a Fortran program and running strings -a over it.  Depending on
27dnl strings is a bad idea, so instead we try compiling and linking with a
28dnl C program, since that is why we are doing this anyway.  A similar approach
29dnl is used by FFTW, though without some of the cases we check (specifically,
30dnl mixed name mangling).  STD_CALL not only specifies a particular name
31dnl mangling convention (adding the size of the calling stack into the function
32dnl name, but also the stack management convention (callee cleans the stack,
33dnl and arguments are pushed onto the stack from right to left)
34dnl
35dnl One additional problem is that some Fortran implementations include
36dnl references to the runtime (like pgf90_compiled for the pgf90 compiler
37dnl used as the "Fortran 77" compiler).  This is not yet solved.
38dnl
39dnl D*/
40dnl
41AC_DEFUN([PAC_PROG_F77_NAME_MANGLE],[
42AC_CACHE_CHECK([for Fortran 77 name mangling],
43pac_cv_prog_f77_name_mangle,
44[
45   # Check for strange behavior of Fortran.  For example, some FreeBSD
46   # systems use f2c to implement f77, and the version of f2c that they
47   # use generates TWO (!!!) trailing underscores
48   # Currently, WDEF is not used but could be...
49   #
50   # Eventually, we want to be able to override the choices here and
51   # force a particular form.  This is particularly useful in systems
52   # where a Fortran compiler option is used to force a particular
53   # external name format (rs6000 xlf, for example).
54   # This is needed for Mac OSX 10.5
55   rm -rf conftest.dSYM
56   rm -f conftest*
57   cat > conftest.f <<EOF
58       subroutine MY_name( i )
59       return
60       end
61EOF
62   # This is the ac_compile line used if LANG_FORTRAN77 is selected
63   if test "X$ac_fcompile" = "X" ; then
64       ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC'
65   fi
66   if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then
67        mv conftest.o fconftestf.o
68   else
69        echo "configure: failed program was:" >&AC_FD_CC
70        cat conftest.f >&AC_FD_CC
71   fi
72
73   AC_LANG_SAVE
74   AC_LANG_C   
75   save_LIBS="$LIBS"
76   dnl FLIBS comes from AC_F77_LIBRARY_LDFLAGS
77   LIBS="fconftestf.o $FLIBS $LIBS"
78   AC_TRY_LINK([extern void my_name(int);],my_name(0);,pac_cv_prog_f77_name_mangle="lower")
79   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
80     AC_TRY_LINK([extern void my_name_(int);],my_name_(0);,pac_cv_prog_f77_name_mangle="lower underscore")
81   fi
82   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
83     AC_TRY_LINK([void __stdcall MY_NAME(int);],MY_NAME(0);,pac_cv_prog_f77_name_mangle="upper stdcall")
84   fi
85   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
86     AC_TRY_LINK([extern void MY_NAME(int);],MY_NAME(0);,pac_cv_prog_f77_name_mangle="upper")
87   fi
88   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
89     AC_TRY_LINK([extern void my_name__(int);],my_name__(0);,
90       pac_cv_prog_f77_name_mangle="lower doubleunderscore")
91   fi
92   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
93     AC_TRY_LINK([extern void MY_name(int);],MY_name(0);,pac_cv_prog_f77_name_mangle="mixed")
94   fi
95   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
96     AC_TRY_LINK([extern void MY_name_(int);],MY_name_(0);,pac_cv_prog_f77_name_mangle="mixed underscore")
97   fi
98   LIBS="$save_LIBS"
99   AC_LANG_RESTORE
100   # If we got to this point, it may be that the programs have to be
101   # linked with the Fortran, not the C, compiler.  Try reversing
102   # the language used for the test
103   dnl Note that the definition of AC_TRY_LINK and AC_LANG_PROGRAM
104   dnl is broken in autoconf and will generate spurious warning messages
105   dnl To fix this, we use
106   dnl AC _LINK_IFELSE([AC _LANG_PROGRAM(,[[body]])],action-if-true)
107   dnl instead of AC _TRY_LINK(,body,action-if-true)
108   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
109       AC_LANG_SAVE
110       AC_LANG_FORTRAN77
111       save_LIBS="$LIBS"
112       LIBS="conftestc.o $LIBS"
113       if test "X$ac_ccompile" = "X" ; then
114           ac_ccompile='${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC'
115       fi
116       # This is needed for Mac OSX 10.5
117       rm -rf conftest.dSYM
118       rm -f conftest*
119       cat > conftest.c <<EOF
120       void my_name( int a ) { }
121EOF
122       if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
123            mv conftest.o conftestc.o
124       else
125            echo "configure: failed program was:" >&AC_FD_CC
126            cat conftest.c >&AC_FD_CC
127       fi
128
129       AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call my_name(0)]])],
130           pac_cv_prog_f77_name_mangle="lower")
131
132       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
133           # This is needed for Mac OSX 10.5
134           rm -rf conftest.dSYM
135           rm -f conftest*
136           cat > conftest.c <<EOF
137 void my_name_(int a) { }
138EOF
139           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
140                mv conftest.o conftestc.o
141           else
142                echo "configure: failed program was:" >&AC_FD_CC
143                cat conftest.c >&AC_FD_CC
144           fi
145           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call my_name(0)]])],
146                 pac_cv_prog_f77_name_mangle="lower underscore")
147       fi
148       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
149          # This is needed for Mac OSX 10.5
150          rm -rf conftest.dSYM
151          rm -f conftest*
152          cat >conftest.c <<EOF
153          void __stdcall MY_NAME(int a) {}
154EOF
155           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
156                mv conftest.o conftestc.o
157           else
158                echo "configure: failed program was:" >&AC_FD_CC
159                cat conftest.c >&AC_FD_CC
160           fi
161           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call my_name(0)]])],
162                 pac_cv_prog_f77_name_mangle="upper stdcall")
163       fi
164       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
165          # This is needed for Mac OSX 10.5
166          rm -rf conftest.dSYM
167          rm -f conftest*
168          cat >conftest.c <<EOF
169          void MY_NAME(int a) {}
170EOF
171           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
172                mv conftest.o conftestc.o
173           else
174                echo "configure: failed program was:" >&AC_FD_CC
175                cat conftest.c >&AC_FD_CC
176           fi
177           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call MY_NAME(0)]])],
178                pac_cv_prog_f77_name_mangle="upper")
179       fi
180       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
181          # This is needed for Mac OSX 10.5
182          rm -rf conftest.dSYM
183          rm -f conftest*
184          cat >conftest.c <<EOF
185          void my_name__(int a) {}
186EOF
187           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
188                mv conftest.o conftestc.o
189           else
190                echo "configure: failed program was:" >&AC_FD_CC
191                cat conftest.c >&AC_FD_CC
192           fi
193           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call my_name(0)]])],
194               pac_cv_prog_f77_name_mangle="lower doubleunderscore")
195       fi
196       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
197          # This is needed for Mac OSX 10.5
198          rm -rf conftest.dSYM
199          rm -f conftest*
200          cat >conftest.c <<EOF
201          void MY_name(int a) {}
202EOF
203           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
204                mv conftest.o conftestc.o
205           else
206                echo "configure: failed program was:" >&AC_FD_CC
207                cat conftest.c >&AC_FD_CC
208           fi
209           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call MY_name(0)]])],
210                pac_cv_prog_f77_name_mangle="mixed")
211       fi
212       if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
213          # This is needed for Mac OSX 10.5
214          rm -rf conftest.dSYM
215          rm -f conftest*
216          cat >conftest.c <<EOF
217          void MY_name_(int a) {}
218EOF
219           if AC_TRY_EVAL(ac_ccompile) && test -s conftest.o ; then
220                mv conftest.o conftestc.o
221           else
222                echo "configure: failed program was:" >&AC_FD_CC
223                cat conftest.c >&AC_FD_CC
224           fi
225           AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[        call MY_name(0)]])],
226                   pac_cv_prog_f77_name_mangle="mixed underscore")
227       fi
228       LIBS="$save_LIBS"
229       AC_LANG_RESTORE
230   fi
231   # This is needed for Mac OSX 10.5
232   rm -rf conftest.dSYM
233   rm -f fconftest*
234])
235# Make the actual definition
236pac_namecheck=`echo X$pac_cv_prog_f77_name_mangle | sed 's/ /-/g'`
237ifelse([$1],,[
238pac_cv_test_stdcall=""
239case $pac_namecheck in
240    X) AC_MSG_WARN([Cannot determine Fortran naming scheme]) ;;
241    Xlower) AC_DEFINE(F77_NAME_LOWER,1,[Define if Fortran names are lowercase])
242        F77_NAME_MANGLE="F77_NAME_LOWER"
243        ;;
244    Xlower-underscore) AC_DEFINE(F77_NAME_LOWER_USCORE,1,[Define if Fortran names are lowercase with a trailing underscore])
245        F77_NAME_MANGLE="F77_NAME_LOWER_USCORE"
246         ;;
247    Xlower-doubleunderscore) AC_DEFINE(F77_NAME_LOWER_2USCORE,1,[Define if Fortran names containing an underscore have two trailing underscores])
248        F77_NAME_MANGLE="F77_NAME_LOWER_2USCORE"
249         ;;
250    Xupper) AC_DEFINE(F77_NAME_UPPER,1,[Define if Fortran names are uppercase])
251        F77_NAME_MANGLE="F77_NAME_UPPER"
252        ;;
253    Xmixed) AC_DEFINE(F77_NAME_MIXED,1,[Define if Fortran names preserve the original case])
254        F77_NAME_MANGLE="F77_NAME_MIXED"
255        ;;
256    Xmixed-underscore) AC_DEFINE(F77_NAME_MIXED_USCORE,1,[Define if Fortran names preserve the original case and add a trailing underscore])
257        F77_NAME_MANGLE="F77_NAME_MIXED_USCORE"
258        ;;
259    Xupper-stdcall) AC_DEFINE(F77_NAME_UPPER,1,[Define if Fortran names are uppercase])
260        F77_NAME_MANGLE="F77_NAME_UPPER_STDCALL"
261        pac_cv_test_stdcall="__stdcall"
262        ;;
263    *) AC_MSG_WARN([Unknown Fortran naming scheme]) ;;
264esac
265AC_SUBST(F77_NAME_MANGLE)
266# Get the standard call definition
267# FIXME: This should use F77_STDCALL, not STDCALL (non-conforming name)
268if test "X$pac_cv_test_stdcall" = "X" ; then
269    F77_STDCALL=""
270else
271    F77_STDCALL="__stdcall"
272fi
273#
274AC_DEFINE_UNQUOTED(STDCALL,$F77_STDCALL,[Define calling convention])
275],[$1])
276])
277dnl
278dnl/*D
279dnl PAC_PROG_F77_CHECK_SIZEOF - Determine the size in bytes of a Fortran
280dnl type
281dnl
282dnl Synopsis:
283dnl PAC_PROG_F77_CHECK_SIZEOF(type,[cross-size])
284dnl
285dnl Output Effect:
286dnl Sets SIZEOF_F77_uctype to the size if bytes of type.
287dnl If type is unknown, the size is set to 0.
288dnl If cross-compiling, the value cross-size is used (it may be a variable)
289dnl For example 'PAC_PROG_F77_CHECK_SIZEOF(real)' defines
290dnl 'SIZEOF_F77_REAL' to 4 on most systems.  The variable
291dnl 'pac_cv_sizeof_f77_<type>' (e.g., 'pac_cv_sizeof_f77_real') is also set to
292dnl the size of the type.
293dnl If the corresponding variable is already set, that value is used.
294dnl If the name has an '*' in it (e.g., 'integer*4'), the defined name
295dnl replaces that with an underscore (e.g., 'SIZEOF_F77_INTEGER_4').
296dnl
297dnl Notes:
298dnl If the 'cross-size' argument is not given, 'autoconf' will issue an error
299dnl message.  You can use '0' to specify undetermined.
300dnl
301dnl D*/
302AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF],[
303changequote(<<, >>)dnl
304dnl The name to #define.
305dnl If the arg value contains a variable, we need to update that
306define(<<PAC_TYPE_NAME>>, translit(sizeof_f77_$1, [a-z *], [A-Z__]))dnl
307dnl The cache variable name.
308define(<<PAC_CV_NAME>>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl
309changequote([, ])dnl
310AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[
311AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE])
312# This is needed for Mac OSX 10.5
313rm -rf conftest.dSYM
314rm -f conftest*
315cat <<EOF > conftest.f
316      subroutine isize( )
317      $1 i(2)
318      call cisize( i(1), i(2) )
319      end
320EOF
321if test "X$ac_fcompile" = "X" ; then
322    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC'
323fi
324if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then
325    mv conftest.o conftestf.o
326    AC_LANG_SAVE
327    AC_LANG_C
328    save_LIBS="$LIBS"
329    dnl Add the Fortran linking libraries
330    LIBS="conftestf.o $FLIBS $LIBS"
331    AC_TRY_RUN([#include <stdio.h>
332#ifdef F77_NAME_UPPER
333#define cisize_ CISIZE
334#define isize_ ISIZE
335#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
336#define cisize_ cisize
337#define isize_ isize
338#endif
339static int isize_val=0;
340void cisize_(char *,char*);
341void isize_(void);
342void cisize_(char *i1p, char *i2p)
343{
344   isize_val = (int)(i2p - i1p);
345}
346int main(int argc, char **argv)
347{
348    FILE *f = fopen("conftestval", "w");
349    if (!f) return 1;
350    isize_();
351    fprintf(f,"%d\n", isize_val );
352    return 0;
353}], eval PAC_CV_NAME=`cat conftestval`,eval PAC_CV_NAME=0,
354ifelse([$2],,,eval PAC_CV_NAME=$2))
355    # Problem.  If the process fails to run, then there won't be
356    # a good error message.  For example, with one Portland Group
357    # installation, we had problems with finding the libpgc.so shared library
358    # The autoconf code for TRY_RUN doesn't capture the output from
359    # the test program (!)
360   
361    LIBS="$save_LIBS"
362    AC_LANG_RESTORE
363else
364    echo "configure: failed program was:" >&AC_FD_CC
365    cat conftest.f >&AC_FD_CC
366    ifelse([$2],,eval PAC_CV_NAME=0,eval PAC_CV_NAME=$2)
367fi
368])
369AC_DEFINE_UNQUOTED(PAC_TYPE_NAME,$PAC_CV_NAME,[Define size of PAC_TYPE_NAME])
370undefine([PAC_TYPE_NAME])
371undefine([PAC_CV_NAME])
372])
373dnl
374dnl This version uses a Fortran program to link programs.
375dnl This is necessary because some compilers provide shared libraries
376dnl that are not within the default linker paths (e.g., our installation
377dnl of the Portland Group compilers)
378dnl
379AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF_EXT],[
380changequote(<<,>>)dnl
381dnl The name to #define.
382dnl If the arg value contains a variable, we need to update that
383define(<<PAC_TYPE_NAME>>, translit(sizeof_f77_$1, [a-z *], [A-Z__]))dnl
384dnl The cache variable name.
385define(<<PAC_CV_NAME>>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl
386changequote([,])dnl
387AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[
388AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE])
389if test "$cross_compiling" = yes ; then
390    ifelse([$2],,[AC_MSG_WARN([No value provided for size of $1 when cross-compiling])]
391,eval PAC_CV_NAME=$2)
392else
393    # This is needed for Mac OSX 10.5
394    rm -rf conftest.dSYM
395    rm -f conftest*
396    cat <<EOF > conftestc.c
397#include <stdio.h>
398#include "confdefs.h"
399#ifdef F77_NAME_UPPER
400#define cisize_ CISIZE
401#define isize_ ISIZE
402#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
403#define cisize_ cisize
404#define isize_ isize
405#endif
406int cisize_(char *,char*);
407int cisize_(char *i1p, char *i2p)
408{
409    int isize_val=0;
410    FILE *f = fopen("conftestval", "w");
411    if (!f) return 1;
412    isize_val = (int)(i2p - i1p);
413    fprintf(f,"%d\n", isize_val );
414    fclose(f);
415    return 0;
416}
417EOF
418    pac_tmp_compile='$CC -c $CFLAGS $CPPFLAGS conftestc.c >&5'
419    if AC_TRY_EVAL(pac_tmp_compile) && test -s conftestc.o ; then
420        AC_LANG_SAVE
421        AC_LANG_FORTRAN77
422        saveLIBS=$LIBS
423        LIBS="conftestc.o $LIBS"
424        dnl TRY_RUN does not work correctly for autoconf 2.13 (the
425        dnl macro includes C-preprocessor directives that are not
426        dnl valid in Fortran.  Instead, we do this by hand
427        cat >conftest.f <<EOF
428         program main
429         $1 a(2)
430         integer irc
431         irc = cisize(a(1),a(2))
432         end
433EOF
434        rm -f conftest$ac_exeext
435        rm -f conftestval
436        if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext ; then
437            if ./conftest$ac_exeext ; then
438                # success
439                :
440            else
441                # failure
442                :
443            fi
444        else
445            # failure
446            AC_MSG_WARN([Unable to build program to determine size of $1])
447        fi
448        LIBS=$saveLIBS
449        AC_LANG_RESTORE
450        if test -s conftestval ; then
451            eval PAC_CV_NAME=`cat conftestval`
452        else
453            eval PAC_CV_NAME=0
454        fi
455        # This is needed for Mac OSX 10.5
456        rm -rf conftest.dSYM
457        rm -f conftest*
458    else
459        AC_MSG_WARN([Unable to compile the C routine for finding the size of a $1])
460    fi
461fi # cross-compiling
462])
463AC_DEFINE_UNQUOTED(PAC_TYPE_NAME,$PAC_CV_NAME,[Define size of PAC_TYPE_NAME])
464undefine([PAC_TYPE_NAME])
465undefine([PAC_CV_NAME])
466])
467dnl
468dnl/*D
469dnl PAC_PROG_F77_EXCLAIM_COMMENTS
470dnl
471dnl Synopsis:
472dnl PAC_PROG_F77_EXCLAIM_COMMENTS([action-if-true],[action-if-false])
473dnl
474dnl Notes:
475dnl Check whether '!' may be used to begin comments in Fortran.
476dnl
477dnl This macro requires a version of autoconf `after` 2.13; the 'acgeneral.m4'
478dnl file contains an error in the handling of Fortran programs in
479dnl 'AC_TRY_COMPILE' (fixed in our local version).
480dnl
481dnl D*/
482AC_DEFUN([PAC_PROG_F77_EXCLAIM_COMMENTS],[
483AC_CACHE_CHECK([whether Fortran accepts ! for comments],
484pac_cv_prog_f77_exclaim_comments,[
485AC_LANG_SAVE
486AC_LANG_FORTRAN77
487AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[!        This is a comment])],
488     pac_cv_prog_f77_exclaim_comments="yes",
489     pac_cv_prog_f77_exclaim_comments="no")
490AC_LANG_RESTORE
491])
492if test "$pac_cv_prog_f77_exclaim_comments" = "yes" ; then
493    ifelse([$1],,:,$1)
494else
495    ifelse([$2],,:,$2)
496fi
497])dnl
498dnl
499dnl/*D
500dnl PAC_F77_CHECK_COMPILER_OPTION - Check that a compiler option is accepted
501dnl without warning messages
502dnl
503dnl Synopsis:
504dnl PAC_F77_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail)
505dnl
506dnl Output Effects:
507dnl
508dnl If no actions are specified, a working value is added to 'FOPTIONS'
509dnl
510dnl Notes:
511dnl This is now careful to check that the output is different, since
512dnl some compilers are noisy.
513dnl
514dnl We are extra careful to prototype the functions in case compiler options
515dnl that complain about poor code are in effect.
516dnl
517dnl Because this is a long script, we have ensured that you can pass a
518dnl variable containing the option name as the first argument.
519dnl D*/
520AC_DEFUN([PAC_F77_CHECK_COMPILER_OPTION],[
521AC_MSG_CHECKING([whether Fortran 77 compiler accepts option $1])
522ac_result="no"
523save_FFLAGS="$FFLAGS"
524FFLAGS="$1 $FFLAGS"
525rm -f conftest.out
526cat >conftest2.f <<EOF
527        subroutine try()
528        end
529EOF
530cat >conftest.f <<EOF
531        program main
532        end
533EOF
534dnl It is important to use the AC_TRY_EVAL in case F77 is not a single word
535dnl but is something like "f77 -64" (where the switch has changed the
536dnl compiler)
537ac_fscompilelink='${F77-f77} $save_FFLAGS -o conftest conftest.f $LDFLAGS >conftest.bas 2>&1'
538ac_fscompilelink2='${F77-f77} $FFLAGS -o conftest conftest.f $LDFLAGS >conftest.out 2>&1'
539if AC_TRY_EVAL(ac_fscompilelink) && test -x conftest ; then
540   if AC_TRY_EVAL(ac_fscompilelink2) && test -x conftest ; then
541      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
542         AC_MSG_RESULT(yes)
543         AC_MSG_CHECKING([whether routines compiled with $1 can be linked with ones compiled without $1])       
544         rm -f conftest2.out
545         rm -f conftest.bas
546         ac_fscompile3='${F77-f77} -c $save_FFLAGS conftest2.f >conftest2.out 2>&1'
547         ac_fscompilelink4='${F77-f77} $FFLAGS -o conftest conftest2.o conftest.f $LDFLAGS >conftest.bas 2>&1'
548         if AC_TRY_EVAL(ac_fscompile3) && test -s conftest2.o ; then
549            if AC_TRY_EVAL(ac_fscompilelink4) && test -x conftest ; then
550               if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
551                  ac_result="yes"
552               else
553                  echo "configure: Compiler output differed in two cases" >&AC_FD_CC
554                  diff -b conftest.out conftest.bas >&AC_FD_CC
555               fi
556            else
557               echo "configure: failed program was:" >&AC_FD_CC
558               cat conftest.f >&AC_FD_CC
559            fi
560          else
561            echo "configure: failed program was:" >&AC_FD_CC
562            cat conftest2.f >&AC_FD_CC
563          fi
564      else
565        # diff
566        echo "configure: Compiler output differed in two cases" >&AC_FD_CC
567        diff -b conftest.out conftest.bas >&AC_FD_CC
568      fi
569   else
570      # try_eval(fscompilelink2)
571      echo "configure: failed program was:" >&AC_FD_CC
572      cat conftest.f >&AC_FD_CC
573   fi
574   if test "$ac_result" != "yes" -a -s conftest.out ; then
575        cat conftest.out >&AC_FD_CC
576   fi
577else
578    # Could not compile without the option!
579    echo "configure: Could not compile program" >&AC_FD_CC
580    cat conftest.f >&AC_FD_CC
581    cat conftest.bas >&AC_FD_CC
582fi
583# Restore FFLAGS before 2nd/3rd argument commands are executed,
584# as 2nd/3rd argument command could be modifying FFLAGS.
585FFLAGS="$save_FFLAGS"
586if test "$ac_result" = "yes" ; then
587     AC_MSG_RESULT(yes)   
588     ifelse($2,,FOPTIONS="$FOPTIONS $1",$2)
589else
590     AC_MSG_RESULT(no)
591     $3
592fi
593# This is needed for Mac OSX 10.5
594rm -rf conftest.dSYM
595rm -f conftest*
596])
597dnl
598dnl/*D
599dnl PAC_PROG_F77_CMDARGS - Determine how to access the command line from
600dnl Fortran 77
601dnl
602dnl Output Effects:
603dnl  The following variables are set:
604dnl.vb
605dnl    F77_GETARG         - Statement to get an argument i into string s
606dnl    F77_IARGC          - Routine to return the number of arguments
607dnl    FXX_MODULE         - Module command when using Fortran 90 compiler
608dnl    F77_GETARGDECL     - Declaration of routine used for F77_GETARG
609dnl    F77_GETARG_FFLAGS  - Flags needed when compiling/linking
610dnl    F77_GETARG_LDFLAGS - Flags needed when linking
611dnl.ve
612dnl If 'F77_GETARG' has a value, then that value and the values for these
613dnl other symbols will be used instead.  If no approach is found, all of these
614dnl variables will have empty values.
615dnl If no other approach works and a file 'f77argdef' is in the directory,
616dnl that file will be sourced for the values of the above four variables.
617dnl
618dnl In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable
619dnl and F77_GETARG_LDFLAGS to the LDFLAGS variable, to ensure that tests are
620dnl performed on the compiler version that will be used.
621dnl
622dnl 'AC_SUBST' is called for all six variables.
623dnl
624dnl One complication is that on systems with multiple Fortran compilers,
625dnl some libraries used by one Fortran compiler may have been (mis)placed
626dnl in a common location.  We have had trouble with libg2c in particular.
627dnl To work around this, we test whether iargc etc. work first.  This
628dnl will catch most systems and will speed up the tests.
629dnl
630dnl Next, the libraries are only added if they are needed to complete a
631dnl link; they aren''t added just because they exist.
632dnl
633dnl f77argdef
634dnl D*/
635dnl
636dnl Random notes
637dnl You can export the command line arguments from C to the g77 compiler
638dnl using
639dnl    extern char **__libc_argv;
640dnl    extern int  __libc_argc;
641dnl    f_setarg( __libc_argc, __libc_argv );
642dnl
643AC_DEFUN([PAC_PROG_F77_CMDARGS],[
644found_cached="yes"
645AC_MSG_CHECKING([for routines to access the command line from Fortran 77])
646AC_CACHE_VAL(pac_cv_prog_f77_cmdarg,
647[
648    AC_MSG_RESULT([searching...])
649    found_cached="no"
650    # First, we perform a quick check.  Does iargc and getarg work?
651    fxx_module="${FXX_MODULE:-}"
652    f77_getargdecl="${F77_GETARGDECL:-external getarg}"
653    f77_getarg="${F77_GETARG:-call GETARG(i,s)}"
654    f77_iargc="${F77_IARGC:-IARGC()}"
655    #   
656    # Grumble.  The Absoft Fortran compiler computes i - i as 0 and then
657    # 1.0 / 0 at compile time, even though the code may never be executed.
658    # What we need is a way to generate an error, so the second usage of i
659    # was replaced with f77_iargc. 
660    cat > conftest.f <<EOF
661        program main
662$fxx_module
663        integer i, j
664        character*20 s
665        $f77_getargdecl
666        i = 0
667        $f77_getarg
668        i=$f77_iargc
669        if (i .gt. 1) then
670            j = i - $f77_iargc
671            j = 1.0 / j
672        endif
673        end
674EOF
675    found_answer="no"
676    if test -z "$ac_fcompilelink" ; then
677        ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
678    fi
679    AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with GETARG and IARGC])
680    if AC_TRY_EVAL(ac_fcompilelink) && test -x conftest ; then
681        # Check that cross != yes so that this works with autoconf 2.52
682        if test "$ac_cv_prog_f77_cross" != "yes" ; then
683            if ./conftest >/dev/null 2>&1 ; then
684                found_answer="yes"
685                FXX_MODULE="$fxx_module"
686                F77_GETARGDECL="$f77_getargdecl"
687                F77_GETARG="$f77_getarg"
688                F77_IARGC="$f77_iargc"
689                AC_MSG_RESULT(yes)
690            fi
691        fi
692    fi   
693    if test $found_answer = "no" ; then
694        AC_MSG_RESULT(no)
695    # Grumph.  Here are a bunch of different approaches
696    # We have several axes the check:
697    # Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77))
698    # PEPCF90 (Intel ifc)
699    # The first line is a dummy
700    # (we experimented with using a <space>, but this caused other
701    # problems because we need <space> in the IFS)
702    trial_LIBS="0 -lU77 -lPEPCF90"
703    if test "$NOG2C" != "1" ; then
704        trial_LIBS="$trial_LIBS -lg2c"
705    fi
706    # Discard libs that are not availble:
707    save_IFS="$IFS"
708    # Make sure that IFS includes a space, or the tests that run programs
709    # may fail
710    IFS=" ""
711"
712    save_trial_LIBS="$trial_LIBS"
713    trial_LIBS=""
714    cat > conftest.f <<EOF
715        program main
716        end
717EOF
718    ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC'
719    for libs in $save_trial_LIBS ; do
720        if test "$libs" = "0" ; then
721            lib_ok="yes"
722        else
723            AC_MSG_CHECKING([whether Fortran 77 links with $libs])
724            if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
725                AC_MSG_RESULT([yes])
726                lib_ok="yes"
727            else
728                AC_MSG_RESULT([no])
729                lib_ok="no"
730            fi
731        fi
732        if test "$lib_ok" = "yes" ; then
733            trial_LIBS="$trial_LIBS
734$libs"
735        fi
736    done
737
738    # Options to use when compiling and linking
739    # +U77 is needed by HP Fortran to access getarg etc.
740    # The -N109 was used for getarg before we realized that GETARG
741    # was necessary with the (non standard conforming) Absoft compiler
742    # (Fortran is monocase; Absoft uses mixedcase by default)
743    # The -f is used by Absoft and is the compiler switch that folds
744    # symbolic names to lower case.  Without this option, the compiler
745    # considers upper- and lower-case letters to be unique.
746    # The -YEXT_NAMES=LCS will cause external names to be output as lower
747    # case letter for Absoft F90 compilers (default is upper case)
748    # The first line is "<space><newline>, the space is important
749    # To make the Absoft f77 and f90 work together, we need to prefer the
750    # upper case versions of the arguments.  They also require libU77.
751    # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based)
752    # Fortran compilers
753    #
754    # Problem:  The Intel efc compiler hangs when presented with -N109 .
755    # The only real fix for this is to detect this compiler and exclude
756    # the test.  We may want to reorganize these tests so that if we
757    # can compile code without special options, we never look for them.
758    #
759    using_intel_efc="no"
760    pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'`
761    if test "$pac_test_msg" != "" ; then
762        using_intel_efc="yes"
763    fi
764    if test "$using_intel_efc" = "yes" ; then
765        trial_FLAGS="000"
766    else
767        trial_FLAGS="000
768-N109
769-f
770-YEXT_NAMES=UCS
771-YEXT_NAMES=LCS
772-YCFRL=1
773+U77"
774    fi
775    # Discard options that are not available:
776    # (IFS already saved above)
777    IFS=" ""
778"
779    save_trial_FLAGS="$trial_FLAGS"
780    trial_FLAGS=""
781    for flag in $save_trial_FLAGS ; do
782        if test "$flag" = " " -o "$flag" = "000" ; then
783            opt_ok="yes"
784        else
785            PAC_F77_CHECK_COMPILER_OPTION($flag,opt_ok=yes,opt_ok=no)
786        fi
787        if test "$opt_ok" = "yes" ; then
788            if test "$flag" = " " -o "$flag" = "000" ; then
789                fflag=""
790            else
791                fflag="$flag"
792            fi
793            # discard options that don't allow mixed-case name matching
794            cat > conftest.f <<EOF
795        program main
796        call aB()
797        end
798        subroutine Ab()
799        end
800EOF
801            if test -n "$fflag" ; then flagval="with $fflag" ; else flagval="" ; fi
802            AC_MSG_CHECKING([whether Fortran 77 routine names are case-insensitive $flagval])
803            dnl we can use double quotes here because all is already
804            dnl evaluated
805            ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
806            if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
807                AC_MSG_RESULT(yes)
808            else
809                AC_MSG_RESULT(no)
810                opt_ok="no"
811            fi
812        fi
813        if test "$opt_ok" = "yes" ; then
814            trial_FLAGS="$trial_FLAGS
815$flag"
816        fi
817    done
818    IFS="$save_IFS"
819    # Name of routines.  Since these are in groups, we use a case statement
820    # and loop until the end (accomplished by reaching the end of the
821    # case statement
822    # For one version of Nag F90, the names are
823    # call f90_unix_MP_getarg(i,s) and f90_unix_MP_iargc().
824    trial=0
825    while test -z "$pac_cv_prog_f77_cmdarg" ; do
826        case $trial in
827        0) # User-specified values, if any
828           if test -z "$F77_GETARG" -o -z "$F77_IARGC" ; then
829               trial=`expr $trial + 1`
830               continue
831           fi
832           MSG="Using environment values of F77_GETARG etc."
833           ;;
834        1) # Standard practice, uppercase (some compilers are case-sensitive)
835           FXX_MODULE=""
836           F77_GETARGDECL="external GETARG"
837           F77_GETARG="call GETARG(i,s)"
838           F77_IARGC="IARGC()"
839           MSG="GETARG and IARGC"
840           ;;
841        2) # Standard practice, lowercase
842           FXX_MODULE=""
843           F77_GETARGDECL="external getarg"
844           F77_GETARG="call getarg(i,s)"
845           F77_IARGC="iargc()"
846           MSG="getarg and iargc"
847           ;;
848        3) # Posix alternative
849           FXX_MODULE=""
850           F77_GETARGDECL="external pxfgetarg"
851           F77_GETARG="call pxfgetarg(i,s,l,ier)"
852           F77_IARGC="ipxfargc()"
853           MSG="pxfgetarg and ipxfargc"
854           ;;
855        4) # Nag f90_unix_env module
856           FXX_MODULE="        use f90_unix_env"
857           F77_GETARGDECL=""
858           F77_GETARG="call getarg(i,s)"
859           F77_IARGC="iargc()"
860           MSG="f90_unix_env module"
861           ;;
862        5) # Nag f90_unix module
863           FXX_MODULE="        use f90_unix"
864           F77_GETARGDECL=""
865           F77_GETARG="call getarg(i,s)"
866           F77_IARGC="iargc()"
867           MSG="f90_unix module"
868           ;;
869        6) # user spec in a file
870           if test -s f77argdef ; then
871                . ./f77argdef
872               MSG="Using definitions in the file f77argdef"
873           else
874                trial=`expr $trial + 1`
875                continue
876           fi
877           ;;
878        7) # gfortran won't find getarg if it is marked as external
879           FXX_MODULE=""
880           F77_GETARGDECL="intrinsic GETARG"
881           F77_GETARG="call GETARG(i,s)"
882           F77_IARGC="IARGC()"
883           MSG="intrinsic GETARG and IARGC"
884           ;;
885        *) # exit from while loop
886           FXX_MODULE=""
887           F77_GETARGDECL=""
888           F77_GETARG=""
889           F77_IARGC=""
890           break
891           ;;
892        esac
893        # Create the program.  Make sure that we can run it.
894        # Force a divide-by-zero if there is a problem (but only at runtime!
895        # (the Absoft compiler does divide-by-zero at compile time)
896        cat > conftest.f <<EOF
897        program main
898$FXX_MODULE
899        integer i, j
900        character*20 s
901        $F77_GETARGDECL
902        i = 0
903        $F77_GETARG
904        i=$F77_IARGC
905        if (i .gt. 1) then
906            j = i - $F77_IARGC
907            j = 1.0 / j
908        endif
909        end
910EOF
911    #
912    # Now, try to find some way to compile and link that program, looping
913    # over the possibilities of options and libraries
914        save_IFS="$IFS"
915        IFS=" ""
916"
917        for libs in $trial_LIBS ; do
918            if test -n "$pac_cv_prog_f77_cmdarg" ; then break ; fi
919            if test "$libs" = " " -o "$libs" = "0" ; then libs="" ; fi
920            for flags in $trial_FLAGS ; do
921                if test "$flags" = " " -o "$flags" = "000"; then flags="" ; fi
922                AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with $MSG])
923                IFS="$save_IFS"
924                dnl We need this here because we've fiddled with IFS
925                ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC"
926                found_answer="no"
927                if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
928                    if test "$ac_cv_prog_f77_cross" != "yes" ; then
929                        if ./conftest >/dev/null 2>&1 ; then
930                            found_answer="yes"
931                        fi
932                    else
933                        found_answer="yes"
934                    fi
935                fi
936                IFS=" ""
937"
938                if test "$found_answer" = "yes" ; then
939                    AC_MSG_RESULT([yes])
940                    pac_cv_prog_f77_cmdarg="$MSG"
941                    pac_cv_prog_f77_cmdarg_fflags="$flags"
942                    pac_cv_prog_f77_cmdarg_ldflags="$libs"
943                    break
944                else
945                    AC_MSG_RESULT([no])
946                    echo "configure: failed program was:" >&AC_FD_CC
947                    cat conftest.f >&AC_FD_CC
948                fi
949            done
950        done
951        IFS="$save_IFS"   
952        rm -f conftest.*
953        trial=`expr $trial + 1`   
954    done
955fi
956pac_cv_F77_GETARGDECL="$F77_GETARGDECL"
957pac_cv_F77_IARGC="$F77_IARGC"
958pac_cv_F77_GETARG="$F77_GETARG"
959pac_cv_FXX_MODULE="$FXX_MODULE"
960])
961if test "$found_cached" = "yes" ; then
962    AC_MSG_RESULT([$pac_cv_prog_f77_cmdarg])
963elif test -z "$pac_cv_F77_IARGC" ; then
964    AC_MSG_WARN([Could not find a way to access the command line from Fortran 77])
965fi
966# Set the variable values based on pac_cv_prog_xxx
967F77_GETARGDECL="$pac_cv_F77_GETARGDECL"
968F77_IARGC="$pac_cv_F77_IARGC"
969F77_GETARG="$pac_cv_F77_GETARG"
970FXX_MODULE="$pac_cv_FXX_MODULE"
971F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags"
972F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags"
973AC_SUBST(F77_GETARGDECL)
974AC_SUBST(F77_IARGC)
975AC_SUBST(F77_GETARG)
976AC_SUBST(FXX_MODULE)
977AC_SUBST(F77_GETARG_FFLAGS)
978AC_SUBST(F77_GETARG_LDFLAGS)
979])
980dnl/*D
981dnl PAC_PROG_F77_LIBRARY_DIR_FLAG - Determine the flag used to indicate
982dnl the directories to find libraries in
983dnl
984dnl Notes:
985dnl Many compilers accept '-Ldir' just like most C compilers. 
986dnl Unfortunately, some (such as some HPUX Fortran compilers) do not,
987dnl and require instead either '-Wl,-L,dir' or something else.  This
988dnl command attempts to determine what is accepted.  The flag is
989dnl placed into 'F77_LIBDIR_LEADER'.
990dnl
991dnl D*/
992dnl
993dnl An earlier version of this only tried the arguments without using
994dnl a library.  This failed when the HP compiler complained about the
995dnl arguments, but produced an executable anyway. 
996AC_DEFUN([PAC_PROG_F77_LIBRARY_DIR_FLAG],[
997if test "X$F77_LIBDIR_LEADER" = "X" ; then
998AC_CACHE_CHECK([for Fortran 77 flag for library directories],
999pac_cv_prog_f77_library_dir_flag,
1000[
1001   
1002    rm -f conftest.* conftest1.*
1003    cat > conftest.f <<EOF
1004        program main
1005        call f1conf
1006        end
1007EOF
1008    cat > conftest1.f <<EOF
1009        subroutine f1conf
1010        end
1011EOF
1012dnl Build library
1013    ac_fcompileforlib='${F77-f77} -c $FFLAGS conftest1.f 1>&AC_FD_CC'
1014    if AC_TRY_EVAL(ac_fcompileforlib) && test -s conftest1.o ; then
1015        if test ! -d conftest ; then mkdir conftest2 ; fi
1016        # We have had some problems with "AR" set to "ar cr"; this is
1017        # a user-error; AR should be set to just the program (plus
1018        # any flags that affect the object file format, such as -X64
1019        # required for 64-bit objects in some versions of AIX).
1020        AC_TRY_COMMAND(${AR-"ar"} cr conftest2/libconftest.a conftest1.o)
1021        AC_TRY_COMMAND(${RANLIB-ranlib} conftest2/libconftest.a)
1022        ac_fcompileldtest='${F77-f77} -o conftest $FFLAGS ${ldir}conftest2 conftest.f -lconftest $LDFLAGS 1>&AC_FD_CC'
1023        for ldir in "-L" "-Wl,-L," ; do
1024            if AC_TRY_EVAL(ac_fcompileldtest) && test -s conftest ; then
1025                pac_cv_prog_f77_library_dir_flag="$ldir"
1026                break
1027            fi
1028        done
1029        rm -rf ./conftest2
1030    else
1031        echo "configure: failed program was:" >&AC_FD_CC
1032        cat conftest1.f >&AC_FD_CC
1033    fi
1034    # This is needed for Mac OSX 10.5
1035    rm -rf conftest.dSYM
1036    rm -f conftest*
1037])
1038    AC_SUBST(F77_LIBDIR_LEADER)
1039    if test "X$pac_cv_prog_f77_library_dir_flag" != "X" ; then
1040        F77_LIBDIR_LEADER="$pac_cv_prog_f77_library_dir_flag"
1041    fi
1042fi
1043])
1044dnl/*D
1045dnl PAC_PROG_F77_HAS_INCDIR - Check whether Fortran accepts -Idir flag
1046dnl
1047dnl Syntax:
1048dnl   PAC_PROG_F77_HAS_INCDIR(directory,action-if-true,action-if-false)
1049dnl
1050dnl Output Effect:
1051dnl  Sets 'F77_INCDIR' to the flag used to choose the directory. 
1052dnl
1053dnl Notes:
1054dnl This refers to the handling of the common Fortran include extension,
1055dnl not to the use of '#include' with the C preprocessor.
1056dnl If directory does not exist, it will be created.  In that case, the
1057dnl directory should be a direct descendant of the current directory.
1058dnl
1059dnl D*/
1060AC_DEFUN([PAC_PROG_F77_HAS_INCDIR],[
1061checkdir=$1
1062AC_CACHE_CHECK([for include directory flag for Fortran],
1063pac_cv_prog_f77_has_incdir,[
1064if test ! -d $checkdir ; then mkdir $checkdir ; fi
1065cat >$checkdir/conftestf.h <<EOF
1066       call sub()
1067EOF
1068cat >conftest.f <<EOF
1069       program main
1070       include 'conftestf.h'
1071       end
1072EOF
1073
1074ac_fcompiletest='${F77-f77} -c $FFLAGS ${idir}$checkdir conftest.f 1>&AC_FD_CC'
1075pac_cv_prog_f77_has_incdir="none"
1076# SGI wants -Wf,-I
1077for idir in "-I" "-Wf,-I" ; do
1078    if AC_TRY_EVAL(ac_fcompiletest) && test -s conftest.o ; then
1079        pac_cv_prog_f77_has_incdir="$idir"
1080        break
1081    fi
1082done
1083# This is needed for Mac OSX 10.5
1084rm -rf conftest.dSYM
1085rm -f conftest*
1086rm -f $checkdir/conftestf.h
1087])
1088AC_SUBST(F77_INCDIR)
1089if test "X$pac_cv_prog_f77_has_incdir" != "Xnone" ; then
1090    F77_INCDIR="$pac_cv_prog_f77_has_incdir"
1091fi
1092])
1093dnl
1094dnl/*D
1095dnl PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS - Check whether the Fortran compiler
1096dnl allows unused and undefined functions to be listed in an external
1097dnl statement
1098dnl
1099dnl Syntax:
1100dnl   PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS(action-if-true,action-if-false)
1101dnl
1102dnl D*/
1103AC_DEFUN([PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS],[
1104AC_CACHE_CHECK([whether Fortran allows unused externals],
1105pac_cv_prog_f77_allows_unused_externals,[
1106AC_LANG_SAVE
1107AC_LANG_FORTRAN77
1108dnl We can't use TRY_LINK, because it wants a routine name, not a
1109dnl declaration.  The following is the body of TRY_LINK, slightly modified.
1110cat > conftest.$ac_ext <<EOF
1111       program main
1112       external bar
1113       end
1114EOF
1115if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
1116  # This is needed for Mac OSX 10.5
1117  rm -rf conftest.dSYM
1118  rm -rf conftest*
1119  pac_cv_prog_f77_allows_unused_externals="yes"
1120else
1121  echo "configure: failed program was:" >&AC_FD_CC
1122  cat conftest.$ac_ext >&AC_FD_CC
1123  # This is needed for Mac OSX 10.5
1124  rm -rf conftest.dSYM
1125  rm -rf conftest*
1126  pac_cv_prog_f77_allows_unused_externals="no"
1127  $4
1128fi
1129# This is needed for Mac OSX 10.5
1130rm -rf conftest.dSYM
1131rm -f conftest*
1132#
1133AC_LANG_RESTORE
1134])
1135if test "X$pac_cv_prog_f77_allows_unused_externals" = "Xyes" ; then
1136   ifelse([$1],,:,[$1])
1137else
1138   ifelse([$2],,:,[$2])
1139fi
1140])
1141dnl /*D
1142dnl PAC_PROG_F77_HAS_POINTER - Determine if Fortran allows pointer type
1143dnl
1144dnl Synopsis:
1145dnl   PAC_PROG_F77_HAS_POINTER(action-if-true,action-if-false)
1146dnl D*/
1147AC_DEFUN([PAC_PROG_F77_HAS_POINTER],[
1148AC_CACHE_CHECK([whether Fortran has pointer declaration],
1149pac_cv_prog_f77_has_pointer,[
1150AC_LANG_SAVE
1151AC_LANG_FORTRAN77
1152AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
1153        integer M
1154        pointer (MPTR,M)
1155        data MPTR/0/
1156])],
1157    pac_cv_prog_f77_has_pointer="yes",
1158    pac_cv_prog_f77_has_pointer="no")
1159AC_LANG_RESTORE
1160])
1161if test "$pac_cv_prog_f77_has_pointer" = "yes" ; then
1162    ifelse([$1],,:,[$1])
1163else
1164    ifelse([$2],,:,[$2])
1165fi
1166])
1167dnl
1168dnl pac_prog_f77_run_proc_from_c( c main program, fortran routine,
1169dnl                               action-if-works, action-if-fails,
1170dnl                               cross-action )
1171dnl Fortran routine MUST be named ftest unless you include code
1172dnl to select the appropriate Fortran name.
1173dnl
1174AC_DEFUN([PAC_PROG_F77_RUN_PROC_FROM_C],[
1175# This is needed for Mac OSX 10.5
1176rm -rf conftest.dSYM
1177rm -f conftest*
1178cat <<EOF > conftest.f
1179$2
1180EOF
1181dnl
1182if test "X$ac_fcompile" = "X" ; then
1183    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC'
1184fi
1185if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then
1186    mv conftest.o conftestf.o
1187    AC_LANG_SAVE
1188    AC_LANG_C
1189    save_LIBS="$LIBS"
1190    LIBS="conftestf.o $FLIBS $LIBS"
1191    AC_TRY_RUN([#include <stdio.h>
1192#ifdef F77_NAME_UPPER
1193#define ftest_ FTEST
1194#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
1195#define ftest_ ftest
1196#endif
1197$1
1198], [$3], [$4], [$5] )
1199    LIBS="$save_LIBS"
1200    AC_LANG_RESTORE
1201else
1202    echo "configure: failed program was:" >&AC_FD_CC
1203    cat conftest.f >&AC_FD_CC
1204fi
1205# This is needed for Mac OSX 10.5
1206rm -rf conftest.dSYM
1207rm -f conftest*
1208])
1209dnl
1210dnl PAC_PROG_F77_IN_C_LIBS
1211dnl
1212dnl Find the essential libraries that are needed to use the C linker to
1213dnl create a program that includes a trival Fortran code. 
1214dnl
1215dnl For example, all pgf90 compiled objects include a reference to the
1216dnl symbol pgf90_compiled, found in libpgf90 .
1217dnl
1218dnl There is an additional problem.  To *run* programs, we may need
1219dnl additional arguments; e.g., if shared libraries are used.  Even
1220dnl with autoconf 2.52, the autoconf macro to find the library arguments
1221dnl doesn't handle this, either by detecting the use of -rpath or
1222dnl by trying to *run* a trivial program.  It only checks for *linking*.
1223dnl
1224dnl
1225AC_DEFUN([PAC_PROG_F77_IN_C_LIBS],[
1226AC_MSG_CHECKING([for which Fortran libraries are needed to link C with Fortran])
1227F77_IN_C_LIBS="$FLIBS"
1228# This is needed for Mac OSX 10.5
1229rm -rf conftest.dSYM
1230rm -f conftest*
1231cat <<EOF > conftest.f
1232        subroutine ftest
1233        end
1234EOF
1235dnl
1236if test "X$ac_fcompile" = "X" ; then
1237    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC'
1238fi
1239if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then
1240    mv conftest.o mconftestf.o
1241    AC_LANG_SAVE
1242    AC_LANG_C
1243    save_LIBS="$LIBS"
1244    dnl First try with no libraries
1245    LIBS="mconftestf.o $save_LIBS"
1246    AC_TRY_LINK([#include <stdio.h>],[
1247#ifdef F77_NAME_UPPER
1248#define ftest_ FTEST
1249#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
1250#define ftest_ ftest
1251#endif
1252extern void ftest_(void);
1253ftest_();
1254], [link_worked=yes], [link_worked=no] )
1255    if test "$link_worked" = "no" ; then
1256        flibdirs=`echo $FLIBS | tr ' ' '\012' | grep '\-L' | tr '\012' ' '`
1257        fliblibs=`echo $FLIBS | tr ' ' '\012' | grep -v '\-L' | tr '\012' ' '`
1258        for flibs in $fliblibs ; do
1259            LIBS="mconftestf.o $flibdirs $flibs $save_LIBS"
1260            AC_TRY_LINK([#include <stdio.h>],[
1261#ifdef F77_NAME_UPPER
1262#define ftest_ FTEST
1263#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
1264#define ftest_ ftest
1265#endif
1266extern void ftest_(void);
1267ftest_();
1268], [link_worked=yes], [link_worked=no] )
1269            if test "$link_worked" = "yes" ; then
1270                F77_IN_C_LIBS="$flibdirs $flibs"
1271                break
1272            fi
1273        done
1274    if test "$link_worked" = "no" ; then
1275        # try to add libraries until it works...
1276        flibscat=""
1277        for flibs in $fliblibs ; do
1278            flibscat="$flibscat $flibs"
1279            LIBS="mconftestf.o $flibdirs $flibscat $save_LIBS"
1280            AC_TRY_LINK([#include <stdio.h>],[
1281#ifdef F77_NAME_UPPER
1282#define ftest_ FTEST
1283#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
1284#define ftest_ ftest
1285#endif
1286extern void ftest_(void);
1287ftest_();
1288], [link_worked=yes], [link_worked=no] )
1289            if test "$link_worked" = "yes" ; then
1290                F77_IN_C_LIBS="$flibdirs $flibscat"
1291                break
1292            fi
1293        done
1294    fi
1295    else
1296        # No libraries needed
1297        F77_IN_C_LIBS=""
1298    fi
1299    LIBS="$save_LIBS"
1300    AC_LANG_RESTORE
1301else
1302    echo "configure: failed program was:" >&AC_FD_CC
1303    cat conftest.f >&AC_FD_CC
1304fi
1305# This is needed for Mac OSX 10.5
1306rm -rf conftest.dSYM
1307rm -f conftest* mconftest*
1308if test -z "$F77_IN_C_LIBS" ; then
1309    AC_MSG_RESULT(none)
1310else
1311    AC_MSG_RESULT($F77_IN_C_LIBS)
1312fi
1313])
1314dnl
1315dnl Test to see if we should use C or Fortran to link programs whose
1316dnl main program is in Fortran.  We may find that neither work because
1317dnl we need special libraries in each case.
1318dnl
1319AC_DEFUN([PAC_PROG_F77_LINKER_WITH_C],[
1320AC_LANG_SAVE
1321AC_LANG_C
1322AC_TRY_COMPILE(,
1323long long a;,AC_DEFINE(HAVE_LONG_LONG,1,[Define if long long allowed]))
1324AC_MSG_CHECKING([for linker for Fortran main programs])
1325dnl
1326dnl Create a program that uses multiplication and division in case
1327dnl that requires special libraries
1328cat > conftest.c <<EOF
1329#include "confdefs.h"
1330#ifdef HAVE_LONG_LONG
1331int f(int a, long long b) { int c; c = a * ( b / 3 ) / (b-1); return c ; }
1332#else
1333int f(int a, long b) { int c; c = a * b / (b-1); return c ; }
1334#endif
1335EOF
1336if AC_TRY_EVAL(ac_compile); then
1337    mv conftest.o conftest1.o
1338else
1339    AC_MSG_ERROR([Could not compile C test program])
1340fi
1341AC_LANG_FORTRAN77
1342cat > conftest.f <<EOF
1343        program main
1344        double precision d
1345        print *, "hi"
1346        end
1347EOF
1348if AC_TRY_EVAL(ac_compile); then
1349    # We include $FFLAGS on the link line because this is
1350    # the way in which most of the configure tests run.  In particular,
1351    # many users are used to using FFLAGS (and CFLAGS) to select
1352    # different instruction sets, such as 64-bit with -xarch=v9 for
1353    # Solaris.
1354    if ${F77} ${FFLAGS} -o conftest conftest.o conftest1.o $LDFLAGS 2>&AC_FD_CC ; then
1355        AC_MSG_RESULT([Use Fortran to link programs])
1356    elif ${CC} ${CFLAGS} -o conftest conftest.o conftest1.o $LDFLAGS $FLIBS 2>&AC_FD_CC ; then
1357        AC_MSG_RESULT([Use C with FLIBS to link programs])
1358        F77LINKER="$CC"
1359        F77_LDFLAGS="$F77_LDFLAGS $FLIBS"
1360    else
1361        AC_MSG_RESULT([Unable to determine how to link Fortran programs with C])
1362    fi
1363else
1364    AC_MSG_ERROR([Could not compile Fortran test program])
1365fi
1366AC_LANG_RESTORE
1367])
1368dnl
1369dnl Check to see if a C program can be linked when using the libraries
1370dnl needed by C programs
1371dnl
1372AC_DEFUN([PAC_PROG_F77_CHECK_FLIBS],
1373[AC_MSG_CHECKING([whether C can link with $FLIBS])
1374# Try to link a C program with all of these libraries
1375save_LIBS="$LIBS"
1376LIBS="$LIBS $FLIBS"
1377AC_TRY_LINK(,[int a;],runs=yes,runs=no)
1378LIBS="$save_LIBS"
1379AC_MSG_RESULT($runs)
1380if test "$runs" = "no" ; then
1381    AC_MSG_CHECKING([for which libraries can be used])
1382    pac_ldirs=""
1383    pac_libs=""
1384    pac_other=""
1385    for name in $FLIBS ; do
1386        case $name in
1387        -l*) pac_libs="$pac_libs $name" ;;
1388        -L*) pac_ldirs="$pac_ldirs $name" ;;
1389        *)   pac_other="$pac_other $name" ;;
1390        esac
1391    done
1392    save_LIBS="$LIBS"
1393    keep_libs=""
1394    for name in $pac_libs ; do
1395        LIBS="$save_LIBS $pac_ldirs $pac_other $name"
1396        AC_TRY_LINK(,[int a;],runs=yes,runs=no)
1397        if test $runs = "yes" ; then keep_libs="$keep_libs $name" ; fi
1398    done
1399    AC_MSG_RESULT($keep_libs)
1400    LIBS="$save_LIBS"
1401    FLIBS="$pac_ldirs $pac_other $keep_libs"
1402fi
1403])
1404dnl
1405dnl Check to see if Fortran supports the new-style character declarations.
1406dnl Some compilers issue warnings for the old-style, so we may want to
1407dnl use the new form if it is available.
1408dnl
1409AC_DEFUN([PAC_PROG_F77_NEW_CHAR_DECL],[
1410AC_CACHE_CHECK([whether Fortran supports new-style character declarations],
1411pac_cv_prog_f77_new_char_decl,[
1412AC_LANG_SAVE
1413AC_LANG_FORTRAN77
1414AC_COMPILE_IFLESE([AC_LANG_PROGRAM(,[        character (len=10) s])],
1415    pac_cv_prog_f77_new_char_decl="yes",
1416    pac_cv_prog_f77_new_char_decl="no")
1417AC_LANG_RESTORE
1418])
1419if test "$pac_cv_prog_f77_new_char_decl" = "yes" ; then
1420    ifelse([$1],,:,$1)
1421else
1422    ifelse([$2],,:,$2)
1423fi
1424])dnl
1425
1426AC_DEFUN([PAC_PROG_F77_CHAR_PARM],[
1427#
1428# We need to check on how character variables are passed.  If they
1429# are *not* passed at the end of the list, we need to know that NOW!
1430case $pac_cv_prog_f77_name_mangle in
1431    mixed|lower)
1432    sub1=sub
1433    sub2=conffoo
1434    ;;
1435    upper)
1436    sub1=SUB
1437    sub2=CONFFOO
1438    ;;
1439    *)
1440    sub1=sub_
1441    sub2=conffoo_
1442    ;;
1443esac
1444
1445cat > conftest.c <<EOF
1446#include <stdio.h>
1447int loc = -1;
1448void $sub1( char *a, int b, int c )
1449{
1450    if (b == 10) {
1451    loc = 2;
1452    }
1453    if (c == 10) {
1454    loc = 3;
1455    }
1456}
1457int main( int argc, char **argv )
1458{
1459    int a, b, c;
1460    $sub2();
1461    printf( "%d\n", loc );
1462}
1463EOF
1464cat > conftest1.f <<EOF
1465        subroutine conffoo()
1466        character a*10
1467        a = "Foo"
1468        call sub( a, 20 )
1469        end
1470EOF
1471# This is needed for Mac OSX 10.5
1472rm -rf conftest.dSYM
1473rm conftest*
1474])
1475dnl
1476dnl Test for extra libraries needed when linking C routines that use
1477dnl stdio with Fortran.  This test was created for OSX, which
1478dnl sometimes requires -lSystemStubs.  If another library is needed,
1479dnl add it to F77_OTHER_LIBS
1480AC_DEFUN([PAC_PROG_F77_AND_C_STDIO_LIBS],[
1481    # To simply the code in the cache_check macro, chose the routine name
1482    # first, in case we need it
1483    confname=conf1_
1484    case "$pac_cv_prog_f77_name_mangle" in
1485    "lower underscore")       confname=conf1_ ;;
1486    "upper stdcall")          confname=CONF1  ;;
1487    upper)                    confname=CONF1  ;;
1488    "lower doubleunderscore") confname=conf1_ ;;
1489    lower)                    confname=conf1  ;;
1490    "mixed underscore")       confname=conf1_ ;;
1491    mixed)                    confname=conf1  ;;
1492    esac
1493
1494    AC_CACHE_CHECK([what libraries are needed to link Fortran programs with C routines that use stdio],pac_cv_prog_f77_and_c_stdio_libs,[
1495    pac_cv_prog_f77_and_c_stdio_libs=unknown
1496    # This is needed for Mac OSX 10.5
1497    rm -rf conftest.dSYM
1498    rm -f conftest*
1499    cat >conftest.f <<EOF
1500        program main
1501        call conf1(0)
1502        end
1503EOF
1504    cat >conftestc.c <<EOF
1505#include <stdio.h>
1506int $confname( int a )
1507{ printf( "The answer is %d\n", a ); fflush(stdout); return 0; }
1508EOF
1509    tmpcmd='${CC-cc} -c $CFLAGS conftestc.c 1>&AC_FD_CC'
1510    if AC_TRY_EVAL(tmpcmd) && test -s conftestc.o ; then
1511        :
1512    else
1513        echo "configure: failed program was:" >&AC_FD_CC
1514        cat conftestc.c >&AC_FD_CC
1515    fi
1516
1517    tmpcmd='${F77-f77} $FFLAGS -o conftest conftest.f conftestc.o 1>&AC_FD_CC'
1518    if AC_TRY_EVAL(tmpcmd) && test -x conftest ; then
1519         pac_cv_prog_f77_and_c_stdio_libs=none
1520    else
1521         # Try again with -lSystemStubs
1522         tmpcmd='${F77-f77} $FFLAGS -o conftest conftest.f conftestc.o -lSystemStubs 1>&AC_FD_CC'
1523         if AC_TRY_EVAL(tmpcmd) && test -x conftest ; then
1524             pac_cv_prog_f77_and_c_stdio_libs="-lSystemStubs"
1525         else
1526             echo "configure: failed program was:" >&AC_FD_CC
1527             cat conftestc.c >&AC_FD_CC
1528             echo "configure: with Fortran 77 program:" >&AC_FD_CC
1529             cat conftest.f >&AC_FD_CC
1530         fi
1531    fi
1532
1533    # This is needed for Mac OSX 10.5
1534    rm -rf conftest.dSYM
1535    rm -f conftest*
1536])
1537if test "$pac_cv_prog_f77_and_c_stdio_libs" != none -a \
1538        "$pac_cv_prog_f77_and_c_stdio_libs" != unknown ; then
1539    F77_OTHER_LIBS="$F77_OTHER_LIBS $pac_cv_prog_f77_and_c_stdio_libs"   
1540fi
1541])
1542dnl
1543dnl Check that the FLIBS determined by AC_F77_LIBRARY_LDFLAGS is valid.
1544dnl That macro (at least as of autoconf 2.59) attempted to parse the output
1545dnl of the compiler when asked to be verbose; in the case of the Fujitsu
1546dnl frt Fortran compiler, it included files that frt looked for and then
1547dnl discarded because they did not exist.
1548AC_DEFUN([PAC_PROG_F77_FLIBS_VALID],[
1549    pac_cv_f77_flibs_valid=unknown
1550    AC_MSG_CHECKING([whether $F77 accepts the FLIBS found by autoconf])
1551    AC_LANG_SAVE
1552    AC_LANG_FORTRAN77
1553dnl We can't use TRY_LINK, because it wants a routine name, not a
1554dnl declaration.  The following is the body of TRY_LINK, slightly modified.
1555cat > conftest.$ac_ext <<EOF
1556       program main
1557       end
1558EOF
1559    if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
1560      pac_cv_f77_flibs_valid=yes
1561    else
1562      echo "configure: failed program was:" >&AC_FD_CC
1563      cat conftest.$ac_ext >&AC_FD_CC
1564      pac_cv_f77_flibs_valid=no
1565    fi
1566AC_MSG_RESULT($pac_cv_f77_flibs_valid)
1567if test $pac_cv_f77_flibs_valid = no ; then
1568    # See which ones *are* valid
1569    AC_MSG_CHECKING([for valid entries in FLIBS])
1570    goodFLIBS=""
1571    saveFLIBS=$FLIBS
1572    FLIBS=""
1573    for arg in $saveFLIBS ; do
1574      FLIBS="$goodFLIBS $arg"
1575      if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
1576          goodFLIBS=$FLIBS
1577      else
1578        echo "configure: failed program was:" >&AC_FD_CC
1579        cat conftest.$ac_ext >&AC_FD_CC
1580      fi
1581      done
1582    FLIBS=$goodFLIBS
1583    AC_MSG_RESULT($FLIBS)
1584fi
1585#
1586# This is needed for Mac OSX 10.5
1587rm -rf conftest.dSYM
1588rm -f conftest*
1589AC_LANG_RESTORE
1590])
1591dnl
1592dnl
1593dnl
1594dnl
1595AC_DEFUN([PAC_PROG_F77_OBJ_LINKS_WITH_C],[
1596AC_MSG_CHECKING([whether Fortran 77 and C objects are compatible])
1597dnl
1598rm -rf conftestc.dSYM
1599rm -f conftestc*
1600dnl construct with a C function with all possible F77 name mangling schemes.
1601cat <<_EOF > conftestc.c
1602/* lower */
1603void c_subpgm( int *rc );
1604void c_subpgm( int *rc ) { *rc = 1; }
1605
1606/* lower underscore */
1607void c_subpgm_( int *rc );
1608void c_subpgm_( int *rc ) { *rc = 2; }
1609
1610/* upper */
1611void C_SUBPGM( int *rc );
1612void C_SUBPGM( int *rc ) { *rc = 3; }
1613
1614/* lower doubleunderscore */
1615void c_subpgm__( int *rc );
1616void c_subpgm__( int *rc ) { *rc = 4; }
1617
1618/* mixed */
1619void C_subpgm( int *rc );
1620void C_subpgm( int *rc ) { *rc = 5; }
1621
1622/* mixed underscore */
1623void C_subpgm_( int *rc );
1624void C_subpgm_( int *rc ) { *rc = 6; }
1625_EOF
1626dnl
1627dnl Compile the C function into object file.
1628dnl
1629pac_Ccompile='${CC-cc} -c $CFLAGS conftestc.c 1>&AC_FD_CC'
1630if AC_TRY_EVAL(pac_Ccompile) && test -s conftestc.${ac_objext} ; then
1631    pac_c_working=yes
1632else
1633    pac_c_working=no
1634    echo "configure: failed C program was:" >&AC_FD_CC
1635    cat conftestc.c >&AC_FD_CC
1636fi
1637dnl
1638rm -rf conftestf.dSYM
1639rm -f conftestf*
1640cat <<_EOF > conftestf.f
1641      program test
1642      integer rc
1643      rc = -1
1644      call c_subpgm( rc )
1645      write(6,*) "rc=", rc
1646      end
1647_EOF
1648dnl - compile the fortran program into object file
1649pac_Fcompile='${F77-f77} -c $FFLAGS conftestf.f 1>&AC_FD_CC'
1650if AC_TRY_EVAL(pac_Fcompile) && test -s conftestf.${ac_objext} ; then
1651    pac_f77_working=yes
1652else
1653    pac_f77_working=no
1654    echo "configure: failed F77 program was:" >&AC_FD_CC
1655    cat conftestf.f >&AC_FD_CC
1656fi
1657dnl
1658if test "$pac_c_working" = "yes" -a "$pac_f77_working" = "yes" ; then
1659dnl Try linking with F77 compiler
1660    rm -f conftest${ac_exeext}
1661    pac_link='$F77 $FFLAGS -o conftest${ac_exeext} conftestf.${ac_objext} conftestc.${ac_objext} $LDFLAGS >&AC_FD_CC'
1662    if AC_TRY_EVAL(pac_link) && test -s conftest${ac_exeext} ; then
1663        AC_MSG_RESULT(yes)
1664        rm -fr conftestf.dSYM conftestc.dSYM conftest.dSYM
1665        rm -f conftest*
1666    else
1667dnl     Try linking with C compiler
1668        rm -f conftest${ac_exeext}
1669        pac_link='$CC $CFLAGS -o conftest${ac_exeext} conftestf.${ac_objext} conftestc.${ac_objext} $LDFLAGS $FLIBS >&AC_FD_CC'
1670        if AC_TRY_EVAL(pac_link) && test -s conftest${ac_exeext} ; then
1671            AC_MSG_RESULT(yes)
1672            rm -fr conftestf.dSYM conftestc.dSYM conftest.dSYM
1673            rm -f conftest*
1674        else
1675            AC_MSG_RESULT(no)
1676            AC_CHECK_PROG(FILE, file, file, [])
1677            if test "X$FILE" != "X" ; then
1678                fobjtype="`${FILE} conftestf.${ac_objext} | sed -e \"s|conftestf\.${ac_objext}||g\"`"
1679                cobjtype="`${FILE} conftestc.${ac_objext} | sed -e \"s|conftestc\.${ac_objext}||g\"`"
1680                if test "$fobjtype" != "$cobjtype" ; then
1681                    AC_MSG_ERROR([****  Incompatible Fortran and C Object File Types!  ****
1682F77 Object File Type produced by \"${F77} ${FFLAGS}\" is : ${fobjtype}.
1683 C  Object File Type produced by \"${CC} ${CFLAGS}\" is : ${cobjtype}.])
1684                fi
1685            fi
1686        fi
1687    fi
1688else
1689    AC_MSG_RESULT([failed compilation])
1690fi
1691])
Note: See TracBrowser for help on using the browser.