OSDN Git Service

4ede47733e986b5ac19852ca6335571abc5215c2
[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 dnl Checks for programs.
25 # For g77 we'll set CC to point at the built gcc, but this will get it into
26 # the makefiles
27 AC_PROG_CC
28
29 dnl These should be inherited in the recursive make, but ensure they are
30 dnl defined:
31 test "$AR" || AR=ar
32 AC_SUBST(AR)
33 if test "$RANLIB"; then :
34   AC_SUBST(RANLIB)
35 else
36   AC_PROG_RANLIB
37 fi
38 AC_PROG_INSTALL
39 AC_PROG_MAKE_SET
40
41 dnl Checks for header files.
42 # Sanity check for the cross-compilation case:
43 AC_CHECK_HEADER(stdio.h,:,
44   [AC_MSG_ERROR([Can't find stdio.h.
45 You must have a usable C system for the target already installed, at least
46 including headers and, preferably, the library, before you can configure
47 the G77 runtime system.  If necessary, install gcc now with \`LANGUAGES=c',
48 then the target library, then build with \`LANGUAGES=f77'.])])
49
50 # We have to firkle with the info in hconfig.h to figure out suitable types
51 # (via com.h).  proj.h and com.h are in gcc/f/, config.h which they need
52 # is in gcc/ and the config files are in gcc/config/.
53 AC_MSG_CHECKING(f2c integer type)
54 late_ac_cpp=$ac_cpp
55 ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config"
56 if test "$srcdir" != . ; then
57   ac_cpp="$ac_cpp -I$srcdir/../gcc/f -I$srcdir/../gcc -I$srcdir/../gcc/config"
58 fi
59 AC_CACHE_VAL(g77_cv_sys_f2cinteger,
60 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
61 AC_EGREP_CPP(F2C_INTEGER=long int,
62 [#include "proj.h"
63 #define FFECOM_DETERMINE_TYPES 1
64 #include "com.h"
65 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
66 F2C_INTEGER=long int
67 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
68 F2C_INTEGER=int
69 #else
70 #  error "Cannot find a suitable type for F2C_INTEGER"
71 #endif
72 ],
73  g77_cv_sys_f2cinteger="long int",)
74 if test "$g77_cv_sys_f2cinteger" = ""; then
75 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
76   AC_EGREP_CPP(F2C_INTEGER=int,
77 [#include "proj.h"
78 #define FFECOM_DETERMINE_TYPES 1
79 #include "com.h"
80 #if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
81 F2C_INTEGER=long int
82 #elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
83 F2C_INTEGER=int
84 #else
85 #  error "Cannot find a suitable type for F2C_INTEGER"
86 #endif
87 ],
88    g77_cv_sys_f2cinteger=int,)
89 fi
90 if test "$g77_cv_sys_f2cinteger" = ""; then
91   AC_MSG_RESULT("")
92   AC_MSG_ERROR([Can't determine type for f2c integer; config.log may help.])
93 fi
94 )
95 AC_MSG_RESULT($g77_cv_sys_f2cinteger)
96 F2C_INTEGER=$g77_cv_sys_f2cinteger
97 ac_cpp=$late_ac_cpp
98 AC_SUBST(F2C_INTEGER)
99
100 AC_MSG_CHECKING(f2c long int type)
101 late_ac_cpp=$ac_cpp
102 ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config"
103 if test "$srcdir" != . ; then
104   ac_cpp="$ac_cpp -I$srcdir/../gcc/f -I$srcdir/../gcc -I$srcdir/../gcc/config"
105 fi
106 AC_CACHE_VAL(g77_cv_sys_f2clongint,
107 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
108 AC_EGREP_CPP(F2C_LONGINT=long int,
109 [#include "proj.h"
110 #define FFECOM_DETERMINE_TYPES 1
111 #include "com.h"
112 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
113 F2C_LONGINT=long int
114 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
115 F2C_LONGINT=long long int
116 #else
117 #  error "Cannot find a suitable type for F2C_LONGINT"
118 #endif
119 ],
120  g77_cv_sys_f2clongint="long int",)
121 if test "$g77_cv_sys_f2clongint" = ""; then
122 echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
123   AC_EGREP_CPP(F2C_LONGINT=long long int,
124 [#include "proj.h"
125 #define FFECOM_DETERMINE_TYPES 1
126 #include "com.h"
127 #if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
128 F2C_LONGINT=long int
129 #elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
130 F2C_LONGINT=long long int
131 #else
132 #  error "Cannot find a suitable type for F2C_LONGINT"
133 #endif
134 ],
135    g77_cv_sys_f2clongint="long long int",)
136 fi
137 if test "$g77_cv_sys_f2clongint" = ""; then
138   AC_MSG_RESULT("")
139   AC_MSG_ERROR([Can't determine type for f2c long int; config.log may help.])
140 fi
141 )
142 AC_MSG_RESULT($g77_cv_sys_f2clongint)
143 F2C_LONGINT=$g77_cv_sys_f2clongint
144 ac_cpp=$late_ac_cpp
145 AC_SUBST(F2C_LONGINT)
146
147 # avoid confusion in case the `makefile's from the f2c distribution have
148 # got put here
149 test -f libF77/makefile && mv libF77/makefile  libF77/makefile.ori
150 test -f libI77/makefile && mv libI77/makefile  libI77/makefile.ori
151 test -f libU77/makefile && mv libU77/makefile  libU77/makefile.ori
152
153 # Get the version trigger filename from the toplevel
154 if [[ "${with_gcc_version_trigger+set}" = set ]]; then
155         gcc_version_trigger=$with_gcc_version_trigger
156         gcc_version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${gcc_version_trigger}`
157 else
158         gcc_version_trigger=
159         gcc_version=UNKNOWN
160 fi
161
162 AC_SUBST(gcc_version)
163 AC_SUBST(gcc_version_trigger)
164 AC_CANONICAL_SYSTEM
165 AC_SUBST(target_alias)
166
167 AC_CONFIG_SUBDIRS(libU77 libI77 libF77)
168 AC_OUTPUT(Makefile g2c.h:g2c.hin)
169
170 dnl Local Variables:
171 dnl comment-start: "dnl "
172 dnl comment-end: ""
173 dnl comment-start-skip: "\\bdnl\\b\\s *"
174 dnl End: