Salome HOME
To see which hdf5 we're using in configure log
[modules/kernel.git] / salome_adm / unix / config_files / ac_check_sizeof_fortran.m4
1 AC_DEFUN([AC_CHECK_SIZEOF_FORTRAN], [
2   AC_REQUIRE([AC_F77_WRAPPERS])
3   AC_CACHE_CHECK([size of Fortran [$1]], [ac_cv_sizeof_fortran_[]translit($1, [A-Z *], [a-z_p])],[
4     AC_LANG_SAVE()
5     AC_LANG([Fortran 77])
6     AC_COMPILE_IFELSE([
7       AC_LANG_SOURCE([
8         subroutine fsize()
9         $1 i(2)
10         call csize(i(1), i(2))
11         end
12       ])
13     ],[
14       AC_LANG([C])
15       cp conftest.$ac_objext conftestf.$ac_objext
16       old_LDFLAGS="$LDFLAGS"
17       LDFLAGS="conftestf.$ac_objext $LDFLAGS"
18 #"$ac_cv_f77_libs"
19       AC_TRY_RUN([
20 #       include <stdio.h>
21 #         define CSIZE F77_FUNC(csize,CSIZE)
22 #         define FSIZE F77_FUNC(fsize,FSIZE)
23         static long size_val;
24         /* Called by Fortran */
25         void CSIZE (i1p, i2p)
26         char *i1p, *i2p;
27         {
28           size_val = (i2p - i1p);
29         }
30         main() {
31           FILE *f=fopen ("conftestval","w");
32           if (!f) return 1;
33           /* Call the Fortran function */
34           FSIZE ();
35           fprintf (f, "%d\n", size_val);
36           return 0;
37         }
38      ])
39      LDFLAGS="$old_LDFLAGS"
40      ac_cv_sizeof_fortran_[]translit($1, [A-Z *], [a-z_p])=`cat conftestval`
41      rm -f conftestval conftestf.$ac_objext
42     ])
43     AC_LANG_RESTORE()
44   ])
45   AC_DEFINE_UNQUOTED(SIZEOF_FORTRAN_[]translit($1, [a-z *], [A-Z_p]),
46                      [$ac_cv_sizeof_fortran_[]translit($1, [A-Z *], [a-z_p])],
47                      [The size of a Fortran `$1', as computed by sizeof.])
48
49 ])