1 AC_DEFUN([CHECK_CALCIUM], [
3 ## Guess where as cal_int type is provided by --with-cal_int option
4 ## or auto-detection must be used
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.]),
15 if test "x$withval" = "xno"
17 AC_REQUIRE([CHECK_F77])
18 AC_CHECK_SIZEOF_FORTRAN(integer)
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])
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])
30 CALCIUM_IDL_INT_F77="long"
31 CALCIUM_CORBA_INT_F77="CORBA::Long"
33 AC_MSG_ERROR([Size of Fortran type integer is neither four nor eigth bytes])
36 elif test "x$withval" = "xint"
39 CALCIUM_IDL_INT_F77="long"
40 CALCIUM_CORBA_INT_F77="CORBA::Long"
41 AC_MSG_NOTICE([Using C type int for cal_int])
43 elif test "x$withval" = "xlong"
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])
50 AC_MSG_ERROR([Fortran type integer must be mapped to C type int or C type long])
53 AC_SUBST(CALCIUM_IDL_INT_F77)
54 AC_SUBST(CALCIUM_CORBA_INT_F77)
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.])