mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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.
This commit is contained in:
@ -716,6 +716,16 @@ GAS_CHECK_DECL_NEEDED(errno, f, int f, [
|
||||
#endif
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
|
||||
AC_CACHE_VAL(gas_cv_decl_getopt_unistd_h,
|
||||
[AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
|
||||
gas_cv_decl_getopt_unistd_h=yes, gas_cv_decl_getopt_unistd_h=no)])
|
||||
AC_MSG_RESULT($gas_cv_decl_getopt_unistd_h)
|
||||
if test $gas_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
|
||||
|
||||
GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers)
|
||||
GAS_CHECK_DECL_NEEDED(ffs, f, int (*f)(int), $gas_test_headers)
|
||||
GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
|
||||
|
Reference in New Issue
Block a user