Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
7bedb1f4
Commit
7bedb1f4
authored
Sep 20, 2012
by
Marcin Siodelski
Browse files
[2272] Check for optreset declaration in unistd.h.
parent
8e8f94c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
7bedb1f4
...
...
@@ -1074,6 +1074,26 @@ if test "x$VALGRIND" != "xno"; then
found_valgrind="found"
fi
# Check for optreset in unistd.h. On BSD systems the optreset is
# used to reset the state of getopt() function. Resetting its state
# is required if command line arguments are parsed multiple times
# during a program. On Linux this variable will not exist because
# getopt() reset is performed by setting optind = 0. On Operating
# Systems where optreset is defined use optreset = 1 and optind = 1
# to reset internal state of getopt(). Failing to do so will result
# in unpredictable output from getopt().
AC_MSG_CHECKING([whether optreset variable is defined in unistd.h])
AC_TRY_LINK(
[#include <unistd.h>],
[extern int optreset; optreset=1],
[ AC_MSG_RESULT(yes)
var_optreset_exists=yes],
[ AC_MSG_RESULT(no)
var_optreset_exists=no]
)
AM_CONDITIONAL(HAVE_OPTRESET, test "x$var_optreset_exists" != "xno")
AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPT_RESET], [1], [Check for optreset?])])
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/guide/Makefile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment