public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* C99 gprof configury
@ 2021-04-05  5:50 Alan Modra
  2021-04-05  5:52 ` C99 bfd configury Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2021-04-05  5:50 UTC (permalink / raw)
  To: binutils

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.

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)
 AC_CONFIG_SRCDIR([gprof.c])
 
 AC_CANONICAL_TARGET([])
-AC_ISC_POSIX
 
 AM_INIT_AUTOMAKE
 
@@ -39,7 +38,9 @@ AC_PROG_INSTALL
 LT_INIT
 ACX_LARGEFILE
 
-AC_CHECK_FUNCS(setmode)
+# These are in addition to what is made available in bfd/.
+AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_FUNCS(setitimer)
 
 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"
 ZW_GNU_GETTEXT_SISTER_DIR
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)
+#ifdef HAVE_LC_MESSAGES
   setlocale (LC_MESSAGES, "");
 #endif
-#if defined (HAVE_SETLOCALE)
   setlocale (LC_CTYPE, "");
-#endif
 #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 @@
 #undef PACKAGE_VERSION
 #include "gconfig.h"
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
 #endif
@@ -58,9 +62,7 @@
 #define	GMONNAME	"gmon.out"	/* default profile filename */
 #define	GMONSUM		"gmon.sum"	/* profile summary filename */
 
-#ifdef HAVE_LOCALE_H
-# include <locale.h>
-#endif
+#include <locale.h>
 
 #ifdef ENABLE_NLS
 /* Undefine BFD's `_' macro - it uses dgetext() and we want to use gettext().  */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-05  5:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05  5:50 C99 gprof configury Alan Modra
2021-04-05  5:52 ` C99 bfd configury Alan Modra
2021-04-05  5:52   ` C99 opcodes configury Alan Modra
2021-04-05  5:54     ` C99 binutils configury Alan Modra
2021-04-05  5:55       ` C99 gas configury Alan Modra
2021-04-05  5:55         ` C99 ld configury Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).