1 dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 AC_DEFUN([CHECK_CALCIUM], [
22 ## Guess where as cal_int type is provided by --with-cal_int option
23 ## or auto-detection must be used
25 AC_ARG_WITH([cal_int],
26 AC_HELP_STRING([--with-cal_int=<C type>],
27 [Use <C type> for mapping a Fortran integer in C within CALCIUM C/F77 interfaces.]),
34 if test "x$withval" = "xno"
36 AC_REQUIRE([CHECK_F77])
37 AC_CHECK_SIZEOF_FORTRAN(integer)
39 if test "x$ac_cv_sizeof_fortran_integer" = "x8" ; then
40 AC_DEFINE(HAVE_F77INT64,[],
41 [The size of a Fortran integer, as computed by sizeof.])
42 test "x$ac_cv_sizeof_long" = "x8" || AC_MSG_ERROR([Size of C type long expected to be eight bytes])
44 CALCIUM_IDL_INT_F77="long long"
45 CALCIUM_CORBA_INT_F77="CORBA::LongLong"
46 elif test "x$ac_cv_sizeof_fortran_integer" = "x4" ; then
47 test "x$ac_cv_sizeof_int" = "x4" || AC_MSG_ERROR([Size of C type int expected to be four bytes])
49 CALCIUM_IDL_INT_F77="long"
50 CALCIUM_CORBA_INT_F77="CORBA::Long"
52 AC_MSG_ERROR([Size of Fortran type integer is neither four nor eigth bytes])
55 elif test "x$withval" = "xint"
58 CALCIUM_IDL_INT_F77="long"
59 CALCIUM_CORBA_INT_F77="CORBA::Long"
60 AC_MSG_NOTICE([Using C type int for cal_int])
62 elif test "x$withval" = "xlong"
65 CALCIUM_IDL_INT_F77="long long"
66 CALCIUM_CORBA_INT_F77="CORBA::LongLong"
67 AC_MSG_NOTICE([Using C type long for cal_int])
69 AC_MSG_ERROR([Fortran type integer must be mapped to C type int or C type long])
72 AC_SUBST(CALCIUM_IDL_INT_F77)
73 AC_SUBST(CALCIUM_CORBA_INT_F77)
75 AC_DEFINE_UNQUOTED([CAL_INT],[$LONG_OR_INT],
76 [The C type to be used for mapping a Fortran integer in C within CALCIUM C/F77 interfaces.])