From 03c23a4952bce1b50a1d213ca2d1c15acd76a489 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 17 Feb 2025 18:11:58 +0200 Subject: [PATCH] Build: Allow forcing the use of the replacement getopt_long Now one can pass gl_replace_getopt=yes to configure to force the use of GNU getopt_long from the lib directory. This only checks that the value of gl_replace_getopt is non-empty, so one cannot force the replacement to be disabled. Closes: https://github.com/tukaani-project/xz/pull/166 --- m4/getopt.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/getopt.m4 b/m4/getopt.m4 index af8bfd4c..0ccc413c 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -8,6 +8,9 @@ dnl with or without modifications, as long as this notice is preserved. # This version has been modified to reduce complexity since we only need # GNU getopt_long and do not care about replacing getopt. +# +# Pass gl_replace_getopt=yes (or any non-empty value instead of "yes") as +# an argument to configure to force the use of the getopt_long replacement. # Check for a POSIX compliant getopt function with GNU extensions (such as # options with optional arguments) and the functions getopt_long, @@ -23,8 +26,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU], AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ - gl_replace_getopt= - if test -z "$gl_replace_getopt"; then AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes]) fi