aboutsummaryrefslogtreecommitdiff
path: root/lib/getopt1.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-09-12 20:55:10 +0300
committerLasse Collin <lasse.collin@tukaani.org>2023-09-22 20:06:27 +0300
commitaff1b479c7b168652bd20305ceed4317d5db6661 (patch)
tree2a755daa9212001d9d432212eb6683400d3d124d /lib/getopt1.c
parentDoxygen: Add more C macro names to PREDEFINED. (diff)
downloadxz-aff1b479c7b168652bd20305ceed4317d5db6661.tar.xz
lib/getopt*.c: Include <config.h> only HAVE_CONFIG_H is defined.
The CMake-based build doesn't use config.h. Up-to-date getopt_long in Gnulib is LGPLv2 so at some point it could be included in XZ Utils too but for now this commit is enough to make CMake-based build possible.
Diffstat (limited to '')
-rw-r--r--lib/getopt1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/getopt1.c b/lib/getopt1.c
index da5d5330..ebc46404 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -20,7 +20,9 @@
#ifdef _LIBC
# include <getopt.h>
#else
-# include <config.h>
+# ifdef HAVE_CONFIG_H
+# include <config.h>
+# endif
# include "getopt.h"
#endif
#include "getopt_int.h"