aboutsummaryrefslogtreecommitdiff
path: root/ld/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
commit34875e6487738a81c2b09979b804556bc8ea885b (patch)
tree35f8536360eb5884dbf3706d1a550ee0f933acdf /ld/configure.in
parent661f7c357e34dee7936489da7a385c29a1343d02 (diff)
downloadfsf-binutils-gdb-34875e6487738a81c2b09979b804556bc8ea885b.zip
fsf-binutils-gdb-34875e6487738a81c2b09979b804556bc8ea885b.tar.gz
fsf-binutils-gdb-34875e6487738a81c2b09979b804556bc8ea885b.tar.bz2
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 'ld/configure.in')
-rw-r--r--ld/configure.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/configure.in b/ld/configure.in
index 39d4d12..db8861c 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -138,6 +138,16 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
AC_CHECK_FUNCS(sbrk realpath glob)
AC_HEADER_DIRENT
+AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
+AC_CACHE_VAL(ld_cv_decl_getopt_unistd_h,
+[AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
+ld_cv_decl_getopt_unistd_h=yes, ld_cv_decl_getopt_unistd_h=no)])
+AC_MSG_RESULT($ld_cv_decl_getopt_unistd_h)
+if test $ld_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
+
BFD_BINARY_FOPEN
BFD_NEED_DECLARATION(strstr)