]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Allow forcing the use of the replacement getopt_long
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 17 Feb 2025 16:11:58 +0000 (18:11 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 17 Feb 2025 16:11:58 +0000 (18:11 +0200)
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

index af8bfd4cb1b8bdc789d56091ac0807035fe2104e..0ccc413cf47ea8618a00213fdee764b15e7400b9 100644 (file)
@@ -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