aboutsummaryrefslogtreecommitdiff
path: root/libf2c
diff options
context:
space:
mode:
authorChris Demetriou <cgd@sibyte.com>2000-05-18 10:44:27 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-05-18 10:44:27 -0700
commit3eb10f8a4f26bb96a7a4e02069665fc51bb1c949 (patch)
treec564fe3c25e16c997b7841c43d97cd5453e37297 /libf2c
parentfcd4823055f358f830a73e0499683a68c688dc5b (diff)
downloadgcc-3eb10f8a4f26bb96a7a4e02069665fc51bb1c949.zip
gcc-3eb10f8a4f26bb96a7a4e02069665fc51bb1c949.tar.gz
gcc-3eb10f8a4f26bb96a7a4e02069665fc51bb1c949.tar.bz2
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
Diffstat (limited to 'libf2c')
-rw-r--r--libf2c/ChangeLog26
-rwxr-xr-xlibf2c/configure179
-rw-r--r--libf2c/configure.in118
-rw-r--r--libf2c/g2c.hin16
4 files changed, 67 insertions, 272 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index b89bbcd..6d0e6db 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -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>
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>
From H.J. Lu <hjl@gnu.org>:
- * Makefile.in (s-libi77): Depend on i77.
- (s-libf77): Depend on i77.
- (s-libu77): Depend on u77.
+ * Makefile.in (s-libi77): Depend on i77.
+ (s-libf77): Depend on i77.
+ (s-libu77): Depend on u77.
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.in: Fix integer size tests: sanity check first; search
- toplevel include dir (from Rainer Orth); only mess with ac_cpp
- once; use -DIN_GCC -DHAVE_CONFIG_H.
+ * configure.in: Fix integer size tests: sanity check first; search
+ toplevel include dir (from Rainer Orth); only mess with ac_cpp
+ 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>
diff --git a/libf2c/configure b/libf2c/configure
index 3b445f6..a397534 100755
--- a/libf2c/configure
+++ b/libf2c/configure
@@ -1057,171 +1057,42 @@ then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
fi
-# We have to firkle with the info in hconfig.h to figure out suitable types
-# (via com.h). proj.h and com.h are in gcc/f/, config.h which they need
-# is in gcc/ and the config files are in gcc/config/.
-echo $ac_n "checking f2c integer type""... $ac_c" 1>&6
-echo "configure:1065: checking f2c integer type" >&5
-# Set this back later below!
-late_ac_cpp=$ac_cpp
-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 "proj.h"
-#define FFECOM_DETERMINE_TYPES 1
-#include "com.h"
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't run check for integer sizes -- see config.log" 1>&2; exit 1; }
-fi
-rm -f conftest*
-CFLAGS=$late_cflags
-
-if eval "test \"`echo '$''{'g77_cv_sys_f2cinteger'+set}'`\" = set"; then
+echo $ac_n "checking for built-in g77 integer types""... $ac_c" 1>&6
+echo "configure:1062: checking for built-in g77 integer types" >&5
+if eval "test \"`echo '$''{'libf2c_cv_has_g77_builtin_types'+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"
+#line 1067 "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
+int main() {
+__g77_integer g77i;
+__g77_uinteger g77ui;
+__g77_longint g77l;
+__g77_ulongint g77ul;
+; return 0; }
EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "F2C_INTEGER=int" >/dev/null 2>&1; then
+if { (eval echo configure:1077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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""$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
+ libf2c_cv_has_g77_builtin_types=yes
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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- g77_cv_sys_f2clongint="long long int"
+ libf2c_cv_has_g77_builtin_types=no
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
+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
-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
# got put here
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
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
case "$host_alias" in
@@ -1288,7 +1159,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 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
case "$target_alias" in
@@ -1306,7 +1177,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 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
case "$build_alias" in
@@ -1487,8 +1358,6 @@ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@SET_MAKE@%$SET_MAKE%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_trigger@%$gcc_version_trigger%g
s%@host@%$host%g
diff --git a/libf2c/configure.in b/libf2c/configure.in
index 6d18744..bf8010c 100644
--- a/libf2c/configure.in
+++ b/libf2c/configure.in
@@ -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',
then the target library, then build with \`LANGUAGES=f77'.])])
-# We have to firkle with the info in hconfig.h to figure out suitable types
-# (via com.h). proj.h and com.h are in gcc/f/, config.h which they need
-# is in gcc/ and the config files are in gcc/config/.
-AC_MSG_CHECKING(f2c integer type)
-# Set this back later below!
-late_ac_cpp=$ac_cpp
-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"
-AC_TRY_COMPILE([#include "proj.h"
-#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
-if test "$g77_cv_sys_f2cinteger" = ""; then
- AC_MSG_RESULT("")
- AC_MSG_ERROR([Can't determine type for f2c integer; config.log may help.])
+dnl Checks for g77 integer types built into gcc's C front end.
+AC_MSG_CHECKING(for built-in g77 integer types)
+AC_CACHE_VAL(libf2c_cv_has_g77_builtin_types,
+[AC_TRY_COMPILE(,
+ [__g77_integer g77i;
+__g77_uinteger g77ui;
+__g77_longint g77l;
+__g77_ulongint g77ul;],
+ libf2c_cv_has_g77_builtin_types=yes,
+ libf2c_cv_has_g77_builtin_types=no)])
+AC_MSG_RESULT($libf2c_cv_has_g77_builtin_types)
+if test $libf2c_cv_has_g77_builtin_types = no; then
+ AC_MSG_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.])
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
# got put here
diff --git a/libf2c/g2c.hin b/libf2c/g2c.hin
index d8fed9c..57947ce 100644
--- a/libf2c/g2c.hin
+++ b/libf2c/g2c.hin
@@ -18,20 +18,20 @@
/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */
/* we assume short, float are OK */
-typedef @F2C_INTEGER@ /* long int */ integer;
-typedef unsigned @F2C_INTEGER@ /* long */ uinteger;
+typedef __g77_integer integer;
+typedef __g77_uinteger uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
-typedef @F2C_INTEGER@ /* long int */ logical;
+typedef __g77_integer logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
-typedef @F2C_LONGINT@ /* long long */ longint; /* system-dependent */
-typedef unsigned @F2C_LONGINT@ /* long long */ ulongint; /* system-dependent */
+typedef __g77_longint longint; /* system-dependent */
+typedef __g77_ulongint ulongint; /* system-dependent */
#define qbit_clear(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 ftnint;
#else
-typedef @F2C_INTEGER@ /* long int */ flag;
-typedef @F2C_INTEGER@ /* long int */ ftnlen;
-typedef @F2C_INTEGER@ /* long int */ ftnint;
+typedef __g77_integer flag;
+typedef __g77_integer ftnlen;
+typedef __g77_integer ftnint;
#endif
/*external read, write*/