diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-26 14:37:31 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-26 22:39:46 +0000 |
commit | c2c9a09880a6c2aad7529f9e133f53cfe7aba7ec (patch) | |
tree | 8f7b37c08f0f635ae25a8de45d65de3af20ccd1c /configure.ac | |
parent | 2c6d2bb1e56055f53531468be83075c4f12cdcb2 (diff) |
Use getopt_long() for the first pass through the argument list.
That way:
1) we don't have to worry about the system getopt() and our
getopt_long(), on platforms that have getopt() but not
getopt_long() (Solaris prior to Solaris 10, HP-UX, AIX), not
working well together;
2) if necessary, we can handle long options in the first pass.
Switch to using getopt_long() for the *second* pass for the GTK+ version
of Wireshark.
Use the documented mechanism for resetting the argument parser for the
glibc version of getopt_long(); use the mostly-undocumented-but-at-least-
they-documented-optreset mechanism for the *BSD version.
(We should look into doing only one pass, saving away arguments that
can't fully be processed in the first pass for further processing after
initializing libwireshark.)
Change-Id: Ide5069f1c7c66a5d04acc712551eb201080ce02f
Reviewed-on: https://code.wireshark.org/review/6063
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5ebfa04c7f..4a71282f91 100644 --- a/configure.ac +++ b/configure.ac @@ -2669,6 +2669,25 @@ AC_CHECK_FUNC(getopt_long, [ GETOPT_LO="" AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.]) + + # + # Do we have optreset? + # + AC_MSG_CHECKING(whether optreset is defined) + AC_TRY_LINK([], + [ + extern int optreset; + + return optreset; + ], + ac_cv_pcap_debug_defined=yes, + ac_cv_pcap_debug_defined=no) + if test "$ac_cv_pcap_debug_defined" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable]) + else + AC_MSG_RESULT(no) + fi ], GETOPT_LO="wsgetopt.lo") AC_SUBST(GETOPT_LO) |