Patch to remove AC_CHECK_FUNCS junk and zap f/proj.c

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Wed Nov 21 13:16:00 GMT 2001


I noticed that gcc/configure.in AC_CHECK_FUNCS had accumulated lots of
junk we no longer need:

strtoul:
Was used to provide a strtoul backup in f/proj.c, but it's also
provided by libiberty.  Fortran use zapped.  Used in intl, but checked
for in AM_GNU_GETTEXT.

bsearch:
Was used to provide a bsearch backup in f/proj.c, but it's also
provided by libiberty.  Fortran use zapped.  (The whole file goes.)

popen:
libgcc2.c checks HAVE_POPEN, but it's a target file which doesn't use
autoconf macros.  No other uses found.

strchr:
HAVE_STRCHR used in intl directory, but checked for in AM_GNU_GETTEXT.
Also libiberty provides a backup.

strrchr:
Libiberty provides a backup.  No HAVE_STRRCHR checks found.

isascii
Left over from before we had safe-ctype.h.  No longer used.

gettimeofday
No longer used.

Bootstrap underway on sparc-sun-solaris2, reached stage3 so far.

Ok to install?

		Thanks,
		--Kaveh


2001-11-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* configure.in (AC_CHECK_FUNCS): Delete strtoul, bsearch, popen,
	strchr, strrchr, isascii, gettimeofday.
	* config.in, configure: Regenerate.

f:
	* Make-lang.in: Delete references to proj.[co], proj-h.[co].
	* proj.c: Delete file.

diff -rup orig/egcc-CVS20011130/gcc/configure.in egcc-CVS20011130/gcc/configure.in
--- orig/egcc-CVS20011130/gcc/configure.in	Fri Nov 30 07:30:44 2001
+++ egcc-CVS20011130/gcc/configure.in	Fri Nov 30 19:07:10 2001
@@ -578,11 +578,9 @@ fi
 dnl Disabled until we have a complete test for buggy enum bitfields.
 dnl gcc_AC_C_ENUM_BF_UNSIGNED
 
-AC_CHECK_FUNCS(strtoul bsearch popen times clock dup2 \
-	strchr strrchr kill getrlimit setrlimit atoll atoq \
-	sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
-	fputs_unlocked fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
-	lstat)
+AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
+	sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
+	fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat)
 
 AC_CHECK_TYPE(ssize_t, int)
 
diff -rup orig/egcc-CVS20011130/gcc/f/Make-lang.in egcc-CVS20011130/gcc/f/Make-lang.in
--- orig/egcc-CVS20011130/gcc/f/Make-lang.in	Fri Nov 30 07:31:05 2001
+++ egcc-CVS20011130/gcc/f/Make-lang.in	Fri Nov 30 19:03:21 2001
@@ -91,7 +91,7 @@ g77-cross$(exeext): g77$(exeext)
 
 F77_OBJS = f/bad.o f/bit.o f/bld.o f/com.o f/data.o f/equiv.o f/expr.o \
  f/global.o f/implic.o f/info.o f/intrin.o f/lab.o f/lex.o f/malloc.o \
- f/name.o f/parse.o f/proj.o f/src.o f/st.o f/sta.o f/stb.o f/stc.o \
+ f/name.o f/parse.o f/src.o f/st.o f/sta.o f/stb.o f/stc.o \
  f/std.o f/ste.o f/storag.o f/stp.o f/str.o f/sts.o f/stt.o f/stu.o \
  f/stv.o f/stw.o f/symbol.o f/target.o f/top.o f/type.o f/version.o f/where.o
 
@@ -129,20 +129,14 @@ f/str-op.h f/str-op.j: f/fini$(build_exe
 f/str-ot.h f/str-ot.j: f/fini$(build_exeext) f/str-ot.fin
 	./f/fini$(build_exeext) $(srcdir)/f/str-ot.fin f/str-ot.j f/str-ot.h
 
-f/fini$(build_exeext): f/fini.o f/proj-h.o $(HOST_LIBDEPS)
+f/fini$(build_exeext): f/fini.o $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini$(build_exeext) \
-		f/fini.o f/proj-h.o $(HOST_LIBS)
+		f/fini.o $(HOST_LIBS)
 
 f/fini.o:
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
 	      -c $(srcdir)/f/fini.c $(OUTPUT_OPTION)
 
-# Like proj.o, but depends on hconfig.h instead of config.h.
-f/proj-h.o: f/proj.c f/proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
-	$(HOST_CC) -DUSE_HCONFIG \
-		$(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
-		-c $(srcdir)/f/proj.c $(OUTPUT_OPTION)
-
 #
 # Build hooks:
 
@@ -428,7 +422,6 @@ f/parse.o: f/parse.c f/proj.h $(CONFIG_H
  f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
  f/bad.def f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
  f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h f/version.h flags.h
-f/proj.o: f/proj.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h
 f/src.o: f/src.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/src.h f/bad.h f/bad.def \
  f/where.h glimits.h f/top.h f/malloc.h
 f/st.o: f/st.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/st.h f/bad.h f/bad.def \
diff -rup orig/egcc-CVS20011130/gcc/f/proj.c egcc-CVS20011130/gcc/f/proj.c
--- orig/egcc-CVS20011130/gcc/f/proj.c	Wed Jun 21 16:11:14 2000
+++ egcc-CVS20011130/gcc/f/proj.c	Fri Nov 30 19:03:56 2001
@@ -1,68 +0,0 @@
-/* proj.c file for GNU Fortran
-   Copyright (C) 1995 Free Software Foundation, Inc.
-   Contributed by James Craig Burley.
-
-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.	 */
-
-#include "proj.h"
-#include "glimits.h"
-
-#ifndef HAVE_STRTOUL
-unsigned long int
-strtoul (const char *nptr, char **endptr, int base)
-{
-  unsigned long int number = 0;
-  unsigned long int old_number = 0;
-
-  assert (base == 10);
-  assert (endptr == NULL);
-
-  while (ISDIGIT (*nptr))
-    {
-      number = old_number * 10 + (*(nptr++) - '0');
-      if ((number <= old_number) && (old_number != 0))
-	return ULONG_MAX;
-      old_number = number;
-    }
-
-  return number;
-}
-#endif
-
-#ifndef HAVE_BSEARCH
-void *
-bsearch (const void *key, const void *base, size_t nmemb, size_t size,
-	 int (*compar) (const void *, const void *))
-{
-  size_t i;
-  int cmp;
-
-  /* We do a dumb incremental search, not a binary search, for now. */
-
-  for (i = 0; i < nmemb; ++i)
-    {
-      if ((cmp = (*compar) (key, base)) == 0)
-	return base;
-      if (cmp < 0)
-	break;
-      base += size;
-    }
-
-  return NULL;
-}
-#endif



More information about the Gcc-patches mailing list