OSDN Git Service

* g2c.hin: Renamed from g2c.h.in.
[pf3gnuchains/gcc-fork.git] / libf2c / configure.in
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).
4 #
5 #This file is part of GNU Fortran.
6 #
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)
10 #any later version.
11 #
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.
16 #
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
20 #02111-1307, USA.
21
22 AC_INIT(libF77/Version.c)
23
24 AC_REVISION(1.12)
25
26 dnl Checks for programs.
27 # For g77 we'll set CC to point at the built gcc, but this will get it into
28 # the makefiles
29 AC_PROG_CC
30
31 dnl These should be inherited in the recursive make, but ensure they are
32 dnl defined:
33 test "$AR" || AR=ar
34 AC_SUBST(AR)
35 if test "$RANLIB"; then :
36   AC_SUBST(RANLIB)
37 else
38   AC_PROG_RANLIB
39 fi
40 AC_PROG_INSTALL
41 AC_PROG_MAKE_SET
42
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'.])])
51
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)
56 late_ac_cpp=$ac_cpp
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"
60 fi
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,
64 [#include "proj.h"
65 #define FFECOM_DETERMINE_TYPES 1
66 #include "com.h"
67 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
68 F2C_INTEGER=long int
69 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
70 F2C_INTEGER=int
71 #else
72 #  error "Cannot find a suitable type for F2C_INTEGER"
73 #endif
74 ],
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,
79 [#include "proj.h"
80 #define FFECOM_DETERMINE_TYPES 1
81 #include "com.h"
82 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
83 F2C_INTEGER=long int
84 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
85 F2C_INTEGER=int
86 #else
87 #  error "Cannot find a suitable type for F2C_INTEGER"
88 #endif
89 ],
90    g77_cv_sys_f2cinteger=int,)
91 fi
92 if test "$g77_cv_sys_f2cinteger" = ""; then
93   AC_MSG_RESULT("")
94   AC_MSG_ERROR([Can't determine type for f2c integer; config.log may help.])
95 fi
96 )
97 AC_MSG_RESULT($g77_cv_sys_f2cinteger)
98 F2C_INTEGER=$g77_cv_sys_f2cinteger
99 ac_cpp=$late_ac_cpp
100 AC_SUBST(F2C_INTEGER)
101
102 AC_MSG_CHECKING(f2c long int type)
103 late_ac_cpp=$ac_cpp
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"
107 fi
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,
111 [#include "proj.h"
112 #define FFECOM_DETERMINE_TYPES 1
113 #include "com.h"
114 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
115 F2C_LONGINT=long int
116 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
117 F2C_LONGINT=long long int
118 #else
119 #  error "Cannot find a suitable type for F2C_LONGINT"
120 #endif
121 ],
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,
126 [#include "proj.h"
127 #define FFECOM_DETERMINE_TYPES 1
128 #include "com.h"
129 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
130 F2C_LONGINT=long int
131 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
132 F2C_LONGINT=long long int
133 #else
134 #  error "Cannot find a suitable type for F2C_LONGINT"
135 #endif
136 ],
137    g77_cv_sys_f2clongint="long long int",)
138 fi
139 if test "$g77_cv_sys_f2clongint" = ""; then
140   AC_MSG_RESULT("")
141   AC_MSG_ERROR([Can't determine type for f2c long int; config.log may help.])
142 fi
143 )
144 AC_MSG_RESULT($g77_cv_sys_f2clongint)
145 F2C_LONGINT=$g77_cv_sys_f2clongint
146 ac_cpp=$late_ac_cpp
147 AC_SUBST(F2C_LONGINT)
148
149 # avoid confusion in case the `makefile's from the f2c distribution have
150 # got put here
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
154
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}`
159 else
160         gcc_version_trigger=
161         gcc_version=UNKNOWN
162 fi
163
164 AC_SUBST(gcc_version)
165 AC_SUBST(gcc_version_trigger)
166 AC_CANONICAL_SYSTEM
167 AC_SUBST(target_alias)
168
169 AC_CONFIG_SUBDIRS(libU77 libI77 libF77)
170 AC_OUTPUT(Makefile g2c.h:g2c.hin)
171
172 dnl Local Variables:
173 dnl comment-start: "dnl "
174 dnl comment-end: ""
175 dnl comment-start-skip: "\\bdnl\\b\\s *"
176 dnl End: