]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
lib/getopt*.c: Include <config.h> only HAVE_CONFIG_H is defined.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 12 Sep 2023 17:55:10 +0000 (20:55 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 22 Sep 2023 17:06:27 +0000 (20:06 +0300)
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.

lib/getopt.c
lib/getopt1.c

index f8fc003d391fb1df46b0ea37aea679511882db51..36c28318067e801626ebfeccafad4254c487b2ee 100644 (file)
@@ -21,7 +21,9 @@
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 \f
 #ifndef _LIBC
-# include <config.h>
+# ifdef HAVE_CONFIG_H
+#  include <config.h>
+# endif
 #endif
 
 #include "getopt.h"
index da5d53300b1c238c6849b539f99ad34e3ab7d7bb..ebc46404ac5f2431232d7f1ed680eca6c43777bc 100644 (file)
@@ -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"