X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fgetopt.m4;fp=m4%2Fgetopt.m4;h=0496250de0f75fcbac5eecf01a9478a7b9846790;hb=a8a88eddaa90432e6ec1b8d9d5c9842bc91afd1d;hp=ce6ec67b914657235319e7ab1c95b479ac027e7a;hpb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;p=debian%2Fgzip diff --git a/m4/getopt.m4 b/m4/getopt.m4 index ce6ec67..0496250 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,5 +1,5 @@ -# getopt.m4 serial 44 -dnl Copyright (C) 2002-2006, 2008-2016 Free Software Foundation, Inc. +# getopt.m4 serial 46 +dnl Copyright (C) 2002-2006, 2008-2018 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 with or without modifications, as long as this notice is preserved. @@ -32,9 +32,16 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX], # getopt_long_only. AC_DEFUN([gl_FUNC_GETOPT_GNU], [ + dnl Set the variable gl_getopt_required, so that all invocations of + dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file + dnl will check for getopt with GNU extensions. + dnl This means that if one gnulib-tool invocation requests getopt-posix + dnl and another gnulib-tool invocation requests getopt-gnu, it is as if + dnl both had requested getopt-gnu. m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) - AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) + dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically + dnl done through the module dependency getopt-gnu -> getopt-posix. ]) # Determine whether to replace the entire getopt facility. @@ -354,15 +361,19 @@ dnl is ambiguous with environment values that contain newlines. AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ - GETOPT_H=getopt.h + AC_CHECK_HEADERS_ONCE([sys/cdefs.h]) + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi + AC_SUBST([HAVE_SYS_CDEFS_H]) + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h AC_SUBST([GETOPT_H]) -]) - -# Prerequisites of lib/getopt*. -AC_DEFUN([gl_PREREQ_GETOPT], -[ - AC_CHECK_DECLS_ONCE([getenv]) + AC_SUBST([GETOPT_CDEFS_H]) ])