summaryrefslogtreecommitdiffstats
path: root/gprof
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-06-27 15:37:48 +0000
committerIan Lance Taylor <ian@airs.com>1996-06-27 15:37:48 +0000
commite3c0e00bb155377b845c4b1470eba36a206fe908 (patch)
treee9cca164c0e263fc62eb9dcc9b56aaf647fc7f3c /gprof
parent5304aea938084c9c4296b612257d3b8490857f7f (diff)
downloadppe42-binutils-e3c0e00bb155377b845c4b1470eba36a206fe908.tar.gz
ppe42-binutils-e3c0e00bb155377b845c4b1470eba36a206fe908.zip
* configure.in: Call AC_ISC_POSIX.
* configure: Rebuild. * Makefile.in (gprof): Pass $(CFLAGS) during link. * hertz.c: Don't include <sys/time.h>; let sysdep.h handle that. If HAVE_SETITIMER is not defined, try using sysconf.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog8
-rw-r--r--gprof/Makefile.in2
-rwxr-xr-xgprof/configure21
-rw-r--r--gprof/configure.in2
-rw-r--r--gprof/hertz.c13
5 files changed, 42 insertions, 4 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index c7100d7e66..4466dfcd95 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jun 27 11:36:22 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Call AC_ISC_POSIX.
+ * configure: Rebuild.
+ * Makefile.in (gprof): Pass $(CFLAGS) during link.
+ * hertz.c: Don't include <sys/time.h>; let sysdep.h handle that.
+ If HAVE_SETITIMER is not defined, try using sysconf.
+
Mon Jun 24 18:27:28 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
* Makefile.in (exec_prefix, bindir, libdir, mandir, infodir, datadir,
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
index 1aa7eed25b..c4507a369d 100644
--- a/gprof/Makefile.in
+++ b/gprof/Makefile.in
@@ -103,7 +103,7 @@ install: all
$(INSTALL_XFORM1) $(srcdir)/gprof.1 $(man1dir)/gprof.1
gprof: $(OBJS) $(LIBDEPS)
- $(CC) -o $(PROG) $(HLDFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
+ $(CC) -o $(PROG) $(CFLAGS) $(HLDFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
mostlyclean:
-rm -f *.o core gprof nohup.out \
diff --git a/gprof/configure b/gprof/configure
index 3cbf609d61..e1aed82a46 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -728,6 +728,27 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ echo "$ac_t""yes" 1>&6
+ ISC=yes # If later tests want to check for ISC.
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+else
+ echo "$ac_t""no" 1>&6
+ ISC=
+fi
+
+
# Do some error checking and defaulting for the host and target type.
# The inputs are:
diff --git a/gprof/configure.in b/gprof/configure.in
index 0d01bc6ae3..21409d5beb 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -14,6 +14,8 @@ esac])dnl
AC_PROG_CC
AC_PROG_INSTALL
+AC_ISC_POSIX
+
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
diff --git a/gprof/hertz.c b/gprof/hertz.c
index 9dbc89ffc6..75314acc0c 100644
--- a/gprof/hertz.c
+++ b/gprof/hertz.c
@@ -16,7 +16,6 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include <sys/time.h>
#include "hertz.h"
@@ -29,7 +28,8 @@ hertz ()
{
#ifdef HERTZ
return HERTZ;
-#else
+#else /* ! defined (HERTZ) */
+#ifdef HAVE_SETITIMER
struct itimerval tim;
tim.it_interval.tv_sec = 0;
@@ -43,5 +43,12 @@ hertz ()
return HZ_WRONG;
}
return 1000000 / tim.it_interval.tv_usec;
-#endif
+#else /* ! defined (HAVE_SETITIMER) */
+#if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK)
+ return sysconf (_SC_CLK_TCK);
+#else /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
+ return HZ_WRONG;
+#endif /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
+#endif /* ! defined (HAVE_SETITIMER) */
+#endif /* ! defined (HERTZ) */
}
OpenPOWER on IntegriCloud