C99 gprof configury

Message ID 20210405055048.GF5425@bubble.grove.modra.org
State New
Headers show
  • C99 gprof configury
Related show

Commit Message

H.J. Lu via Binutils April 5, 2021, 5:50 a.m.
This series of patches is a first pass at tidying some of the obsolete
configure tests we have in support of old systems.  No doubt there are
other things that could be removed too.

Given C99 we don't need to check HAVE_SETLOCALE.  The patch also
adds setitimer checks so that they can be removed from bfd where they
aren't needed.  According to the automake manual AC_ISC_POSIX is
obsolete, so that is removed.  HAVE_SETMODE isn't checked anywhere,
so it is pointless to have a configure test for setmode.

	* configure.ac: Check for sys/time.h and setitimer.  Don't invoke
	AC_ISC_POSIX.  Don't check for setmode.
	* gprof.c: Don't test HAVE_SETLOCALE.
	* gprof.h: Include sys/time.h.
	* configure: Regenerate.
	* gconfig.in: Regenerate.

Alan Modra
Australia Development Lab, IBM


diff --git a/gprof/configure.ac b/gprof/configure.ac
index 36a40848097..25aa108ecf6 100644
--- a/gprof/configure.ac
+++ b/gprof/configure.ac
@@ -21,7 +21,6 @@  AC_INIT([gprof], BFD_VERSION)
@@ -39,7 +38,9 @@  AC_PROG_INSTALL
+# These are in addition to what is made available in bfd/.
 ALL_LINGUAS="bg da de eo es fi fr ga hu id it ja ms nl pt_BR ro ru rw sr sv tr uk vi"
diff --git a/gprof/gprof.c b/gprof/gprof.c
index 678299e7b0e..6ed88ff4776 100644
--- a/gprof/gprof.c
+++ b/gprof/gprof.c
@@ -187,12 +187,10 @@  main (int argc, char **argv)
   Sym **cg = 0;
   int ch, user_specified = 0;
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
   setlocale (LC_MESSAGES, "");
-#if defined (HAVE_SETLOCALE)
   setlocale (LC_CTYPE, "");
 #ifdef ENABLE_NLS
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
diff --git a/gprof/gprof.h b/gprof/gprof.h
index e1ce282437a..1c23dd83f2f 100644
--- a/gprof/gprof.h
+++ b/gprof/gprof.h
@@ -40,6 +40,10 @@ 
 #include "gconfig.h"
+#include <sys/time.h>
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
@@ -58,9 +62,7 @@ 
 #define	GMONNAME	"gmon.out"	/* default profile filename */
 #define	GMONSUM		"gmon.sum"	/* profile summary filename */
-# include <locale.h>
+#include <locale.h>
 #ifdef ENABLE_NLS
 /* Undefine BFD's `_' macro - it uses dgetext() and we want to use gettext().  */