-# getopt.m4 serial 21
+# getopt.m4 serial 23
dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ gl_CHECK_NEXT_HEADERS([getopt.h])
+ AC_CHECK_HEADERS_ONCE([getopt.h])
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+ AC_SUBST([HAVE_GETOPT_H])
+
gl_replace_getopt=
dnl Test whether <getopt.h> is available.
[gl_cv_func_getopt_posix],
[
dnl This test fails on mingw and succeeds on all other platforms.
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
return 0;
}
-],
+]])],
[gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
[case "$host_os" in
mingw*) gl_cv_func_getopt_posix="guessing no";;