diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-05-09 22:47:59 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-05-09 22:47:59 +0000 |
commit | e3f07fb2c34a4337d0e95a0d2814ed0e312be1ae (patch) | |
tree | 1b3e8ec0841ab566eb88884cc3596cdc79bbdd34 /contrib/libf2c/libI77 | |
parent | 909b40107406b30c899ce55c127d8761e8b09ca8 (diff) | |
download | src-e3f07fb2c34a4337d0e95a0d2814ed0e312be1ae.tar.gz src-e3f07fb2c34a4337d0e95a0d2814ed0e312be1ae.zip |
Gcc 3.1.0 pre-release's libf2c bits from the FSF anoncvs repo on
9-May-2002 15:57:15 EDT.
Notes
Notes:
svn path=/vendor/gcc/dist/; revision=96295
Diffstat (limited to 'contrib/libf2c/libI77')
-rw-r--r-- | contrib/libf2c/libI77/Makefile.in | 153 | ||||
-rw-r--r-- | contrib/libf2c/libI77/Version.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libI77/backspace.c | 18 | ||||
-rw-r--r-- | contrib/libf2c/libI77/config.h.in | 29 | ||||
-rwxr-xr-x | contrib/libf2c/libI77/configure | 353 | ||||
-rw-r--r-- | contrib/libf2c/libI77/configure.in | 23 | ||||
-rw-r--r-- | contrib/libf2c/libI77/dfe.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libI77/due.c | 6 | ||||
-rw-r--r-- | contrib/libf2c/libI77/endfile.c | 15 | ||||
-rw-r--r-- | contrib/libf2c/libI77/err.c | 12 | ||||
-rw-r--r-- | contrib/libf2c/libI77/fio.h | 11 | ||||
-rw-r--r-- | contrib/libf2c/libI77/ftell_.c | 4 | ||||
-rw-r--r-- | contrib/libf2c/libI77/inquire.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libI77/open.c | 6 | ||||
-rw-r--r-- | contrib/libf2c/libI77/rdfmt.c | 2 | ||||
-rw-r--r-- | contrib/libf2c/libI77/rewind.c | 3 | ||||
-rw-r--r-- | contrib/libf2c/libI77/sfe.c | 1 | ||||
-rw-r--r-- | contrib/libf2c/libI77/sue.c | 16 | ||||
-rw-r--r-- | contrib/libf2c/libI77/wsfe.c | 1 |
19 files changed, 423 insertions, 236 deletions
diff --git a/contrib/libf2c/libI77/Makefile.in b/contrib/libf2c/libI77/Makefile.in index 544f24ef4d50..ff0d8e151768 100644 --- a/contrib/libf2c/libI77/Makefile.in +++ b/contrib/libf2c/libI77/Makefile.in @@ -31,15 +31,11 @@ VPATH = @srcdir@ # configuration. DEFS = @DEFS@ -LIBG2C = ../libg2c.a - F2C_H_DIR = @srcdir@/.. G2C_H_DIR = .. CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ -AR = @AR@ -ARFLAGS = rc @SET_MAKE@ SHELL = /bin/sh @@ -50,31 +46,31 @@ ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) \ $(DEFS) $(CFLAGS) .SUFFIXES: -.SUFFIXES: .c .o +.SUFFIXES: .c .lo -.c.o: - $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $< +.c.lo: + @LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $< -OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ - fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \ - rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \ - util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \ - ftell_.o +OBJS = VersionI.lo backspace.lo close.lo dfe.lo dolio.lo due.lo endfile.lo err.lo \ + fmt.lo fmtlib.lo iio.lo ilnw.lo inquire.lo lread.lo lwrite.lo open.lo \ + rdfmt.lo rewind.lo rsfe.lo rsli.lo rsne.lo sfe.lo sue.lo typesize.lo uio.lo \ + util.lo wref.lo wrtfmt.lo wsfe.lo wsle.lo wsne.lo xwsne.lo \ + ftell_.lo all: ../s-libi77 -../s-libi77: $(OBJ) - echo timestamp > ../s-libi77 - -archive: - $(AR) $(ARFLAGS) $(LIBG2C) $(OBJ) +../s-libi77: $(OBJS) + -rm -f $@.T $@ + objs='$(OBJS)'; for name in $$objs; do \ + echo libI77/$${name} >> $@.T; done + mv $@.T $@ Makefile: Makefile.in config.status $(SHELL) config.status config.status: configure rm -f config.cache - CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ + CONFIG_SITE=no-such-file CC='$(CC)' CFLAGS='$(CFLAGS)' \ CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck ${srcdir}/configure: configure.in @@ -93,72 +89,73 @@ stamp-h: config.h.in config.status CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) config.status echo timestamp > stamp-h -VersionI.o: Version.c - $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c - -backspace.o: backspace.c fio.h -close.o: close.c fio.h -dfe.o: fio.h -dfe.o: dfe.c fmt.h -dolio.o: dolio.c -due.o: due.c fio.h -endfile.o: endfile.c fio.h rawio.h config.h -err.o: err.c fio.h rawio.h -fmt.o: fio.h -fmt.o: fmt.c fmt.h -fmtlib.o: fmtlib.c -ftell_.o: ftell_.c fio.h -iio.o: fio.h -iio.o: iio.c fmt.h -ilnw.o: fio.h -ilnw.o: ilnw.c lio.h -inquire.o: inquire.c fio.h -lread.o: fio.h -lread.o: fmt.h -lread.o: lio.h -lread.o: lread.c fp.h -lwrite.o: fio.h -lwrite.o: fmt.h -lwrite.o: lwrite.c lio.h -open.o: open.c fio.h rawio.h -rdfmt.o: fio.h -rdfmt.o: fmt.h -rdfmt.o: rdfmt.c fp.h -rewind.o: rewind.c fio.h -rsfe.o: fio.h -rsfe.o: rsfe.c fmt.h -rsli.o: fio.h -rsli.o: rsli.c lio.h -rsne.o: fio.h -rsne.o: rsne.c lio.h -sfe.o: sfe.c fio.h -sue.o: sue.c fio.h -typesize.o: typesize.c -uio.o: uio.c fio.h -util.o: util.c fio.h -wref.o: fio.h -wref.o: fmt.h -wref.o: wref.c fp.h -wrtfmt.o: fio.h -wrtfmt.o: wrtfmt.c fmt.h -wsfe.o: fio.h -wsfe.o: wsfe.c fmt.h -wsle.o: fio.h -wsle.o: fmt.h -wsle.o: wsle.c lio.h -wsne.o: fio.h -wsne.o: wsne.c lio.h -xwsne.o: fio.h -xwsne.o: lio.h -xwsne.o: xwsne.c fmt.h +VersionI.lo: Version.c + @LIBTOOL@ --mode=compile $(CC) -c $(ALL_CFLAGS) $(srcdir)/Version.c -o $@ + +backspace.lo: backspace.c fio.h config.h +close.lo: close.c fio.h config.h +dfe.lo: fio.h config.h +dfe.lo: dfe.c fmt.h +dolio.lo: dolio.c config.h +due.lo: due.c fio.h config.h +endfile.lo: endfile.c fio.h config.h +err.lo: err.c fio.h config.h +fmt.lo: fio.h config.h +fmt.lo: fmt.c fmt.h +fmtlib.lo: fmtlib.c config.h +ftell_.lo: ftell_.c fio.h config.h +iio.lo: fio.h +iio.lo: iio.c fmt.h +ilnw.lo: fio.h config.h +ilnw.lo: ilnw.c lio.h +inquire.lo: inquire.c fio.h config.h +lread.lo: fio.h config.h +lread.lo: fmt.h +lread.lo: lio.h +lread.lo: lread.c fp.h +lwrite.lo: fio.h +lwrite.lo: fmt.h +lwrite.lo: lwrite.c lio.h +open.lo: open.c fio.h config.h +rdfmt.lo: fio.h config.h +rdfmt.lo: fmt.h +rdfmt.lo: rdfmt.c fp.h +rewind.lo: rewind.c fio.h config.h +rsfe.lo: fio.h config.h +rsfe.lo: rsfe.c fmt.h +rsli.lo: fio.h +rsli.lo: rsli.c lio.h +rsne.lo: fio.h config.h +rsne.lo: rsne.c lio.h +sfe.lo: sfe.c fio.h config.h +sue.lo: sue.c fio.h config.h +typesize.lo: typesize.c config.h +uio.lo: uio.c fio.h +util.lo: util.c fio.h config.h +wref.lo: fio.h +wref.lo: fmt.h +wref.lo: wref.c fp.h +wrtfmt.lo: fio.h config.h +wrtfmt.lo: wrtfmt.c fmt.h +wsfe.lo: fio.h config.h +wsfe.lo: wsfe.c fmt.h +wsle.lo: fio.h config.h +wsle.lo: fmt.h +wsle.lo: wsle.c lio.h +wsne.lo: fio.h +wsne.lo: wsne.c lio.h +xwsne.lo: fio.h config.h +xwsne.lo: lio.h +xwsne.lo: xwsne.c fmt.h # May be pessimistic: -$(OBJ): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h +$(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h check install uninstall install-strip dist installcheck installdirs: mostlyclean: - rm -f *.o + rm -f *.o *.lo + rm -rf .libs clean: mostlyclean rm -f config.log ../s-libi77 diff --git a/contrib/libf2c/libI77/Version.c b/contrib/libf2c/libI77/Version.c index 0ff447fecc8e..51f3d166b966 100644 --- a/contrib/libf2c/libI77/Version.c +++ b/contrib/libf2c/libI77/Version.c @@ -3,7 +3,7 @@ static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n"; /* */ -char __G77_LIBI77_VERSION__[] = "0.5.26 20011023 (release)"; +char __G77_LIBI77_VERSION__[] = "3.1 20020509 (prerelease)"; /* 2.01 $ format added diff --git a/contrib/libf2c/libI77/backspace.c b/contrib/libf2c/libI77/backspace.c index b2bd4163222a..848923912bf8 100644 --- a/contrib/libf2c/libI77/backspace.c +++ b/contrib/libf2c/libI77/backspace.c @@ -8,7 +8,7 @@ integer f_back(a) alist *a; integer f_back(alist *a) #endif { unit *b; - long v, w, x, y, z; + off_t v, w, x, y, z; uiolen n; FILE *f; @@ -34,31 +34,31 @@ integer f_back(alist *a) f = b->ufd; /* may have changed in t_runc() */ if(b->url>0) { - x=ftell(f); + x=FTELL(f); y = x % b->url; if(y == 0) x--; x /= b->url; x *= b->url; - (void) fseek(f,x,SEEK_SET); + FSEEK(f,x,SEEK_SET); return(0); } if(b->ufmt==0) - { fseek(f,-(long)sizeof(uiolen),SEEK_CUR); + { FSEEK(f,-(off_t)sizeof(uiolen),SEEK_CUR); fread((char *)&n,sizeof(uiolen),1,f); - fseek(f,-(long)n-2*sizeof(uiolen),SEEK_CUR); + FSEEK(f,-(off_t)n-2*sizeof(uiolen),SEEK_CUR); return(0); } - w = x = ftell(f); + w = x = FTELL(f); z = 0; loop: while(x) { x -= x < 64 ? x : 64; - fseek(f,x,SEEK_SET); + FSEEK(f,x,SEEK_SET); for(y = x; y < w; y++) { if (getc(f) != '\n') continue; - v = ftell(f); + v = FTELL(f); if (v == w) { if (z) goto break2; @@ -69,6 +69,6 @@ integer f_back(alist *a) err(a->aerr,(EOF),"backspace"); } break2: - fseek(f, z, SEEK_SET); + FSEEK(f, z, SEEK_SET); return 0; } diff --git a/contrib/libf2c/libI77/config.h.in b/contrib/libf2c/libI77/config.h.in index 58f83af092fd..3ae78d198ad7 100644 --- a/contrib/libf2c/libI77/config.h.in +++ b/contrib/libf2c/libI77/config.h.in @@ -6,15 +6,18 @@ /* Define to `long' if <sys/types.h> doesn't define. */ #undef off_t -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - /* Define to `unsigned' if <sys/types.h> doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you have the fseeko function. */ +#undef HAVE_FSEEKO + +/* Define if you have the ftello function. */ +#undef HAVE_FTELLO + /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE @@ -24,11 +27,23 @@ /* Define if you have the tempnam function. */ #undef HAVE_TEMPNAM -/* Define if fcntl.h is missing. */ -#undef NO_FCNTL +/* Define if you have the tmpnam function. */ +#undef HAVE_TMPNAM + +/* Get Single Unix Specification semantics */ +#undef _XOPEN_SOURCE + +/* Get Single Unix Specification semantics */ +#undef _XOPEN_SOURCE_EXTENDED + +/* Solaris extensions */ +#undef __EXTENSIONS__ + +/* Get 64-bit file size support */ +#undef _FILE_OFFSET_BITS -/* Define if fcntl.h is missing. */ -#undef OPEN_DECL +/* Define for HP-UX ftello and fseeko extension. */ +#undef _LARGEFILE_SOURCE /* Define if we do not have Unix Stdio. */ #undef NON_UNIX_STDIO diff --git a/contrib/libf2c/libI77/configure b/contrib/libf2c/libI77/configure index ec7988e86b4c..e064fbaa43e1 100755 --- a/contrib/libf2c/libI77/configure +++ b/contrib/libf2c/libI77/configure @@ -523,6 +523,31 @@ fi +# These defines are necessary to get 64-bit file size support. + +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 500L +EOF + +# The following is needed by irix6.2 so that struct timeval is declared. +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF + +# The following is needed by Solaris2.5.1 so that struct timeval is declared. +cat >> confdefs.h <<\EOF +#define __EXTENSIONS__ 1 +EOF + +cat >> confdefs.h <<\EOF +#define _FILE_OFFSET_BITS 64 +EOF + +cat >> confdefs.h <<\EOF +#define _LARGEFILE_SOURCE 1 +EOF + + @@ -531,7 +556,7 @@ fi # 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:535: 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 @@ -561,7 +586,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:565: checking for $ac_word" >&5 +echo "configure:590: 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 +637,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:616: checking for $ac_word" >&5 +echo "configure:641: 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 @@ -645,7 +670,7 @@ fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:649: checking whether we are using GNU C" >&5 +echo "configure:674: 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 @@ -654,7 +679,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:658: \"$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:683: \"$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 @@ -673,7 +698,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:677: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:702: 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 @@ -705,10 +730,13 @@ else fi +LIBTOOL='$(SHELL) ../libtool' + + test "$AR" || AR=ar echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:712: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:740: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -738,7 +766,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:742: checking how to run the C preprocessor" >&5 +echo "configure:770: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -753,13 +781,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 757 "configure" +#line 785 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -770,13 +798,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 774 "configure" +#line 802 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -787,13 +815,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 791 "configure" +#line 819 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -819,17 +847,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:823: checking for stdio.h" >&5 +echo "configure:851: 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 -#line 828 "configure" +#line 856 "configure" #include "confdefs.h" #include <stdio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -857,12 +885,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:861: checking for ANSI C header files" >&5 +echo "configure:889: 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 <<EOF -#line 866 "configure" +#line 894 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -870,7 +898,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -887,7 +915,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 -#line 891 "configure" +#line 919 "configure" #include "confdefs.h" #include <string.h> EOF @@ -905,7 +933,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 -#line 909 "configure" +#line 937 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -926,7 +954,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 930 "configure" +#line 958 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -937,7 +965,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -962,12 +990,12 @@ fi echo $ac_n "checking for posix""... $ac_c" 1>&6 -echo "configure:966: checking for posix" >&5 +echo "configure:994: 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 <<EOF -#line 971 "configure" +#line 999 "configure" #include "confdefs.h" #include <sys/types.h> #include <unistd.h> @@ -993,12 +1021,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:997: checking for GNU library" >&5 +echo "configure:1025: 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 <<EOF -#line 1002 "configure" +#line 1030 "configure" #include "confdefs.h" #include <stdio.h> #ifdef __GNU_LIBRARY__ @@ -1022,12 +1050,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:1026: checking for cyg\`win'32" >&5 +echo "configure:1054: 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 <<EOF -#line 1031 "configure" +#line 1059 "configure" #include "confdefs.h" #ifdef __CYGWIN32__ yes @@ -1050,12 +1078,12 @@ echo "$ac_t""$g77_cv_sys_cygwin32" 1>&6 # ditto for mingw32. echo $ac_n "checking for mingw32""... $ac_c" 1>&6 -echo "configure:1054: checking for mingw32" >&5 +echo "configure:1082: 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 <<EOF -#line 1059 "configure" +#line 1087 "configure" #include "confdefs.h" #ifdef __MINGW32__ yes @@ -1077,58 +1105,13 @@ fi echo "$ac_t""$g77_cv_sys_mingw32" 1>&6 -ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 -echo "configure:1083: 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 -#line 1088 "configure" -#include "confdefs.h" -#include <fcntl.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - test $g77_cv_header_posix = yes && cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_FCNTL 1 -EOF - - cat >> confdefs.h <<\EOF -#define OPEN_DECL 1 -EOF - -fi - - echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1127: 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 <<EOF -#line 1132 "configure" +#line 1115 "configure" #include "confdefs.h" int main() { @@ -1177,7 +1160,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1181: \"$ac_compile\") 1>&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 @@ -1198,12 +1181,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1202: 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 <<EOF -#line 1207 "configure" +#line 1190 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1236,12 +1219,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:1240: checking for fstat" >&5 +echo "configure:1223: 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 <<EOF -#line 1245 "configure" +#line 1228 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char fstat(); below. */ @@ -1264,7 +1247,7 @@ fstat(); ; return 0; } EOF -if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_fstat=yes" else @@ -1284,7 +1267,7 @@ else fi echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6 -echo "configure:1288: checking need for NON_UNIX_STDIO" >&5 +echo "configure:1271: 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 @@ -1297,15 +1280,125 @@ else echo "$ac_t""no" 1>&6 fi +for ac_func in fseeko +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1287: 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 <<EOF +#line 1292 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_func in ftello +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1342: 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 <<EOF +#line 1347 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + for ac_func in ftruncate do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1304: checking for $ac_func" >&5 +echo "configure:1397: 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 <<EOF -#line 1309 "configure" +#line 1402 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1328,7 +1421,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1355,12 +1448,12 @@ done for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1359: checking for $ac_func" >&5 +echo "configure:1452: 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 <<EOF -#line 1364 "configure" +#line 1457 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1383,7 +1476,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1410,12 +1503,12 @@ done for ac_func in tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1414: checking for $ac_func" >&5 +echo "configure:1507: 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 <<EOF -#line 1419 "configure" +#line 1512 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1438,7 +1531,62 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_func in tmpnam +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1562: 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 <<EOF +#line 1567 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1468,19 +1616,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:1472: checking for ansi/posix sprintf result" >&5 +echo "configure:1620: checking for ansi/posix sprintf result" >&5 if test "$cross_compiling" = yes; then g77_cv_sys_sprintf_ansi=no else cat > conftest.$ac_ext <<EOF -#line 1477 "configure" +#line 1625 "configure" #include "confdefs.h" #include <stdio.h> /* 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:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then g77_cv_sys_sprintf_ansi=yes else @@ -1511,9 +1659,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:1515: checking NON_ANSI_RW_MODES" >&5 +echo "configure:1663: checking NON_ANSI_RW_MODES" >&5 cat > conftest.$ac_ext <<EOF -#line 1517 "configure" +#line 1665 "configure" #include "confdefs.h" #ifdef unix yes @@ -1558,12 +1706,12 @@ EOF echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1562: checking for off_t" >&5 +echo "configure:1710: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1567 "configure" +#line 1715 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1729,6 +1877,7 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g +s%@LIBTOOL@%$LIBTOOL%g s%@AR@%$AR%g s%@SET_MAKE@%$SET_MAKE%g s%@CPP@%$CPP%g diff --git a/contrib/libf2c/libI77/configure.in b/contrib/libf2c/libI77/configure.in index 20f2628ba3a2..988a8e542c30 100644 --- a/contrib/libf2c/libI77/configure.in +++ b/contrib/libf2c/libI77/configure.in @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -# Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc. +# Copyright (C) 1995, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of GNU Fortran. @@ -23,6 +23,16 @@ AC_PREREQ(2.12.1) AC_INIT(ftell_.c) AC_CONFIG_HEADER(config.h) +# These defines are necessary to get 64-bit file size support. + +AC_DEFINE(_XOPEN_SOURCE, 500L, [Get Single Unix Specification semantics]) +# The following is needed by irix6.2 so that struct timeval is declared. +AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Get Single Unix Specification semantics]) +# The following is needed by Solaris2.5.1 so that struct timeval is declared. +AC_DEFINE(__EXTENSIONS__, 1, [Solaris extensions]) +AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) +AC_DEFINE(_LARGEFILE_SOURCE, 1, [Define for HP-UX ftello and fseeko extension.]) + dnl Checks for programs. dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may @@ -33,6 +43,9 @@ define([AC_PROG_CC_WORKS],[]) # the makefiles AC_PROG_CC +LIBTOOL='$(SHELL) ../libtool' +AC_SUBST(LIBTOOL) + test "$AR" || AR=ar AC_SUBST(AR) AC_PROG_MAKE_SET @@ -111,11 +124,6 @@ AC_CACHE_VAL(g77_cv_sys_mingw32, AC_MSG_RESULT($g77_cv_sys_mingw32) -AC_CHECK_HEADER(fcntl.h, - test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE), - AC_DEFINE(NO_FCNTL, 1, [Define if fcntl.h is missing.]) - AC_DEFINE(OPEN_DECL, 1, [Define if fcntl.h is missing.])) - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T @@ -136,9 +144,12 @@ else AC_MSG_RESULT(no) fi +AC_CHECK_FUNCS(fseeko) +AC_CHECK_FUNCS(ftello) AC_CHECK_FUNCS(ftruncate) AC_CHECK_FUNCS(mkstemp) AC_CHECK_FUNCS(tempnam) +AC_CHECK_FUNCS(tmpnam) # posix will guarantee the right behaviour for sprintf, else we can't be # sure; HEADER_STDC wouldn't be the right check in sunos4, for instance. diff --git a/contrib/libf2c/libI77/dfe.c b/contrib/libf2c/libI77/dfe.c index e90b16d05511..18edabc9cd10 100644 --- a/contrib/libf2c/libI77/dfe.c +++ b/contrib/libf2c/libI77/dfe.c @@ -82,7 +82,7 @@ c_dfe(cilist *a) f__fmtbuf=a->cifmt; if(a->cirec <= 0) err(a->cierr,130,"dfe"); - (void) fseek(f__cf,(long)f__curunit->url * (a->cirec-1),SEEK_SET); + FSEEK(f__cf,(off_t)f__curunit->url * (a->cirec-1),SEEK_SET); f__curunit->uend = 0; return(0); } diff --git a/contrib/libf2c/libI77/due.c b/contrib/libf2c/libI77/due.c index df3413321500..f7d6941935e1 100644 --- a/contrib/libf2c/libI77/due.c +++ b/contrib/libf2c/libI77/due.c @@ -25,7 +25,7 @@ c_due(cilist *a) if(f__curunit->ufd==NULL) err(a->cierr,114,"cdue"); if(a->cirec <= 0) err(a->cierr,130,"due"); - fseek(f__cf,(long)(a->cirec-1)*f__curunit->url,SEEK_SET); + FSEEK(f__cf,(off_t)(a->cirec-1)*f__curunit->url,SEEK_SET); f__curunit->uend = 0; return(0); } @@ -60,8 +60,8 @@ integer e_rdue(Void) f__init = 1; if(f__curunit->url==1 || f__recpos==f__curunit->url) return(0); - fseek(f__cf,(long)(f__curunit->url-f__recpos),SEEK_CUR); - if(ftell(f__cf)%f__curunit->url) + FSEEK(f__cf,(off_t)(f__curunit->url-f__recpos),SEEK_CUR); + if(FTELL(f__cf)%f__curunit->url) err(f__elist->cierr,200,"syserr"); return(0); } diff --git a/contrib/libf2c/libI77/endfile.c b/contrib/libf2c/libI77/endfile.c index 980c91d22820..4c5a9dd21d63 100644 --- a/contrib/libf2c/libI77/endfile.c +++ b/contrib/libf2c/libI77/endfile.c @@ -70,7 +70,7 @@ t_runc(a) alist *a; t_runc(alist *a) #endif { - long loc, len; + off_t loc, len; unit *b; int rc; FILE *bf; @@ -81,9 +81,9 @@ t_runc(alist *a) b = &f__units[a->aunit]; if(b->url) return(0); /*don't truncate direct files*/ - loc=ftell(bf = b->ufd); - fseek(bf,0L,SEEK_END); - len=ftell(bf); + loc=FTELL(bf = b->ufd); + FSEEK(bf,0,SEEK_END); + len=FTELL(bf); if (loc >= len || b->useek == 0 || b->ufnm == NULL) return(0); #ifndef HAVE_FTRUNCATE @@ -111,7 +111,7 @@ t_runc(alist *a) } if (!(bf = freopen(b->ufnm, f__w_mode[0], bf))) goto bad1; - rewind(tf); + FSEEK(tf, 0, SEEK_SET); if (copy(tf, loc, bf)) goto bad1; b->uwrt = 1; @@ -121,7 +121,7 @@ t_runc(alist *a) fclose(bf); if (!(bf = fopen(b->ufnm, f__w_mode[3]))) goto bad; - fseek(bf,0L,SEEK_END); + FSEEK(bf,0,SEEK_END); b->urw = 3; } #endif @@ -131,7 +131,8 @@ done: f__cf = b->ufd = bf; #else /* !defined(HAVE_FTRUNCATE) */ fflush(b->ufd); - rc = ftruncate(fileno(b->ufd), (off_t)loc); + rc = ftruncate(fileno(b->ufd), loc); + FSEEK(bf,loc,SEEK_SET); #endif /* !defined(HAVE_FTRUNCATE) */ if (rc) err(a->aerr,111,"endfile"); diff --git a/contrib/libf2c/libI77/err.c b/contrib/libf2c/libI77/err.c index 6784cdd45766..1c21f198cdbc 100644 --- a/contrib/libf2c/libI77/err.c +++ b/contrib/libf2c/libI77/err.c @@ -210,7 +210,7 @@ f__nowreading(x) unit *x; f__nowreading(unit *x) #endif { - long loc; + off_t loc; int ufmt, urw; extern char *f__r_mode[], *f__w_mode[]; @@ -219,7 +219,7 @@ f__nowreading(unit *x) if (!x->ufnm) goto cantread; ufmt = x->url ? 0 : x->ufmt; - loc = ftell(x->ufd); + loc = FTELL(x->ufd); urw = 3; if (!freopen(x->ufnm, f__w_mode[ufmt|2], x->ufd)) { urw = 1; @@ -229,7 +229,7 @@ f__nowreading(unit *x) return 1; } } - fseek(x->ufd,loc,SEEK_SET); + FSEEK(x->ufd,loc,SEEK_SET); x->urw = urw; done: x->uwrt = 0; @@ -241,7 +241,7 @@ f__nowwriting(x) unit *x; f__nowwriting(unit *x) #endif { - long loc; + off_t loc; int ufmt; extern char *f__w_mode[]; @@ -257,7 +257,7 @@ f__nowwriting(unit *x) x->urw = 2; } else { - loc=ftell(x->ufd); + loc=FTELL(x->ufd); if (!(f__cf = x->ufd = freopen(x->ufnm, f__w_mode[ufmt |= 2], x->ufd))) { @@ -267,7 +267,7 @@ f__nowwriting(unit *x) return(1); } x->urw = 3; - fseek(x->ufd,loc,SEEK_SET); + FSEEK(x->ufd,loc,SEEK_SET); } done: x->uwrt = 1; diff --git a/contrib/libf2c/libI77/fio.h b/contrib/libf2c/libI77/fio.h index 846351d5413f..8c6d274fe498 100644 --- a/contrib/libf2c/libI77/fio.h +++ b/contrib/libf2c/libI77/fio.h @@ -1,3 +1,4 @@ +#include <sys/types.h> #include <stdio.h> #include <errno.h> #ifndef NULL @@ -14,6 +15,16 @@ #define SEEK_END 2 #endif +/* Only use fseeko/ftello if they are both there. */ + +#if defined (HAVE_FSEEKO) && defined (HAVE_FTELLO) +#define FSEEK fseeko +#define FTELL ftello +#else +#define FSEEK fseek +#define FTELL ftell +#endif + #if defined (MSDOS) && !defined (GO32) #ifndef NON_UNIX_STDIO #define NON_UNIX_STDIO diff --git a/contrib/libf2c/libI77/ftell_.c b/contrib/libf2c/libI77/ftell_.c index 1f6d87f50bd5..250a0cc9bcd5 100644 --- a/contrib/libf2c/libI77/ftell_.c +++ b/contrib/libf2c/libI77/ftell_.c @@ -22,7 +22,7 @@ G77_ftell_0 (integer *Unit) #endif { FILE *f; - return (f = unit_chk(*Unit, "ftell")) ? ftell(f) : -1L; + return (f = unit_chk(*Unit, "ftell")) ? (integer) FTELL(f) : -1L; } integer @@ -43,5 +43,5 @@ G77_fseek_0 (integer *Unit, integer *offset, integer *xwhence) w = wohin[w]; #endif return !(f = unit_chk(*Unit, "fseek")) - || fseek(f, *offset, w) ? 1 : 0; + || FSEEK(f, (off_t) *offset, w) ? 1 : 0; } diff --git a/contrib/libf2c/libI77/inquire.c b/contrib/libf2c/libI77/inquire.c index 71eb700a57a1..5c5575a1d124 100644 --- a/contrib/libf2c/libI77/inquire.c +++ b/contrib/libf2c/libI77/inquire.c @@ -100,7 +100,7 @@ integer f_inqu(inlist *a) if(a->inrecl!=NULL && p!=NULL) *a->inrecl=p->url; if(a->innrec!=NULL && p!=NULL && p->url>0) - *a->innrec=ftell(p->ufd)/p->url+1; + *a->innrec=FTELL(p->ufd)/p->url+1; if(a->inblank && p!=NULL && p->ufmt) if(p->ublnk) b_char("ZERO",a->inblank,a->inblanklen); diff --git a/contrib/libf2c/libI77/open.c b/contrib/libf2c/libI77/open.c index 56bbc5232eee..9457ccc807b2 100644 --- a/contrib/libf2c/libI77/open.c +++ b/contrib/libf2c/libI77/open.c @@ -231,7 +231,7 @@ integer f_open(olist *a) (void) strcpy (buf, s); free (s); #else /* ! defined (HAVE_TEMPNAM) */ -#ifdef _POSIX_SOURCE +#ifdef HAVE_TMPNAM tmpnam(buf); #else (void) strcpy(buf,"tmp.FXXXXXX"); @@ -281,9 +281,9 @@ integer f_open(olist *a) #endif if(b->useek) if (a->orl) - rewind(b->ufd); + FSEEK(b->ufd, 0, SEEK_SET); else if ((s = a->oacc) && (*s == 'a' || *s == 'A') - && fseek(b->ufd, 0L, SEEK_END)) + && FSEEK(b->ufd, 0, SEEK_END)) opnerr(a->oerr,129,"open"); return(0); } diff --git a/contrib/libf2c/libI77/rdfmt.c b/contrib/libf2c/libI77/rdfmt.c index 6ddd36958a5b..81426ae7d1a2 100644 --- a/contrib/libf2c/libI77/rdfmt.c +++ b/contrib/libf2c/libI77/rdfmt.c @@ -471,7 +471,7 @@ rd_ed(struct syl *p, char *ptr, ftnlen len) f__icptr += f__cursor; } else if(f__curunit && f__curunit->useek) - (void) fseek(f__cf,(long) f__cursor,SEEK_CUR); + FSEEK(f__cf,(off_t)f__cursor,SEEK_CUR); else err(f__elist->cierr,106,"fmt"); f__recpos += f__cursor; diff --git a/contrib/libf2c/libI77/rewind.c b/contrib/libf2c/libI77/rewind.c index 9ba4b239f328..06915195d670 100644 --- a/contrib/libf2c/libI77/rewind.c +++ b/contrib/libf2c/libI77/rewind.c @@ -1,3 +1,4 @@ +#include "config.h" #include "f2c.h" #include "fio.h" #ifdef KR_headers @@ -20,7 +21,7 @@ integer f_rew(alist *a) (void) t_runc(a); b->uwrt = 3; } - rewind(b->ufd); + FSEEK(b->ufd, 0, SEEK_SET); b->uend=0; return(0); } diff --git a/contrib/libf2c/libI77/sfe.c b/contrib/libf2c/libI77/sfe.c index 77ade5b5a7f5..b67d823cf7c6 100644 --- a/contrib/libf2c/libI77/sfe.c +++ b/contrib/libf2c/libI77/sfe.c @@ -1,4 +1,5 @@ /* sequential formatted external common routines*/ +#include "config.h" #include "f2c.h" #include "fio.h" diff --git a/contrib/libf2c/libI77/sue.c b/contrib/libf2c/libI77/sue.c index e7dbba02bd48..8865054b10b7 100644 --- a/contrib/libf2c/libI77/sue.c +++ b/contrib/libf2c/libI77/sue.c @@ -2,7 +2,7 @@ #include "f2c.h" #include "fio.h" extern uiolen f__reclen; -long f__recloc; +off_t f__recloc; #ifdef KR_headers c_sue(a) cilist *a; @@ -62,27 +62,27 @@ integer s_wsue(cilist *a) f__reclen=0; if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr, errno, "write start"); - f__recloc=ftell(f__cf); - (void) fseek(f__cf,(long)sizeof(uiolen),SEEK_CUR); + f__recloc=FTELL(f__cf); + FSEEK(f__cf,(off_t)sizeof(uiolen),SEEK_CUR); return(0); } integer e_wsue(Void) -{ long loc; +{ off_t loc; f__init = 1; fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf); #ifdef ALWAYS_FLUSH if (fflush(f__cf)) err(f__elist->cierr, errno, "write end"); #endif - loc=ftell(f__cf); - fseek(f__cf,f__recloc,SEEK_SET); + loc=FTELL(f__cf); + FSEEK(f__cf,f__recloc,SEEK_SET); fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf); - fseek(f__cf,loc,SEEK_SET); + FSEEK(f__cf,loc,SEEK_SET); return(0); } integer e_rsue(Void) { f__init = 1; - (void) fseek(f__cf,(long)(f__reclen-f__recpos+sizeof(uiolen)),SEEK_CUR); + FSEEK(f__cf,(off_t)(f__reclen-f__recpos+sizeof(uiolen)),SEEK_CUR); return(0); } diff --git a/contrib/libf2c/libI77/wsfe.c b/contrib/libf2c/libI77/wsfe.c index babfb3479d9a..490231ac75ad 100644 --- a/contrib/libf2c/libI77/wsfe.c +++ b/contrib/libf2c/libI77/wsfe.c @@ -1,4 +1,5 @@ /*write sequential formatted external*/ +#include "config.h" #include "f2c.h" #include "fio.h" #include "fmt.h" |