1 # Process this file with autoconf to produce a configure script.
2 # Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
3 # Contributed by Dave Love (d.love@dl.ac.uk).
5 #This file is part of GNU Fortran.
7 #GNU Fortran is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
12 #GNU Fortran is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #GNU General Public License for more details.
17 #You should have received a copy of the GNU General Public License
18 #along with GNU Fortran; see the file COPYING. If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 AC_INIT(libF77/Version.c)
26 dnl Checks for programs.
27 # For g77 we'll set CC to point at the built gcc, but this will get it into
31 dnl These should be inherited in the recursive make, but ensure they are
35 if test "$RANLIB"; then :
43 dnl Checks for header files.
44 # Sanity check for the cross-compilation case:
45 AC_CHECK_HEADER(stdio.h,:,
46 [AC_MSG_ERROR([Can't find stdio.h.
47 You must have a usable C system for the target already installed, at least
48 including headers and, preferably, the library, before you can configure
49 the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
50 then the target library, then build with \`LANGUAGES=f77'.])])
52 # We have to firkle with the info in hconfig.h to figure out suitable types
53 # (via com.h). proj.h and com.h are in $srcdir/.., config.h which they need
54 # is in ../.. and the config files are in $srcdir/../../config.
55 AC_MSG_CHECKING(f2c integer type)
57 ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config"
58 if test "$subdir" != . ; then
59 ac_cpp="$ac_cpp -I$srcdir/../gcc/f -I$srcdir/../gcc -I$srcdir/../gcc/config"
61 AC_CACHE_VAL(g77_cv_sys_f2cinteger,
62 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
63 AC_EGREP_CPP(F2C_INTEGER=long int,
65 #define FFECOM_DETERMINE_TYPES 1
67 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
69 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
72 # error "Cannot find a suitable type for F2C_INTEGER"
75 g77_cv_sys_f2cinteger="long int",)
76 if test "$g77_cv_sys_f2cinteger" = ""; then
77 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
78 AC_EGREP_CPP(F2C_INTEGER=int,
80 #define FFECOM_DETERMINE_TYPES 1
82 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
84 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
87 # error "Cannot find a suitable type for F2C_INTEGER"
90 g77_cv_sys_f2cinteger=int,)
92 if test "$g77_cv_sys_f2cinteger" = ""; then
94 AC_MSG_ERROR([Can't determine type for f2c integer; config.log may help.])
97 AC_MSG_RESULT($g77_cv_sys_f2cinteger)
98 F2C_INTEGER=$g77_cv_sys_f2cinteger
100 AC_SUBST(F2C_INTEGER)
102 AC_MSG_CHECKING(f2c long int type)
104 ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config"
105 if test "$subdir" != . ; then
106 ac_cpp="$ac_cpp -I$srcdir/../gcc/f -I$srcdir/../gcc -I$srcdir/../gcc/config"
108 AC_CACHE_VAL(g77_cv_sys_f2clongint,
109 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
110 AC_EGREP_CPP(F2C_LONGINT=long int,
112 #define FFECOM_DETERMINE_TYPES 1
114 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
116 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
117 F2C_LONGINT=long long int
119 # error "Cannot find a suitable type for F2C_LONGINT"
122 g77_cv_sys_f2clongint="long int",)
123 if test "$g77_cv_sys_f2clongint" = ""; then
124 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
125 AC_EGREP_CPP(F2C_LONGINT=long long int,
127 #define FFECOM_DETERMINE_TYPES 1
129 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
131 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
132 F2C_LONGINT=long long int
134 # error "Cannot find a suitable type for F2C_LONGINT"
137 g77_cv_sys_f2clongint="long long int",)
139 if test "$g77_cv_sys_f2clongint" = ""; then
141 AC_MSG_ERROR([Can't determine type for f2c long int; config.log may help.])
144 AC_MSG_RESULT($g77_cv_sys_f2clongint)
145 F2C_LONGINT=$g77_cv_sys_f2clongint
147 AC_SUBST(F2C_LONGINT)
149 # avoid confusion in case the `makefile's from the f2c distribution have
151 test -f libF77/makefile && mv libF77/makefile libF77/makefile.ori
152 test -f libI77/makefile && mv libI77/makefile libI77/makefile.ori
153 test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori
155 # Get the version trigger filename from the toplevel
156 if [[ "${with_gcc_version_trigger+set}" = set ]]; then
157 gcc_version_trigger=$with_gcc_version_trigger
158 gcc_version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${gcc_version_trigger}`
164 AC_SUBST(gcc_version)
165 AC_SUBST(gcc_version_trigger)
167 AC_SUBST(target_alias)
169 AC_CONFIG_SUBDIRS(libU77 libI77 libF77)
170 AC_OUTPUT(Makefile g2c.h:g2c.hin)
173 dnl comment-start: "dnl "
175 dnl comment-start-skip: "\\bdnl\\b\\s *"