diff options
author | axel <axel@liljencrantz.se> | 2006-08-28 20:29:49 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-08-28 20:29:49 +1000 |
commit | 7310596dabe7eb81c9e55c64524537a03dcfad6f (patch) | |
tree | 18a8cad7f69d28fd0b800da19c892d51d424adf3 /configure.ac | |
parent | 4afe49d7c63f0608adfdda4a2dd562f6d0a9a4bd (diff) |
Much more reliable getopt_long test. Idea from Netocrat.
darcs-hash:20060828102949-ac50b-bb55face2f3127018b6c79a72ee71e38f075232a.gz
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index b4dbbcb9..1e4417a4 100644 --- a/configure.ac +++ b/configure.ac @@ -454,7 +454,7 @@ fi # Check for presense of various functions AC_CHECK_FUNCS( gettext wcsdup wcsndup wcslen wcscasecmp wcsncasecmp fwprintf ) -AC_CHECK_FUNCS( futimes wcwidth wcswidth getopt_long wcstok fputwc fgetwc ) +AC_CHECK_FUNCS( futimes wcwidth wcswidth wcstok fputwc fgetwc ) AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r killpg) # The Makefile also needs to know if we have gettext, so it knows if the translations should be installed. @@ -586,6 +586,42 @@ else AC_MSG_RESULT(no) fi +# Check if getopt_long actually works +AC_MSG_CHECKING([if getopt_long works]) +AC_TRY_LINK( + [ + #if HAVE_GETOPT_H + #include <getopt.h> + #endif + ], + [ + static struct option + long_options[] = + { + 0, 0, 0, 0 + } + ; + int opt = getopt_long( 0, + 0, + 0, + long_options, + 0 ); + + ], + have_working_getopt_long=yes, + have_working_getopt_long=no +) +if test "$have_working_getopt_long" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE( + [HAVE_WORKING_GETOPT_LONG], + [1], + [Define to 1 if getopt_long actually works.] + ) +else + AC_MSG_RESULT(no) +fi + # Check if del_curterm is broken - in that case we redefine # del_curterm as a no-op, to avoid a double-free |