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.]),
12 if test "x$withval" = "xno"
14 AC_REQUIRE([CHECK_F77])
15 AC_CHECK_SIZEOF_FORTRAN(integer)
19 if test "x$ac_cv_sizeof_fortran_integer" = "x8" ; then
20 AC_DEFINE(HAVE_F77INT64,[],
21 [The size of a Fortran integer, as computed by sizeof.])
22 test "x$ac_cv_sizeof_long" = "x8" || AC_MSG_ERROR([Size of C type long expected to be eight bytes])
24 CALCIUM_IDL_INT_F77="long long"
25 CALCIUM_CORBA_INT_F77="CORBA::LongLong"
26 elif test "x$ac_cv_sizeof_fortran_integer" = "x4" ; then
27 test "x$ac_cv_sizeof_int" = "x4" || AC_MSG_ERROR([Size of C type int expected to be four bytes])
29 CALCIUM_IDL_INT_F77="long"
30 CALCIUM_CORBA_INT_F77="CORBA::Long"
32 AC_MSG_ERROR([Size of Fortran type integer is neither four nor eigth bytes])
36 LONG_OR_INT="$withval"
37 CALCIUM_IDL_INT_F77="long"
38 CALCIUM_CORBA_INT_F77="CORBA::Long"
39 AC_MSG_NOTICE([Using C type $withval for cal_int])
42 AC_SUBST(CALCIUM_IDL_INT_F77)
43 AC_SUBST(CALCIUM_CORBA_INT_F77)
45 AC_DEFINE_UNQUOTED([CAL_INT],[$LONG_OR_INT],
46 [The C type to be used for mapping a Fortran integer in C within CALCIUM C/F77 interfaces.])