configure.in: Test for __g77_integer...

* configure.in: Test for __g77_integer, __g77_uinteger,
        __g77_longint, and __g77_ulongint builtin types, rather
        than mucking around with compiler headers.
        * configure: Regenerate.
        * g2c.hin (integer, logical, flag, ftnlen, ftnint): Use
        __g77_integer rather than autoconfigured value.
        (uinteger): Use __g77_uinteger rather than autoconfigured value.
        (longint): Use __g77_longint rather than autoconfigured value.
        (ulongint): Use __g77_ulongint rather than autoconfigured value.

From-SVN: r33990
This commit is contained in:
Chris Demetriou 2000-05-18 10:44:27 -07:00 committed by Richard Henderson
parent fcd4823055
commit 3eb10f8a4f
4 changed files with 68 additions and 273 deletions

View File

@ -1,3 +1,15 @@
2000-05-18 Chris Demetriou <cgd@sibyte.com>
* configure.in: Test for __g77_integer, __g77_uinteger,
__g77_longint, and __g77_ulongint builtin types, rather
than mucking around with compiler headers.
* configure: Regenerate.
* g2c.hin (integer, logical, flag, ftnlen, ftnint): Use
__g77_integer rather than autoconfigured value.
(uinteger): Use __g77_uinteger rather than autoconfigured value.
(longint): Use __g77_longint rather than autoconfigured value.
(ulongint): Use __g77_ulongint rather than autoconfigured value.
Sun Mar 12 20:12;30 2000 Toon Moene <toon@moene.indiv.nluug.nl> Sun Mar 12 20:12;30 2000 Toon Moene <toon@moene.indiv.nluug.nl>
Based on work done by David M. Gay (Bell Labs) Based on work done by David M. Gay (Bell Labs)
@ -185,9 +197,9 @@ Sat Apr 24 11:02:48 1999 Craig Burley <craig@jcb-sc.com>
Sat Apr 17 17:33:30 1999 Craig Burley <craig@jcb-sc.com> Sat Apr 17 17:33:30 1999 Craig Burley <craig@jcb-sc.com>
From H.J. Lu <hjl@gnu.org>: From H.J. Lu <hjl@gnu.org>:
* Makefile.in (s-libi77): Depend on i77. * Makefile.in (s-libi77): Depend on i77.
(s-libf77): Depend on i77. (s-libf77): Depend on i77.
(s-libu77): Depend on u77. (s-libu77): Depend on u77.
Mon Apr 12 21:38:14 1999 Mumit Khan <khan@xraylith.wisc.edu> Mon Apr 12 21:38:14 1999 Mumit Khan <khan@xraylith.wisc.edu>
@ -216,11 +228,11 @@ Wed Mar 31 13:50:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure: Rebuilt. * configure: Rebuilt.
* configure.in: Fix integer size tests: sanity check first; search * configure.in: Fix integer size tests: sanity check first; search
toplevel include dir (from Rainer Orth); only mess with ac_cpp toplevel include dir (from Rainer Orth); only mess with ac_cpp
once; use -DIN_GCC -DHAVE_CONFIG_H. once; use -DIN_GCC -DHAVE_CONFIG_H.
* configure.in: Use `g77_cv_...', not `f77_cv_...'. * configure.in: Use `g77_cv_...', not `f77_cv_...'.
Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu> Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu>

181
libf2c/configure vendored
View File

@ -1057,171 +1057,42 @@ then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
fi fi
# We have to firkle with the info in hconfig.h to figure out suitable types echo $ac_n "checking for built-in g77 integer types""... $ac_c" 1>&6
# (via com.h). proj.h and com.h are in gcc/f/, config.h which they need echo "configure:1062: checking for built-in g77 integer types" >&5
# is in gcc/ and the config files are in gcc/config/. if eval "test \"`echo '$''{'libf2c_cv_has_g77_builtin_types'+set}'`\" = set"; then
echo $ac_n "checking f2c integer type""... $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
echo "configure:1065: checking f2c integer type" >&5 else
# Set this back later below! cat > conftest.$ac_ext <<EOF
late_ac_cpp=$ac_cpp #line 1067 "configure"
late_cflags=$CFLAGS
extra_includes="-I$topsrcdir/gcc/f -I$topsrcdir/gcc -I$topsrcdir/include -I$topsrcdir/gcc/config -I$r/gcc"
ac_cpp="$late_ac_cpp -DIN_GCC -DHAVE_CONFIG_H $extra_includes"
# The AC_EGREP_CPPs below have been known to fail when the header
# path is wrong after things have been moved about; the cpp error status
# counts for nothing. First check that there aren't any errors from
# the headers.
CFLAGS="$CFLAGS -DHAVE_CONFIG_H -DIN_GCC $extra_includes"
cat > conftest.$ac_ext <<EOF
#line 1078 "configure"
#include "confdefs.h" #include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
int main() {
int main() {
__g77_integer g77i;
__g77_uinteger g77ui;
__g77_longint g77l;
__g77_ulongint g77ul;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
: rm -rf conftest*
libf2c_cv_has_g77_builtin_types=yes
else else
echo "configure: failed program was:" >&5 echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5 cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
{ echo "configure: error: Can't run check for integer sizes -- see config.log" 1>&2; exit 1; } libf2c_cv_has_g77_builtin_types=no
fi fi
rm -f conftest* rm -f conftest*
CFLAGS=$late_cflags
if eval "test \"`echo '$''{'g77_cv_sys_f2cinteger'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo "configure:1101: using $ac_cpp" >&5
cat > conftest.$ac_ext <<EOF
#line 1103 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
F2C_INTEGER=long int
#elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
F2C_INTEGER=int
#else
# error "Cannot find a suitable type for F2C_INTEGER"
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "F2C_INTEGER=long int" >/dev/null 2>&1; then
rm -rf conftest*
g77_cv_sys_f2cinteger="long int"
fi
rm -f conftest*
if test "$g77_cv_sys_f2cinteger" = ""; then
echo "configure:1125: using $ac_cpp" >&5
cat > conftest.$ac_ext <<EOF
#line 1127 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
F2C_INTEGER=long int
#elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
F2C_INTEGER=int
#else
# error "Cannot find a suitable type for F2C_INTEGER"
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "F2C_INTEGER=int" >/dev/null 2>&1; then
rm -rf conftest*
g77_cv_sys_f2cinteger=int
fi
rm -f conftest*
fi
if test "$g77_cv_sys_f2cinteger" = ""; then
echo "$ac_t""""" 1>&6
{ echo "configure: error: Can't determine type for f2c integer; config.log may help." 1>&2; exit 1; }
fi fi
echo "$ac_t""$libf2c_cv_has_g77_builtin_types" 1>&6
if test $libf2c_cv_has_g77_builtin_types = no; then
{ echo "configure: error: gcc doesn't define all of the built in types __g77_integer,
__g77_uinteger, __g77_longint, and __g77_ulongint. You may not be using
a new enough version of gcc, or your target may not have type sizes which
accommodate those types." 1>&2; exit 1; }
fi fi
echo "$ac_t""$g77_cv_sys_f2cinteger" 1>&6
F2C_INTEGER=$g77_cv_sys_f2cinteger
echo $ac_n "checking f2c long int type""... $ac_c" 1>&6
echo "configure:1161: checking f2c long int type" >&5
if eval "test \"`echo '$''{'g77_cv_sys_f2clongint'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo "configure:1165: using $ac_cpp" >&5
cat > conftest.$ac_ext <<EOF
#line 1167 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
F2C_LONGINT=long int
#elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
F2C_LONGINT=long long int
#else
# error "Cannot find a suitable type for F2C_LONGINT"
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "F2C_LONGINT=long int" >/dev/null 2>&1; then
rm -rf conftest*
g77_cv_sys_f2clongint="long int"
fi
rm -f conftest*
if test "$g77_cv_sys_f2clongint" = ""; then
echo "configure:1190: using $ac_cpp" >&5
cat > conftest.$ac_ext <<EOF
#line 1192 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
F2C_LONGINT=long int
#elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
F2C_LONGINT=long long int
#else
# error "Cannot find a suitable type for F2C_LONGINT"
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "F2C_LONGINT=long long int" >/dev/null 2>&1; then
rm -rf conftest*
g77_cv_sys_f2clongint="long long int"
fi
rm -f conftest*
fi
if test "$g77_cv_sys_f2clongint" = ""; then
echo "$ac_t""""" 1>&6
{ echo "configure: error: Can't determine type for f2c long int; config.log may help." 1>&2; exit 1; }
fi
fi
echo "$ac_t""$g77_cv_sys_f2clongint" 1>&6
F2C_LONGINT=$g77_cv_sys_f2clongint
ac_cpp=$late_ac_cpp
# avoid confusion in case the `makefile's from the f2c distribution have # avoid confusion in case the `makefile's from the f2c distribution have
# got put here # got put here
test -f libF77/makefile && mv libF77/makefile libF77/makefile.ori test -f libF77/makefile && mv libF77/makefile libF77/makefile.ori
@ -1267,7 +1138,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi fi
echo $ac_n "checking host system type""... $ac_c" 1>&6 echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:1271: checking host system type" >&5 echo "configure:1142: checking host system type" >&5
host_alias=$host host_alias=$host
case "$host_alias" in case "$host_alias" in
@ -1288,7 +1159,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6 echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:1292: checking target system type" >&5 echo "configure:1163: checking target system type" >&5
target_alias=$target target_alias=$target
case "$target_alias" in case "$target_alias" in
@ -1306,7 +1177,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6 echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:1310: checking build system type" >&5 echo "configure:1181: checking build system type" >&5
build_alias=$build build_alias=$build
case "$build_alias" in case "$build_alias" in
@ -1487,8 +1358,6 @@ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@SET_MAKE@%$SET_MAKE%g s%@SET_MAKE@%$SET_MAKE%g
s%@CPP@%$CPP%g s%@CPP@%$CPP%g
s%@F2C_INTEGER@%$F2C_INTEGER%g
s%@F2C_LONGINT@%$F2C_LONGINT%g
s%@gcc_version@%$gcc_version%g s%@gcc_version@%$gcc_version%g
s%@gcc_version_trigger@%$gcc_version_trigger%g s%@gcc_version_trigger@%$gcc_version_trigger%g
s%@host@%$host%g s%@host@%$host%g

View File

@ -89,109 +89,23 @@ including headers and, preferably, the library, before you can configure
the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c', the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
then the target library, then build with \`LANGUAGES=f77'.])]) then the target library, then build with \`LANGUAGES=f77'.])])
# We have to firkle with the info in hconfig.h to figure out suitable types dnl Checks for g77 integer types built into gcc's C front end.
# (via com.h). proj.h and com.h are in gcc/f/, config.h which they need AC_MSG_CHECKING(for built-in g77 integer types)
# is in gcc/ and the config files are in gcc/config/. AC_CACHE_VAL(libf2c_cv_has_g77_builtin_types,
AC_MSG_CHECKING(f2c integer type) [AC_TRY_COMPILE(,
# Set this back later below! [__g77_integer g77i;
late_ac_cpp=$ac_cpp __g77_uinteger g77ui;
late_cflags=$CFLAGS __g77_longint g77l;
extra_includes="-I$topsrcdir/gcc/f -I$topsrcdir/gcc -I$topsrcdir/include -I$topsrcdir/gcc/config -I$r/gcc" __g77_ulongint g77ul;],
ac_cpp="$late_ac_cpp -DIN_GCC -DHAVE_CONFIG_H $extra_includes" libf2c_cv_has_g77_builtin_types=yes,
libf2c_cv_has_g77_builtin_types=no)])
# The AC_EGREP_CPPs below have been known to fail when the header AC_MSG_RESULT($libf2c_cv_has_g77_builtin_types)
# path is wrong after things have been moved about; the cpp error status if test $libf2c_cv_has_g77_builtin_types = no; then
# counts for nothing. First check that there aren't any errors from AC_MSG_ERROR([gcc doesn't define all of the built in types __g77_integer,
# the headers. __g77_uinteger, __g77_longint, and __g77_ulongint. You may not be using
CFLAGS="$CFLAGS -DHAVE_CONFIG_H -DIN_GCC $extra_includes" a new enough version of gcc, or your target may not have type sizes which
AC_TRY_COMPILE([#include "proj.h" accommodate those types.])
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"],,,
AC_MSG_ERROR([Can't run check for integer sizes -- see config.log]))
CFLAGS=$late_cflags
AC_CACHE_VAL(g77_cv_sys_f2cinteger,
echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
AC_EGREP_CPP(F2C_INTEGER=long int,
[#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
F2C_INTEGER=long int
#elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
F2C_INTEGER=int
#else
# error "Cannot find a suitable type for F2C_INTEGER"
#endif
],
g77_cv_sys_f2cinteger="long int",)
if test "$g77_cv_sys_f2cinteger" = ""; then
echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
AC_EGREP_CPP(F2C_INTEGER=int,
[#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cINTEGER == FFECOM_f2ccodeLONG
F2C_INTEGER=long int
#elif FFECOM_f2cINTEGER == FFECOM_f2ccodeINT
F2C_INTEGER=int
#else
# error "Cannot find a suitable type for F2C_INTEGER"
#endif
],
g77_cv_sys_f2cinteger=int,)
fi fi
if test "$g77_cv_sys_f2cinteger" = ""; then
AC_MSG_RESULT("")
AC_MSG_ERROR([Can't determine type for f2c integer; config.log may help.])
fi
)
AC_MSG_RESULT($g77_cv_sys_f2cinteger)
F2C_INTEGER=$g77_cv_sys_f2cinteger
AC_SUBST(F2C_INTEGER)
AC_MSG_CHECKING(f2c long int type)
AC_CACHE_VAL(g77_cv_sys_f2clongint,
echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
AC_EGREP_CPP(F2C_LONGINT=long int,
[#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
F2C_LONGINT=long int
#elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
F2C_LONGINT=long long int
#else
# error "Cannot find a suitable type for F2C_LONGINT"
#endif
],
g77_cv_sys_f2clongint="long int",)
if test "$g77_cv_sys_f2clongint" = ""; then
echo "configure:__oline__: using $ac_cpp" >&AC_FD_CC
AC_EGREP_CPP(F2C_LONGINT=long long int,
[#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
#if FFECOM_f2cLONGINT == FFECOM_f2ccodeLONG
F2C_LONGINT=long int
#elif FFECOM_f2cLONGINT == FFECOM_f2ccodeLONGLONG
F2C_LONGINT=long long int
#else
# error "Cannot find a suitable type for F2C_LONGINT"
#endif
],
g77_cv_sys_f2clongint="long long int",)
fi
if test "$g77_cv_sys_f2clongint" = ""; then
AC_MSG_RESULT("")
AC_MSG_ERROR([Can't determine type for f2c long int; config.log may help.])
fi
)
AC_MSG_RESULT($g77_cv_sys_f2clongint)
F2C_LONGINT=$g77_cv_sys_f2clongint
AC_SUBST(F2C_LONGINT)
ac_cpp=$late_ac_cpp
# avoid confusion in case the `makefile's from the f2c distribution have # avoid confusion in case the `makefile's from the f2c distribution have
# got put here # got put here

View File

@ -18,20 +18,20 @@
/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ /* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */
/* we assume short, float are OK */ /* we assume short, float are OK */
typedef @F2C_INTEGER@ /* long int */ integer; typedef __g77_integer integer;
typedef unsigned @F2C_INTEGER@ /* long */ uinteger; typedef __g77_uinteger uinteger;
typedef char *address; typedef char *address;
typedef short int shortint; typedef short int shortint;
typedef float real; typedef float real;
typedef double doublereal; typedef double doublereal;
typedef struct { real r, i; } complex; typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex; typedef struct { doublereal r, i; } doublecomplex;
typedef @F2C_INTEGER@ /* long int */ logical; typedef __g77_integer logical;
typedef short int shortlogical; typedef short int shortlogical;
typedef char logical1; typedef char logical1;
typedef char integer1; typedef char integer1;
typedef @F2C_LONGINT@ /* long long */ longint; /* system-dependent */ typedef __g77_longint longint; /* system-dependent */
typedef unsigned @F2C_LONGINT@ /* long long */ ulongint; /* system-dependent */ typedef __g77_ulongint ulongint; /* system-dependent */
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) #define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
@ -52,9 +52,9 @@ typedef short flag;
typedef short ftnlen; typedef short ftnlen;
typedef short ftnint; typedef short ftnint;
#else #else
typedef @F2C_INTEGER@ /* long int */ flag; typedef __g77_integer flag;
typedef @F2C_INTEGER@ /* long int */ ftnlen; typedef __g77_integer ftnlen;
typedef @F2C_INTEGER@ /* long int */ ftnint; typedef __g77_integer ftnint;
#endif #endif
/*external read, write*/ /*external read, write*/