Salome HOME
To see which hdf5 we're using in configure log
[modules/kernel.git] / salome_adm / unix / config_files / check_calcium.m4
1 AC_DEFUN([CHECK_CALCIUM], [
2
3 ## Guess where as cal_int type is provided by --with-cal_int option
4 ## or auto-detection must be used
5
6 AC_ARG_WITH([cal_int],
7             AC_HELP_STRING([--with-cal_int=<C type>],
8                            [Use <C type> for mapping a Fortran integer in C within CALCIUM C/F77 interfaces.]),
9             [],
10             [withval=no])
11
12 AC_CHECK_SIZEOF(long)
13 AC_CHECK_SIZEOF(int)
14
15 if test "x$withval" = "xno"
16 then
17   AC_REQUIRE([CHECK_F77])
18   AC_CHECK_SIZEOF_FORTRAN(integer)
19
20   if test "x$ac_cv_sizeof_fortran_integer" = "x8" ; then
21      AC_DEFINE(HAVE_F77INT64,[],
22                        [The size of a Fortran integer, as computed by sizeof.])
23      test "x$ac_cv_sizeof_long" = "x8" || AC_MSG_ERROR([Size of C type long expected to be eight bytes])
24      LONG_OR_INT="long"
25      CALCIUM_IDL_INT_F77="long long"
26      CALCIUM_CORBA_INT_F77="CORBA::LongLong"
27   elif test "x$ac_cv_sizeof_fortran_integer" = "x4" ; then
28      test "x$ac_cv_sizeof_int" = "x4" || AC_MSG_ERROR([Size of C type int expected to be four bytes])
29      LONG_OR_INT="int"
30      CALCIUM_IDL_INT_F77="long"
31      CALCIUM_CORBA_INT_F77="CORBA::Long"
32   else
33      AC_MSG_ERROR([Size of Fortran type integer is neither four nor eigth bytes])
34   fi
35
36 elif test "x$withval" = "xint"
37 then
38   LONG_OR_INT="int" 
39   CALCIUM_IDL_INT_F77="long"
40   CALCIUM_CORBA_INT_F77="CORBA::Long"
41   AC_MSG_NOTICE([Using C type int for cal_int])
42
43 elif test "x$withval" = "xlong"
44 then
45   LONG_OR_INT="long"
46   CALCIUM_IDL_INT_F77="long long"
47   CALCIUM_CORBA_INT_F77="CORBA::LongLong"
48   AC_MSG_NOTICE([Using C type long for cal_int])
49 else
50   AC_MSG_ERROR([Fortran type integer must be mapped to C type int or C type long]) 
51 fi
52
53 AC_SUBST(CALCIUM_IDL_INT_F77)
54 AC_SUBST(CALCIUM_CORBA_INT_F77)
55 AC_SUBST(LONG_OR_INT)
56 AC_DEFINE_UNQUOTED([CAL_INT],[$LONG_OR_INT],
57          [The C type to be used for mapping a Fortran integer in C within CALCIUM C/F77 interfaces.])
58 ])