lib/gc-pbkdf2-sha1.c: Remove comments from RFC 2898.
[gnulib.git] / m4 / getopt.m4
index 346afb6..8f0c36c 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -54,6 +54,15 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
   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.
@@ -82,7 +91,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
       [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>
@@ -158,7 +167,7 @@ main ()
 
   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";;