]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gprof/configure.in
Add a check for <unistd.h> providing a prototype for getopt() which is compatible
[thirdparty/binutils-gdb.git] / gprof / configure.in
index 01dd81fefaa801936c8931e2fd86d517bec2e1f9..e130b0d2ae0ffe08367092a435da2a7bffaad97a 100644 (file)
@@ -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,