From: Craig Burley Date: Mon, 15 Jun 1998 07:52:05 +0000 (-0400) Subject: Makefile.in (install): Don't install if $(libsubdir) is empty... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f30bc2e7f51160a9fc4b58135b53c16c586e6d56;p=gcc.git Makefile.in (install): Don't install if $(libsubdir) is empty... Sat Jun 13 03:46:40 1998 Craig Burley * Makefile.in (install): Don't install if $(libsubdir) is empty; issue a diagnostic saying top-level Makefile must pass it in instead, and exit. * Makefile.in (g2c.h): Rename from f2c.h. * Makefile.in, libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: Rewrite config and var assignment sections to be even more minimal than before, and to more clearly documented what macros are expected to be set and to what sorts of values. Eliminate CROSS and related stuff, since there's no such things as CROSS in egcs. Rename GCC_FOR_TARGET to CC throughout. * Makefile.in (stamp-libi77, stamp-libf77, stamp-libu77): Eliminate CROSS. * configure.in: Eliminate CROSS. Rename libf2c.a and f2c.h to libg2c.a and g2c.h, normalize and simplify g77/libg2c build process: * Makefile.in: Remove all stuff pertaining to installation, cleaning, and so on. Parent Makefile does all that now. Pass F2C_H_DIR, G2C_H_DIR, and GCC_H_DIR, the pathnames for the directories containing f2c.h, g2c.h, and other #include files, to subdirectory Makefiles. (stamp-libf77, stamp-libi77, stamp-libu77): Don't specify `-f Makefile' anymore, it's not needed now that subdirectory makefile's from netlib are renamed to makefile.netlib in g77 source (and to makefile.ori by configuration process, in case they're still around somehow). (stamp-libe77): Don't make libE77 dir unless it doesn't exist, if it does just delete all objects in it. Compile using $(GCC_FOR_TARGET), not $(CC). (rebuilt): Remove this and all subordinate targets, as parent Makefile now handles all that. (*clean): Remove. * configure.in (Pad_UDread, ALWAYS_FLUSH, WANT_LEAD_0): Remove these and commentary to new f2c.h file. AC_OUTPUT g2c.h instead of f2c.h. Remove old commentary regarding concatenation. * g2c.h.in: Rename from f2c.h.in, add appropriate commentary. * f2c.h: New file, a wrapper for g2c.h that does libg2c-specific stuff. * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: Change $(ALL_CFLAGS) to use F2C_H_DIR, G2C_H_DIR, and GCC_H_DIR macros. Remove F2C_H macro, replace use with explicit dependencies on f2c.h and g2c.h. (*clean): Remove. From-SVN: r20507 --- diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index ca82070c9a8..6940abbcc8a 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,56 @@ +Sat Jun 13 03:46:40 1998 Craig Burley + + * Makefile.in (install): Don't install if $(libsubdir) + is empty; issue a diagnostic saying top-level Makefile + must pass it in instead, and exit. + + * Makefile.in (g2c.h): Rename from f2c.h. + + * Makefile.in, libF77/Makefile.in, libI77/Makefile.in, + libU77/Makefile.in: Rewrite config and var assignment + sections to be even more minimal than before, and to + more clearly documented what macros are expected to be + set and to what sorts of values. Eliminate CROSS and + related stuff, since there's no such things as CROSS + in egcs. Rename GCC_FOR_TARGET to CC throughout. + * Makefile.in (stamp-libi77, stamp-libf77, stamp-libu77): + Eliminate CROSS. + * configure.in: Eliminate CROSS. + + Rename libf2c.a and f2c.h to libg2c.a and g2c.h, + normalize and simplify g77/libg2c build process: + * Makefile.in: Remove all stuff pertaining to + installation, cleaning, and so on. Parent Makefile + does all that now. Pass F2C_H_DIR, + G2C_H_DIR, and GCC_H_DIR, the pathnames for the + directories containing f2c.h, g2c.h, and other + #include files, to subdirectory Makefiles. + (stamp-libf77, stamp-libi77, stamp-libu77): + Don't specify `-f Makefile' anymore, it's not needed + now that subdirectory makefile's from netlib are + renamed to makefile.netlib in g77 source (and to + makefile.ori by configuration process, in case they're + still around somehow). + (stamp-libe77): Don't make libE77 dir unless it doesn't + exist, if it does just delete all objects in it. + Compile using $(GCC_FOR_TARGET), not $(CC). + (rebuilt): Remove this and all subordinate targets, + as parent Makefile now handles all that. + (*clean): Remove. + * configure.in (Pad_UDread, ALWAYS_FLUSH, WANT_LEAD_0): + Remove these and commentary to new f2c.h file. + AC_OUTPUT g2c.h instead of f2c.h. Remove old commentary + regarding concatenation. + * g2c.h.in: Rename from f2c.h.in, add appropriate + commentary. + * f2c.h: New file, a wrapper for g2c.h that does + libg2c-specific stuff. + * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: + Change $(ALL_CFLAGS) to use F2C_H_DIR, G2C_H_DIR, and GCC_H_DIR + macros. Remove F2C_H macro, replace use with explicit + dependencies on f2c.h and g2c.h. + (*clean): Remove. + 1998-05-20 Dave Love * Makefile.in ($(lib)): Use shell loop instead of unportable diff --git a/libf2c/Makefile.in b/libf2c/Makefile.in index 21b136be1f2..abce5ea5c67 100644 --- a/libf2c/Makefile.in +++ b/libf2c/Makefile.in @@ -60,24 +60,16 @@ LIBCFLAGS = $(CFLAGS) # overrides thouh $(MAKE)) but may be needed by older versions.' FLAGS_TO_PASS= \ - "SHELL=$(SHELL)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "prefix=$(prefix)" \ - "exec_prefix=$(exec_prefix)" \ - "tooldir=$(tooldir)" \ - "AR=$(AR)" \ - "AR_FLAGS=$(AR_FLAGS)" \ "CC=$(CC)" \ "CFLAGS=$(CFLAGS)" \ - "RANLIB=$(RANLIB)" \ + "F2C_H_DIR=$(s)/libf2c" \ + "G2C_H_DIR=$(r)/libraries/libf2c" \ + "GCC_H_DIR=$(s)/include" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "PICFLAG=$(PICFLAG)" \ "RUNTESTFLAGS=$(RUNTESTFLAGS)" - -lib = libf2c.a +LIBG2C = libg2c.a MISC = libF77/F77_aloc.o libF77/VersionF.o libF77/main.o libF77/s_rnge.o \ libF77/abort_.o libF77/getarg_.o libF77/iargc_.o libF77/getenv_.o \ @@ -151,90 +143,117 @@ F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \ secnds second sleep srand stat symlnk sclock time ttynam umask unlink \ vxtidt vxttim alarm -all: f2c.h $(lib) +all: g2c.h $(LIBG2C) -$(lib): stamp-libf77 stamp-libi77 stamp-libu77 stamp-libe77 - rm -f $(lib) - $(AR) $(AR_FLAGS) $(lib) $(FOBJ) - $(AR) $(AR_FLAGS) $(lib) $(IOBJ) - $(AR) $(AR_FLAGS) $(lib) $(UOBJ) +$(LIBG2C): stamp-libf77 stamp-libi77 stamp-libu77 stamp-libe77 + rm -f $(LIBG2C) + $(AR) $(AR_FLAGS) $(LIBG2C) $(FOBJ) + $(AR) $(AR_FLAGS) $(LIBG2C) $(IOBJ) + $(AR) $(AR_FLAGS) $(LIBG2C) $(UOBJ) objs=""; for i in $(F2CEXT); do objs="$$objs libE77/L$$i.o"; done; \ - $(AR) $(AR_FLAGS) $(lib) $$objs - $(RANLIB) $(lib) + $(AR) $(AR_FLAGS) $(LIBG2C) $$objs + $(RANLIB) $(LIBG2C) stamp-libi77: libI77/Makefile rm -f stamp-libi77 - cd libI77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all + cd libI77; $(MAKE) $(FLAGS_TO_PASS) all touch stamp-libi77 stamp-libf77: libF77/Makefile rm -f stamp-libf77 - cd libF77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all + cd libF77; $(MAKE) $(FLAGS_TO_PASS) all touch stamp-libf77 stamp-libu77: libU77/Makefile rm -f stamp-libu77 - cd libU77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all + cd libU77; $(MAKE) $(FLAGS_TO_PASS) all touch stamp-libu77 stamp-libe77: $(srcdir)/f2cext.c - rm -fr libE77 - mkdir libE77 + rm -f stamp-libe77 + if [ -d libE77 ]; then rm -f libE77/*.o; else mkdir libE77; fi for name in $(F2CEXT); \ do \ echo $${name}; \ $(CC) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(CFLAGS) \ - $(CGFLAGS) -DL$${name} $(srcdir)/f2cext.c \ + -DL$${name} $(srcdir)/f2cext.c \ -o libE77/L$${name}.o; \ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ done touch stamp-libe77 ${srcdir}/configure: ${srcdir}/configure.in - rm -f config.cache && cd ${srcdir} && autoconf && rm -f config.cache + rm -f config.cache Makefile g2c.h \ + && cd $(srcdir) && autoconf && rm -f config.cache ${srcdir}/libU77/configure: ${srcdir}/libU77/configure.in - rm -f libU77/config.cache && cd ${srcdir}/libU77 && autoconf && rm -f config.cache -f2c.h Makefile: $(srcdir)/Makefile.in config.status + rm -f libU77/config.cache libU77/Makefile && \ + cd $(srcdir)/libU77 && autoconf && rm -f config.cache +g2c.h Makefile: $(srcdir)/g2c.h.in $(srcdir)/Makefile.in config.status $(SHELL) config.status config.status: $(srcdir)/configure $(SHELL) config.status --recheck -f2c.h: $(srcdir)/f2c.h.in - info install-info clean-info dvi: check: cd libU77; $(MAKE) G77DIR=../../../gcc/ check install: - $(INSTALL_DATA) $(lib) $(libdir)/$(lib).n - ( cd $(libdir) ; $(RANLIB) $(lib).n ) - mv -f $(libdir)/$(lib).n $(libdir)/$(lib) - $(INSTALL_DATA) f2c.h $(includedir)/f2c.h + @if [ x$(libsubdir) = x ]; then \ + echo ''; \ + echo 'libf2c error: libsubdir environment variable is not'; \ + echo ' exported by top-level Makefile. libg2c.a and g2c.h'; \ + echo ' are installed in the directory tree identified named'; \ + echo ' by that variable, the same tree in which the gcc-'; \ + echo ' specific executables, libraries, and so on are installed.'; \ + echo ' Rather than try to extract the name of this tree via'; \ + echo ' a kludge, libf2c/Makefile.in simply assumes it is passed'; \ + echo ' in as an environment variable. Someone needs to make'; \ + echo ' the appropriate changes to the top-level Makefile.in for'; \ + echo ' this to happen.'; \ + echo ''; \ + echo ' In the meantime, you can try setting libsubdir explicitly'; \ + echo ' in the make command line via libsubdir=/foo/lib/gcc-lib/...,'; \ + echo ' where foo and ... indicate wherever the cc1 and f771'; \ + echo ' executables were installed as part of this overall'; \ + echo ' installation process.'; \ + echo ''; \ + exit 1; \ + fi + $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(LIBG2C).n + ( cd $(libsubdir) ; $(RANLIB) $(LIBG2C).n ) + mv -f $(libsubdir)/$(LIBG2C).n $(libsubdir)/$(LIBG2C) + $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h + @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \ + echo ''; \ + echo 'Warning: g77 no longer installs libf2c.a or f2c.h.'; \ + echo ' You must do so yourself. For more information,'; \ + echo ' read "Distributing Binaries" in the g77 docs.'; \ + echo ' (To turn off this warning, delete the file'; \ + echo ' f2c-install-ok in the source or build directory.)'; \ + echo ''; \ + fi mostlyclean: - -rm -f stamp-* - for i in libI77 libF77 libU77; do \ - if [ -f $$i/Makefile ]; then \ - cd $$i; $(MAKE) -f Makefile mostlyclean; cd ..; \ - fi; \ - done + rm -f stamp-* $(LIBG2C) + rm -f libF77/*.o + rm -f libI77/*.o + rm -f libU77/*.o rm -fr libE77 clean: - -rm -f config.log stamp-* - for i in libI77 libF77 libU77; do \ - if [ -f $$i/Makefile ]; then \ - cd $$i; $(MAKE) -f Makefile clean; cd ..; \ - fi; \ - done - rm -fr libE77 - -distclean: clean - -rm -f Makefile config.cache lib?77/Makefile config.status lib?77/config.status lib?77/config.cache lib?77/config.h f2c.h - -maintainer-clean: distclean - -rm -f $(srcdir)/configure $(srcdir)/libU77/configure + rm -f config.log + rm -f libF77/Makefile + rm -f libI77/Makefile + rm -f libU77/Makefile libU77/config.log libU77/a.out + +distclean: + rm -f Makefile config.cache config.status g2c.h + rm -f lib?77/Makefile lib?77/config.status + rm -f lib?77/config.cache lib?77/config.h + +maintainer-clean: + rm -f $(srcdir)/configure $(srcdir)/libU77/configure rebuilt: ${srcdir}/configure ${srcdir}/libU77/configure diff --git a/libf2c/README b/libf2c/README index 9419af77189..3d0e29d0ac4 100644 --- a/libf2c/README +++ b/libf2c/README @@ -1,8 +1,10 @@ -970811 +1998-04-20 This directory contains the f2c library packaged for use with g77 to configure and build automatically (in principle!) as part of the top-level configure and make steps. This depends on the makefile and configure fragments in ../f. +g77 names this library `libg2c' to avoid conflict with existing copies +of `libf2c' on a system. Some small changes have been made to the f2c distributions of lib[FI]77 which come from and are maintained (excellently) by @@ -26,7 +28,7 @@ interesting, but should not be taken as guidelines for how to configure and build libf2c in g77's distribution. The packaging for auto-configuration was done by Dave Love . -Minor changes have been made by James Craig Burley , +Minor changes have been made by James Craig Burley , who probably broke things Dave had working. :-) Among the user-visible changes (choices) g77 makes in its diff --git a/libf2c/configure b/libf2c/configure index 45788f63e75..a4f51cb12e9 100755 --- a/libf2c/configure +++ b/libf2c/configure @@ -520,22 +520,14 @@ fi -# From configure.in 1.10 +# From configure.in 1.11 -if test "$CROSS";then - if test "$CC_FOR_TARGET"; then - CC="$CC_FOR_TARGET" - else - CC="../../xgcc -B../../xgcc/" - fi - ac_cv_c_cross=yes -else - # For g77 we'll set CC to point at the built gcc, but this will get it into - # the makefiles - # Extract the first word of "gcc", so it can be a program name with args. +# For g77 we'll set CC to point at the built gcc, but this will get it into +# the makefiles +# Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:539: checking for $ac_word" >&5 +echo "configure:531: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -564,7 +556,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:568: checking for $ac_word" >&5 +echo "configure:560: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -612,7 +604,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:616: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:608: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -622,11 +614,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -646,12 +638,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:650: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:642: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:655: checking whether we are using GNU C" >&5 +echo "configure:647: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -660,7 +652,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -675,7 +667,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:679: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:671: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -702,8 +694,6 @@ else test "${CFLAGS+set}" = set || CFLAGS="-g" fi - ac_cv_c_cross=no -fi test "$AR" || AR=ar @@ -717,7 +707,7 @@ else # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:721: checking for $ac_word" >&5 +echo "configure:711: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -750,7 +740,7 @@ fi # Sanity check for the cross-compilation case: echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:754: checking how to run the C preprocessor" >&5 +echo "configure:744: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -765,13 +755,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -782,13 +772,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -812,17 +802,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stdio.h""... $ac_c" 1>&6 -echo "configure:816: checking for stdio.h" >&5 +echo "configure:806: checking for stdio.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -850,12 +840,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:854: checking for ANSI C header files" >&5 +echo "configure:844: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -863,7 +853,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -880,7 +870,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -898,7 +888,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -919,7 +909,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -930,7 +920,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -956,12 +946,12 @@ fi echo $ac_n "checking for posix""... $ac_c" 1>&6 -echo "configure:960: checking for posix" >&5 +echo "configure:950: checking for posix" >&5 if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -987,12 +977,12 @@ echo "$ac_t""$g77_cv_header_posix" 1>&6 # We can rely on the GNU library being posix-ish. I guess checking the # header isn't actually like checking the functions, though... echo $ac_n "checking for GNU library""... $ac_c" 1>&6 -echo "configure:991: checking for GNU library" >&5 +echo "configure:981: checking for GNU library" >&5 if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef __GNU_LIBRARY__ @@ -1016,12 +1006,12 @@ echo "$ac_t""$g77_cv_lib_gnu" 1>&6 # Apparently cygwin needs to be special-cased. echo $ac_n "checking for cyg\`win'32""... $ac_c" 1>&6 -echo "configure:1020: checking for cyg\`win'32" >&5 +echo "configure:1010: checking for cyg\`win'32" >&5 if eval "test \"`echo '$''{'g77_cv_sys_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 # ditto for mingw32. echo $ac_n "checking for mingw32""... $ac_c" 1>&6 -echo "configure:1048: checking for mingw32" >&5 +echo "configure:1038: checking for mingw32" >&5 if eval "test \"`echo '$''{'g77_cv_sys_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 -echo "configure:1077: checking for fcntl.h" >&5 +echo "configure:1067: checking for fcntl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1116,12 +1106,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1120: checking for working const" >&5 +echo "configure:1110: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1191,12 +1181,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1195: checking for size_t" >&5 +echo "configure:1185: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1225,12 +1215,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1229: checking return type of signal handlers" >&5 +echo "configure:1219: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1247,7 +1237,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1268,12 +1258,12 @@ EOF # we'll get atexit by default if test $ac_cv_header_stdc != yes; then echo $ac_n "checking for atexit""... $ac_c" 1>&6 -echo "configure:1272: checking for atexit" >&5 +echo "configure:1262: checking for atexit" >&5 if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_atexit=yes" else @@ -1321,12 +1311,12 @@ else EOF echo $ac_n "checking for onexit""... $ac_c" 1>&6 -echo "configure:1325: checking for onexit" >&5 +echo "configure:1315: checking for onexit" >&5 if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_onexit=yes" else @@ -1367,12 +1357,12 @@ if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for on_exit""... $ac_c" 1>&6 -echo "configure:1371: checking for on_exit" >&5 +echo "configure:1361: checking for on_exit" >&5 if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_on_exit=yes" else @@ -1428,12 +1418,12 @@ fi # Apparently positive result on cygwin loses re. NON_UNIX_STDIO # (as of cygwin b18). Likewise on mingw. echo $ac_n "checking for fstat""... $ac_c" 1>&6 -echo "configure:1432: checking for fstat" >&5 +echo "configure:1422: checking for fstat" >&5 if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_fstat=yes" else @@ -1476,7 +1466,7 @@ else fi echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6 -echo "configure:1480: checking need for NON_UNIX_STDIO" >&5 +echo "configure:1470: checking need for NON_UNIX_STDIO" >&5 if test $g77_cv_sys_cygwin32 = yes \ || test $g77_cv_sys_mingw32 = yes \ || test $ac_cv_func_fstat = no; then @@ -1491,19 +1481,19 @@ fi # This is necessary for e.g. Linux: echo $ac_n "checking for necessary members of struct FILE""... $ac_c" 1>&6 -echo "configure:1495: checking for necessary members of struct FILE" >&5 +echo "configure:1485: checking for necessary members of struct FILE" >&5 if eval "test \"`echo '$''{'g77_cv_struct_FILE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { FILE s; s._ptr; s._base; s._flag; ; return 0; } EOF -if { (eval echo configure:1507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* g77_cv_struct_FILE=yes else @@ -1523,7 +1513,7 @@ EOF fi echo $ac_n "checking for drem in -lm""... $ac_c" 1>&6 -echo "configure:1527: checking for drem in -lm" >&5 +echo "configure:1517: checking for drem in -lm" >&5 ac_lib_var=`echo m'_'drem | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1531,7 +1521,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1570,12 +1560,12 @@ fi for ac_func in tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1574: checking for $ac_func" >&5 +echo "configure:1564: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1628,19 +1618,19 @@ done # However, on my sunos4/gcc setup unistd.h leads us wrongly to believe # we're posix-conformant, so always do the test. echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6 -echo "configure:1632: checking for ansi/posix sprintf result" >&5 +echo "configure:1622: checking for ansi/posix sprintf result" >&5 if test "$cross_compiling" = yes; then g77_cv_sys_sprintf_ansi=no else cat > conftest.$ac_ext < /* does sprintf return the number of chars transferred? */ main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);} EOF -if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then g77_cv_sys_sprintf_ansi=yes else @@ -1658,11 +1648,8 @@ else g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi fi -if test $ac_cv_c_cross = no; then - echo "$ac_t""$g77_cv_sys_sprintf_ansi" 1>&6 -else - echo "$ac_t""can't tell -- assuming no" 1>&6 -fi +echo "$ac_t""$g77_cv_sys_sprintf_ansi" 1>&6 + # The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't # understand why. if test $g77_cv_sys_sprintf_ansi != yes; then @@ -1674,9 +1661,9 @@ fi # define NON_ANSI_RW_MODES on unix (can't hurt) echo $ac_n "checking NON_ANSI_RW_MODES""... $ac_c" 1>&6 -echo "configure:1678: checking NON_ANSI_RW_MODES" >&5 +echo "configure:1665: checking NON_ANSI_RW_MODES" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1721: checking f2c integer type" >&5 +echo "configure:1708: checking f2c integer type" >&5 late_ac_cpp=$ac_cpp ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config" if test "$subdir" != . ; then @@ -1726,9 +1713,9 @@ fi if eval "test \"`echo '$''{'g77_cv_sys_f2cinteger'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure:1730: using $ac_cpp" >&5 + echo "configure:1717: using $ac_cpp" >&5 cat > conftest.$ac_ext <&5 +echo "configure:1741: using $ac_cpp" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1791: checking f2c long int type" >&5 +echo "configure:1778: checking f2c long int type" >&5 late_ac_cpp=$ac_cpp ac_cpp="$late_ac_cpp -I../../gcc/f -I../../gcc -I../../gcc/config" if test "$subdir" != . ; then @@ -1796,9 +1783,9 @@ fi if eval "test \"`echo '$''{'g77_cv_sys_f2clongint'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure:1800: using $ac_cpp" >&5 + echo "configure:1787: using $ac_cpp" >&5 cat > conftest.$ac_ext <&5 +echo "configure:1811: using $ac_cpp" >&5 cat > conftest.$ac_ext <> confdefs.h <<\EOF #define NO_EOF_CHAR_CHECK 1 @@ -1871,22 +1855,6 @@ cat >> confdefs.h <<\EOF EOF - - - -cat >> confdefs.h <<\EOF -#define Pad_UDread 1 -EOF - - - - - -cat >> confdefs.h <<\EOF -#define WANT_LEAD_0 1 -EOF - - # 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 @@ -2026,7 +1994,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "Makefile f2c.h libI77/Makefile libF77/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile g2c.h libI77/Makefile libF77/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/libf2c/configure.in b/libf2c/configure.in index 69d05d7cdbd..a2d9fe9e84a 100644 --- a/libf2c/configure.in +++ b/libf2c/configure.in @@ -21,24 +21,12 @@ AC_INIT(libF77/Version.c) -AC_REVISION(1.10) +AC_REVISION(1.11) -dnl AC_C_CROSS -dnl Gives misleading `(cached)' message from the check. -if test "$CROSS";then - if test "$CC_FOR_TARGET"; then - CC="$CC_FOR_TARGET" - else - CC="../../xgcc -B../../xgcc/" - fi - ac_cv_c_cross=yes -else - dnl Checks for programs. - # For g77 we'll set CC to point at the built gcc, but this will get it into - # the makefiles - AC_PROG_CC - ac_cv_c_cross=no -fi +dnl Checks for programs. +# For g77 we'll set CC to point at the built gcc, but this will get it into +# the makefiles +AC_PROG_CC dnl These should be inherited in the recursive make, but ensure they are dnl defined: @@ -213,11 +201,8 @@ AC_TRY_RUN(changequote(<<, >>)dnl AC_CACHE_VAL(g77_cv_sys_sprintf_ansi, g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi) dnl We get a misleading `(cached)' message... -if test $ac_cv_c_cross = no; then - AC_MSG_RESULT($g77_cv_sys_sprintf_ansi) -else - AC_MSG_RESULT([can't tell -- assuming no]) -fi +AC_MSG_RESULT($g77_cv_sys_sprintf_ansi) + # The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't # understand why. if test $g77_cv_sys_sprintf_ansi != yes; then @@ -347,44 +332,11 @@ AC_SUBST(F2C_LONGINT) dnl maybe check for drem/remainder -AC_SUBST(CROSS) - - # This EOF_CHAR is a misfeature on unix. AC_DEFINE(NO_EOF_CHAR_CHECK) AC_DEFINE(Skip_f2c_Undefs) -dnl Craig had these in f2c.h, but they're only relevant for building libf2c -dnl anyway. - -dnl For GNU Fortran (g77), we always enable the following behaviors for -dnl libf2c, to make things easy on the programmer. The alternate -dnl behaviors have their uses, and g77 might provide them as compiler, -dnl rather than library, options, so only a single copy of a shared libf2c -dnl need be built for a system. - -dnl This makes unformatted I/O more consistent in relation to other -dnl systems. It is not required by the F77 standard. - -AC_DEFINE(Pad_UDread) - -dnl This makes ERR= and IOSTAT= returns work properly in disk-full -dnl situations, making things work more as expected. It slows things -dnl down, so g77 will probably someday choose the original implementation -dnl on a case-by-case basis when it can be shown to not be necessary -dnl (e.g. no ERR= or IOSTAT=) or when it is given the appropriate -dnl compile-time option or, perhaps, source-code directive. - -dnl AC_DEFINE(ALWAYS_FLUSH) - -dnl Most Fortran implementations do this, so to make it easier -dnl to compare the output of g77-compiled programs to those compiled -dnl by most other compilers, tell libf2c to put leading zeros in -dnl appropriate places on output - -AC_DEFINE(WANT_LEAD_0) - # 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 @@ -392,11 +344,9 @@ test -f libI77/makefile && mv libI77/makefile libI77/makefile.ori test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori AC_CONFIG_SUBDIRS(libU77) -AC_OUTPUT(Makefile f2c.h libI77/Makefile libF77/Makefile) +AC_OUTPUT(Makefile g2c.h libI77/Makefile libF77/Makefile) dnl We might have configuration options to: -dnl * allow non-standard string concatenation (use libF77 s_catow.o, -dnl not s_cat.o) dnl * change unit preconnexion in libI77/err.c (f_init.c) dnl * -DALWAYS_FLUSH in libI77 dnl * -DOMIT_BLANK_CC in libI77 diff --git a/libf2c/f2c.h b/libf2c/f2c.h new file mode 100644 index 00000000000..f27703f4807 --- /dev/null +++ b/libf2c/f2c.h @@ -0,0 +1,64 @@ +/* f2c.h file for GNU Fortran run-time library + Copyright (C) 1998 Free Software Foundation, Inc. + Contributed by James Craig Burley (burley@gnu.org). + +This file is part of GNU Fortran. + +GNU Fortran is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Fortran; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* This file currently is just a stub through which g77's copy + of netlib's libf2c, which g77 builds and installs as libg2c.a + (to avoid conflict), #include's g77's version of f2c.h, named + g2c.h. That file is, in turn, produced via g77's library + configuration process from g2c.h.in. + + By going through this extra "hoop", it is easy to provide for + libg2c-specific configuration and typedefs that aren't appropriate + in g2c.h itself (since that is intended to be installed so it can + be shared with f2c users), without changing the libf2c (libg2c) + routines themselves. (They continue to #include "f2c.h", just + like they do in netlib's version.) */ + +#include "g2c.h" + +/* For GNU Fortran (g77), we always enable the following behaviors for + libf2c, to make things easy on the programmer. The alternate + behaviors have their uses, and g77 might provide them as compiler, + rather than library, options, so only a single copy of a shared libf2c + need be built for a system. */ + +/* This makes unformatted I/O more consistent in relation to other + systems. It is not required by the F77 standard. */ + +#define Pad_UDread + +/* This makes ERR= and IOSTAT= returns work properly in disk-full + situations, making things work more as expected. It slows things + down, so g77 will probably someday choose the original implementation + on a case-by-case basis when it can be shown to not be necessary + (e.g. no ERR= or IOSTAT=) or when it is given the appropriate + compile-time option or, perhaps, source-code directive. + + (No longer defined, since it really slows down NFS access too much.) */ + +/* #define ALWAYS_FLUSH */ + +/* Most Fortran implementations do this, so to make it easier + to compare the output of g77-compiled programs to those compiled + by most other compilers, tell libf2c to put leading zeros in + appropriate places on output. */ + +#define WANT_LEAD_0 diff --git a/libf2c/f2c.h.in b/libf2c/f2c.h.in deleted file mode 100644 index 90374678100..00000000000 --- a/libf2c/f2c.h.in +++ /dev/null @@ -1,227 +0,0 @@ -/* f2c.h -- Standard Fortran to C header file */ - -/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - - - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ - -#ifndef F2C_INCLUDE -#define F2C_INCLUDE - -/* 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 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 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 */ -#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) -#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) - -#define TRUE_ (1) -#define FALSE_ (0) - -/* Extern is for use with -E */ -#ifndef Extern -#define Extern extern -#endif - -/* I/O stuff */ - -#ifdef f2c_i2 -#error "f2c_i2 will not work with g77!!!!" -/* for -i2 */ -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; -#endif - -/*external read, write*/ -typedef struct -{ flag cierr; - ftnint ciunit; - flag ciend; - char *cifmt; - ftnint cirec; -} cilist; - -/*internal read, write*/ -typedef struct -{ flag icierr; - char *iciunit; - flag iciend; - char *icifmt; - ftnint icirlen; - ftnint icirnum; -} icilist; - -/*open*/ -typedef struct -{ flag oerr; - ftnint ounit; - char *ofnm; - ftnlen ofnmlen; - char *osta; - char *oacc; - char *ofm; - ftnint orl; - char *oblnk; -} olist; - -/*close*/ -typedef struct -{ flag cerr; - ftnint cunit; - char *csta; -} cllist; - -/*rewind, backspace, endfile*/ -typedef struct -{ flag aerr; - ftnint aunit; -} alist; - -/* inquire */ -typedef struct -{ flag inerr; - ftnint inunit; - char *infile; - ftnlen infilen; - ftnint *inex; /*parameters in standard's order*/ - ftnint *inopen; - ftnint *innum; - ftnint *innamed; - char *inname; - ftnlen innamlen; - char *inacc; - ftnlen inacclen; - char *inseq; - ftnlen inseqlen; - char *indir; - ftnlen indirlen; - char *infmt; - ftnlen infmtlen; - char *inform; - ftnint informlen; - char *inunf; - ftnlen inunflen; - ftnint *inrecl; - ftnint *innrec; - char *inblank; - ftnlen inblanklen; -} inlist; - -#define VOID void - -union Multitype { /* for multiple entry points */ - integer1 g; - shortint h; - integer i; - /* longint j; */ - real r; - doublereal d; - complex c; - doublecomplex z; - }; - -typedef union Multitype Multitype; - -/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ - -struct Vardesc { /* for Namelist */ - char *name; - char *addr; - ftnlen *dims; - int type; - }; -typedef struct Vardesc Vardesc; - -struct Namelist { - char *name; - Vardesc **vars; - int nvars; - }; -typedef struct Namelist Namelist; - -#define abs(x) ((x) >= 0 ? (x) : -(x)) -#define dabs(x) (doublereal)abs(x) -#define min(a,b) ((a) <= (b) ? (a) : (b)) -#define max(a,b) ((a) >= (b) ? (a) : (b)) -#define dmin(a,b) (doublereal)min(a,b) -#define dmax(a,b) (doublereal)max(a,b) -#define bit_test(a,b) ((a) >> (b) & 1) -#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) -#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) - -/* procedure parameter types for -A and -C++ */ - -#define F2C_proc_par_types 1 -#ifdef __cplusplus -typedef int /* Unknown procedure type */ (*U_fp)(...); -typedef shortint (*J_fp)(...); -typedef integer (*I_fp)(...); -typedef real (*R_fp)(...); -typedef doublereal (*D_fp)(...), (*E_fp)(...); -typedef /* Complex */ VOID (*C_fp)(...); -typedef /* Double Complex */ VOID (*Z_fp)(...); -typedef logical (*L_fp)(...); -typedef shortlogical (*K_fp)(...); -typedef /* Character */ VOID (*H_fp)(...); -typedef /* Subroutine */ int (*S_fp)(...); -#else -typedef int /* Unknown procedure type */ (*U_fp)(); -typedef shortint (*J_fp)(); -typedef integer (*I_fp)(); -typedef real (*R_fp)(); -typedef doublereal (*D_fp)(), (*E_fp)(); -typedef /* Complex */ VOID (*C_fp)(); -typedef /* Double Complex */ VOID (*Z_fp)(); -typedef logical (*L_fp)(); -typedef shortlogical (*K_fp)(); -typedef /* Character */ VOID (*H_fp)(); -typedef /* Subroutine */ int (*S_fp)(); -#endif -/* E_fp is for real functions when -R is not specified */ -typedef VOID C_f; /* complex function */ -typedef VOID H_f; /* character function */ -typedef VOID Z_f; /* double complex function */ -typedef doublereal E_f; /* real function with -R not specified */ - -/* undef any lower-case symbols that your C compiler predefines, e.g.: */ - -#ifndef Skip_f2c_Undefs -/* (No such symbols should be defined in a strict ANSI C compiler. - We can avoid trouble with f2c-translated code by using - gcc -ansi [-traditional].) */ -#undef cray -#undef gcos -#undef mc68010 -#undef mc68020 -#undef mips -#undef pdp11 -#undef sgi -#undef sparc -#undef sun -#undef sun2 -#undef sun3 -#undef sun4 -#undef u370 -#undef u3b -#undef u3b2 -#undef u3b5 -#undef unix -#undef vax -#endif -#endif diff --git a/libf2c/g2c.h.in b/libf2c/g2c.h.in new file mode 100644 index 00000000000..5897525a230 --- /dev/null +++ b/libf2c/g2c.h.in @@ -0,0 +1,236 @@ +/* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */ + +/* This file is generated by the g77 libg2c configuration process from a + file named g2c.h.in. This process sets up the appropriate types, + defines the appropriate macros, and so on. The resulting g2c.h file + is used to build g77's copy of libf2c, named libg2c, and also can + be used when compiling C code produced by f2c to link the resulting + object file(s) with those produced by the same version of g77 that + produced this file, allowing inter-operability of f2c-compiled and + g77-compiled code. */ + +/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + +#ifndef F2C_INCLUDE +#define F2C_INCLUDE + +/* 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 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 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 */ +#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) +#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) + +#define TRUE_ (1) +#define FALSE_ (0) + +/* Extern is for use with -E */ +#ifndef Extern +#define Extern extern +#endif + +/* I/O stuff */ + +#ifdef f2c_i2 +#error "f2c_i2 will not work with g77!!!!" +/* for -i2 */ +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; +#endif + +/*external read, write*/ +typedef struct +{ flag cierr; + ftnint ciunit; + flag ciend; + char *cifmt; + ftnint cirec; +} cilist; + +/*internal read, write*/ +typedef struct +{ flag icierr; + char *iciunit; + flag iciend; + char *icifmt; + ftnint icirlen; + ftnint icirnum; +} icilist; + +/*open*/ +typedef struct +{ flag oerr; + ftnint ounit; + char *ofnm; + ftnlen ofnmlen; + char *osta; + char *oacc; + char *ofm; + ftnint orl; + char *oblnk; +} olist; + +/*close*/ +typedef struct +{ flag cerr; + ftnint cunit; + char *csta; +} cllist; + +/*rewind, backspace, endfile*/ +typedef struct +{ flag aerr; + ftnint aunit; +} alist; + +/* inquire */ +typedef struct +{ flag inerr; + ftnint inunit; + char *infile; + ftnlen infilen; + ftnint *inex; /*parameters in standard's order*/ + ftnint *inopen; + ftnint *innum; + ftnint *innamed; + char *inname; + ftnlen innamlen; + char *inacc; + ftnlen inacclen; + char *inseq; + ftnlen inseqlen; + char *indir; + ftnlen indirlen; + char *infmt; + ftnlen infmtlen; + char *inform; + ftnint informlen; + char *inunf; + ftnlen inunflen; + ftnint *inrecl; + ftnint *innrec; + char *inblank; + ftnlen inblanklen; +} inlist; + +#define VOID void + +union Multitype { /* for multiple entry points */ + integer1 g; + shortint h; + integer i; + /* longint j; */ + real r; + doublereal d; + complex c; + doublecomplex z; + }; + +typedef union Multitype Multitype; + +/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ + +struct Vardesc { /* for Namelist */ + char *name; + char *addr; + ftnlen *dims; + int type; + }; +typedef struct Vardesc Vardesc; + +struct Namelist { + char *name; + Vardesc **vars; + int nvars; + }; +typedef struct Namelist Namelist; + +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (doublereal)abs(x) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define dmin(a,b) (doublereal)min(a,b) +#define dmax(a,b) (doublereal)max(a,b) +#define bit_test(a,b) ((a) >> (b) & 1) +#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) +#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) + +/* procedure parameter types for -A and -C++ */ + +#define F2C_proc_par_types 1 +#ifdef __cplusplus +typedef int /* Unknown procedure type */ (*U_fp)(...); +typedef shortint (*J_fp)(...); +typedef integer (*I_fp)(...); +typedef real (*R_fp)(...); +typedef doublereal (*D_fp)(...), (*E_fp)(...); +typedef /* Complex */ VOID (*C_fp)(...); +typedef /* Double Complex */ VOID (*Z_fp)(...); +typedef logical (*L_fp)(...); +typedef shortlogical (*K_fp)(...); +typedef /* Character */ VOID (*H_fp)(...); +typedef /* Subroutine */ int (*S_fp)(...); +#else +typedef int /* Unknown procedure type */ (*U_fp)(); +typedef shortint (*J_fp)(); +typedef integer (*I_fp)(); +typedef real (*R_fp)(); +typedef doublereal (*D_fp)(), (*E_fp)(); +typedef /* Complex */ VOID (*C_fp)(); +typedef /* Double Complex */ VOID (*Z_fp)(); +typedef logical (*L_fp)(); +typedef shortlogical (*K_fp)(); +typedef /* Character */ VOID (*H_fp)(); +typedef /* Subroutine */ int (*S_fp)(); +#endif +/* E_fp is for real functions when -R is not specified */ +typedef VOID C_f; /* complex function */ +typedef VOID H_f; /* character function */ +typedef VOID Z_f; /* double complex function */ +typedef doublereal E_f; /* real function with -R not specified */ + +/* undef any lower-case symbols that your C compiler predefines, e.g.: */ + +#ifndef Skip_f2c_Undefs +/* (No such symbols should be defined in a strict ANSI C compiler. + We can avoid trouble with f2c-translated code by using + gcc -ansi [-traditional].) */ +#undef cray +#undef gcos +#undef mc68010 +#undef mc68020 +#undef mips +#undef pdp11 +#undef sgi +#undef sparc +#undef sun +#undef sun2 +#undef sun3 +#undef sun4 +#undef u370 +#undef u3b +#undef u3b2 +#undef u3b5 +#undef unix +#undef vax +#endif +#endif diff --git a/libf2c/libF77/Makefile.in b/libf2c/libF77/Makefile.in index d8d97a800fb..b2ce4dbacf5 100644 --- a/libf2c/libF77/Makefile.in +++ b/libf2c/libF77/Makefile.in @@ -1,7 +1,7 @@ # Makefile for GNU F77 compiler runtime. # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). -# Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. +# Portions of this file Copyright (C) 1995-1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of GNU Fortran. @@ -21,16 +21,35 @@ #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #02111-1307, USA. -SHELL = /bin/sh +#### Start of system configuration section. #### + +# $(srcdir) must be set to the g77 runtime libF77 source directory +# (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ -#### Start of system configuration section. #### +# gcc/f/runtime/configure sets this to all the -D options appropriate +# for the configuration. +DEFS = @DEFS@ + +#### End of system configuration section. #### + +# Must be passed in explicitly. Sample values are shown below. +#CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ +#CFLAGS = -O -g +#CPPFLAGS = +#F2C_H_DIR = /gcc-source-dir/f/runtime +#G2C_H_DIR = /gcc-build-dir/f/runtime +#GCC_H_DIR = /gcc-build-dir/include +ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) + +.SUFFIXES: +.SUFFIXES: .c .o .c.o: - $(CC) -c -DSkip_f2c_Undefs -I../ $(CFLAGS) $< + $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ @@ -55,22 +74,14 @@ EFL = ef1asc_.o ef1cmc_.o CHAR = s_cat.o s_cmp.o s_copy.o F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o -F2C_H = ../f2c.h - all: $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) VersionF.o: Version.c - $(CC) -c $(CFLAGS) -o $@ $(srcdir)/Version.c - -mostlyclean clean: - -rm -f *.o - -distclean maintainer-clean: clean - -rm -f stage? include Makefile + $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c # Not quite all these actually do depend on f2c.h... -$(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ - $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT): $(F2C_H) +$(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \ + $(CHAR) $(F90BIT): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h -.PHONY: mostlyclean clean distclean maintainer-clean all +.PHONY: all diff --git a/libf2c/libI77/Makefile.in b/libf2c/libI77/Makefile.in index ec6f6970985..569b0a25dc4 100644 --- a/libf2c/libI77/Makefile.in +++ b/libf2c/libI77/Makefile.in @@ -1,7 +1,7 @@ # Makefile for GNU F77 compiler runtime. # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). -# Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. +# Portions of this file Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of GNU Fortran. @@ -21,19 +21,29 @@ #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #02111-1307, USA. -SHELL = /bin/sh +#### Start of system configuration section. #### + +# $(srcdir) must be set to the g77 runtime libF77 source directory +# (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ -#### Start of system configuration section. #### - -CPPFLAGS = @CPPFLAGS@ +# gcc/f/runtime/configure sets this to all the -D options appropriate +# for the configuration. DEFS = @DEFS@ -# f2c.h should already be installed in xgcc's include directory but add that -# to -I anyhow in case not using xgcc. -ALL_CFLAGS = -I. -I$(srcdir) -I.. $(CPPFLAGS) $(DEFS) $(CFLAGS) -CROSS = @CROSS@ + +#### End of system configuration section. #### + +# Must be passed in explicitly. Sample values are shown below. +#CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ +#CFLAGS = -O -g +#CPPFLAGS = +#F2C_H_DIR = /gcc-source-dir/f/runtime +#G2C_H_DIR = /gcc-build-dir/f/runtime +#GCC_H_DIR = /gcc-build-dir/include + +ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) .SUFFIXES: .SUFFIXES: .c .o @@ -47,18 +57,10 @@ OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \ ftell_.o -F2C_H = ../f2c.h - all: $(OBJ) VersionI.o: Version.c - $(CC) -c $(CGFLAGS) -o $@ $(srcdir)/Version.c - -mostlyclean clean: - -rm -f $(OBJ) - -distclean maintainer-clean: mostlyclean - -rm -f stage? include Makefile + $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c backspace.o: fio.h close.o: fio.h @@ -114,6 +116,6 @@ xwsne.o: lio.h xwsne.o: fmt.h # May be pessimistic: -$(OBJ): $(F2C_H) +$(OBJ): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h -.PHONY: mostlyclean clean distclean maintainer-clean all +.PHONY: all diff --git a/libf2c/libU77/Makefile.in b/libf2c/libU77/Makefile.in index 12d175ac681..c72f2f0a00e 100644 --- a/libf2c/libU77/Makefile.in +++ b/libf2c/libU77/Makefile.in @@ -1,37 +1,52 @@ # Makefile for GNU F77 compiler runtime, libc interface. -# Copyright (C) 1995-1997 Free Software Foundation, Inc. +# Copyright (C) 1995-1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # -#This file is part of GNU Fortran libU77 library. +#This file is part of the GNU Fortran libU77 library. # -#This library is free software; you can redistribute it and/or modify -#it under the terms of the GNU Library General Public License as -#published by the Free Software Foundation; either version 2, or (at -#your option) any later version. +#The GNU Fortran libU77 library is free software; you can redistribute +#it and/or modify it under the terms of the GNU Library General Public +#License as published by the Free Software Foundation; either version 2, +#or (at your option) any later version. # -#GNU Fortran is distributed in the hope that it will be useful, but -#WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -#Library General Public License for more details. +#GNU Fortran is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU Library General Public License for more details. # #You should have received a copy of the GNU General Public License #along with GNU Fortran; see the file COPYING. If not, write to -#Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +#02111-1307, USA. -SHELL = /bin/sh +#### Start of system configuration section. #### + +# $(srcdir) must be set to the g77 runtime libF77 source directory +# (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ -#### Start of system configuration section. #### - -CPPFLAGS = @CPPFLAGS@ +# gcc/f/runtime/configure sets this to all the -D options appropriate +# for the configuration. DEFS = @DEFS@ -# f2c.h should already be installed in xgcc's include directory but add that -# to -I anyhow in case not using xgcc. fio.h is in libI77. We need config.h -# from `.'. -ALL_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/../libI77 -I.. $(CPPFLAGS) $(DEFS) $(CFLAGS) -CROSS = @CROSS@ + +#### End of system configuration section. #### + +# Must be passed in explicitly. Sample values are shown below. +#CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ +#CFLAGS = -O -g +#CPPFLAGS = +#F2C_H_DIR = /gcc-source-dir/f/runtime +#G2C_H_DIR = /gcc-build-dir/f/runtime +#GCC_H_DIR = /gcc-build-dir/include + +# fio.h is in libI77. config.h is in `.'. +ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR)/libI77 -I$(F2C_H_DIR)/libI77 -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) + +# This could probably be done more elegantly, but it's currently +# just for running the u77-test test. +G77DIR = ../../../ .SUFFIXES: .SUFFIXES: .c .o @@ -60,36 +75,17 @@ SRCS = Version.c gerror_.c perror_.c ierrno_.c itime_.c time_.c \ umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \ alarm_.c -F2C_H = ../f2c.h - all: $(OBJS) VersionU.o: Version.c - $(CC) -c $(CGFLAGS) -o $@ $(srcdir)/Version.c - -lint: - lint $(CFLAGS) $(SRCS) - -mostlyclean: - -rm -f $(OBJS) - -clean: mostlyclean - -rm -f config.log a.out - -distclean realclean maintainer-clean: clean - -rm -f config.h Makefile config.status config.cache stage? include - -$(OBJS): $(F2C_H) config.h - -check: - -$(G77DIR)g77 -B$(G77DIR) -L.. -g $(srcdir)/u77-test.f $(lib) && ./a.out - rm -f a.out + $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c +$(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h access_.o: access_.c ctime_.o: ctime_.c dtime_.o: dtime_.c etime_.o: etime_.c -fnum_.o: fnum_.c $(srcdir)/../libI77/fio.h +fnum_.o: fnum_.c $(F2C_H_DIR)/libI77/fio.h fstat_.o: fstat_.c gerror_.o: gerror_.c getcwd_.o: getcwd_.c @@ -100,7 +96,7 @@ getuid_.o: getuid_.c idate_.o: idate_.c ierrno_.o: ierrno_.c irand_.o: irand_.c -isatty_.o: isatty_.c $(srcdir)/../libI77/fio.h +isatty_.o: isatty_.c $(F2C_H_DIR)/libI77/fio.h itime_.o: itime_.c kill_.o: kill_.c link_.o: link_.c @@ -141,4 +137,11 @@ flush1_.o: flush1_.c mclock_.o: mclock_.c alarm_.o: alarm_.c -.PHONY: mostlyclean clean distclean maintainer-clean lint check all +lint: + lint $(ALL_CFLAGS) $(SRCS) + +check: + -$(G77DIR)g77 -B$(G77DIR) -L.. -g $(srcdir)/u77-test.f $(lib) && ./a.out + rm -f a.out + +.PHONY: lint check all