summaryrefslogtreecommitdiff
path: root/gprof/configure.in
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-04-04 11:27:16 +0000
committerNick Clifton <nickc@redhat.com>2005-04-04 11:27:16 +0000
commit4d5e394c684a2a2c13f72f024526b1b4680e9c68 (patch)
tree6cf2e4e63ddc19ec11bc41f2fccf26c2d144931e /gprof/configure.in
parent1601489a1f7eacf479291bdb01235c229c71c217 (diff)
downloadbinutils-redhat-4d5e394c684a2a2c13f72f024526b1b4680e9c68.tar.gz
Add a check for <unistd.h> providing a prototype for getopt() which is compatible
with the one in include/getopt.h. If so then define HAVE_DECL_GETOPT.
Diffstat (limited to 'gprof/configure.in')
-rw-r--r--gprof/configure.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/gprof/configure.in b/gprof/configure.in
index 01dd81fefa..e130b0d2ae 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -32,6 +32,16 @@ AC_EXEEXT
AC_CHECK_HEADERS(sys/gmon_out.h)
+AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
+AC_CACHE_VAL(gprof_cv_decl_getopt_unistd_h,
+[AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
+gprof_cv_decl_getopt_unistd_h=yes, gprof_cv_decl_getopt_unistd_h=no)])
+AC_MSG_RESULT($gprof_cv_decl_getopt_unistd_h)
+if test $gprof_cv_decl_getopt_unistd_h = yes; then
+ AC_DEFINE([HAVE_DECL_GETOPT], 1,
+ [Is the prototype for getopt in <unistd.h> in the expected format?])
+fi
+
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_ARG_ENABLE(werror,