]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build failure through cmake on linux.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 10 May 2011 14:53:42 +0000 (10:53 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 10 May 2011 14:53:42 +0000 (10:53 -0400)
It needs some macro such as _GNU_SOURCE to use extension functions.

including previous changes of build/cmake/config.h.in.

SVN-Revision: 3293

CMakeLists.txt
build/cmake/config.h.in

index f8731b977e03b686ec8fd23a7ebc298cd60aa1af..96b0ccdb011c6c16313f27e7e18844537ed12ef1 100644 (file)
@@ -286,6 +286,20 @@ LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
 LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
 LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H)
 
+#
+# Check whether use of __EXTENSIONS__ is safe.
+# We need some macro such as _GNU_SOURCE to use extension functions.
+#
+SET(_INCLUDE_FILES)
+FOREACH (it ${_HEADER})
+   SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ENDFOREACH (it)
+
+CHECK_C_SOURCE_COMPILES(
+  "#define __EXTENSIONS__ 1
+   ${_INCLUDE_FILES}
+   int main() { return 0;}"
+ SAFE_TO_DEFINE_EXTENSIONS)
 
 #
 # Find OpenSSL
index f9055247d7fa262cffbb25251c0c164a612d8e6f..c1a1a6258c21523e28afbd35953fac024d7ff62c 100644 (file)
@@ -982,6 +982,9 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #cmakedefine TIME_WITH_SYS_TIME 1
 
+/*
+ * Some platform requires a macro to use extension functions.
+ */
 #cmakedefine SAFE_TO_DEFINE_EXTENSIONS 1
 #ifdef SAFE_TO_DEFINE_EXTENSIONS
 /* Enable extensions on AIX 3, Interix.  */