fixed some cmake TRY_COMPILE() issues

This commit is contained in:
ensc 2006-09-18 17:52:40 +00:00
parent 5f45fb7858
commit 7a4389e475
3 changed files with 90 additions and 1 deletions

View File

@ -0,0 +1,20 @@
From 3fc30a0e77c32250ed24693236e225e651ada5c4 Mon Sep 17 00:00:00 2001
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Date: Mon, 18 Sep 2006 19:47:54 +0200
Subject: [PATCH] added main() to give TRY_COMPILE() a chance to succeed...
---
cmake/try-attr.cc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/cmake/try-attr.cc b/cmake/try-attr.cc
index a715bc5..4668c5b 100644
--- a/cmake/try-attr.cc
+++ b/cmake/try-attr.cc
@@ -1 +1,3 @@
int x __attribute__((CMAKE_TEST_ATTR));
+
+int main() {}
--
1.4.2

View File

@ -0,0 +1,66 @@
From bd638f1155b9dd75d6378d894b162f1507c0c37a Mon Sep 17 00:00:00 2001
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Date: Mon, 18 Sep 2006 19:51:07 +0200
Subject: [PATCH] added VA_LIST_IS_ARRAY check
---
CMakeLists.txt | 13 +++++++++++++
cmake/va-list-is-array.c | 9 +++++++++
xmlrpc_config.h.cmake | 3 +++
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6b76b0..93839a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,19 @@ try_compile(HAVE_ATTR_UNUSED
${xmlrpc-c_SOURCE_DIR}/cmake/try-attr.cc
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DCMAKE_TEST_ATTR=__unused__)
+try_compile(VA_LIST_IS_NOT_ARRAY
+ ${CMAKE_BINARY_DIR}/
+ ${xmlrpc-c_SOURCE_DIR}/cmake/va-list-is-array.c)
+
+if(VA_LIST_IS_NOT_ARRAY)
+ set(VA_LIST_IS_ARRAY 0)
+ message(STATUS "va_list is not an array")
+else(VA_LIST_IS_NOT_ARRAY)
+ set(VA_LIST_IS_ARRAY 1)
+ message(STATUS "va_list is an array")
+endif(VA_LIST_IS_NOT_ARRAY)
+
+
if(HAVE_ATTR_UNUSED)
set(ATTR_UNUSED "__attribute__((__unused__))")
endif(HAVE_ATTR_UNUSED)
diff --git a/cmake/va-list-is-array.c b/cmake/va-list-is-array.c
new file mode 100644
index 0000000..1b9e397
--- /dev/null
+++ b/cmake/va-list-is-array.c
@@ -0,0 +1,9 @@
+#include <stdarg.h>
+
+void foo()
+{
+ va_list list1, list2;
+ //list1 = list2;
+}
+
+int main() {}
diff --git a/xmlrpc_config.h.cmake b/xmlrpc_config.h.cmake
index 478c252..8f364dd 100644
--- a/xmlrpc_config.h.cmake
+++ b/xmlrpc_config.h.cmake
@@ -1,5 +1,8 @@
+/* -*- c -*- */
+
#ifndef H_XMLRPC_C_CONFIG_H
+#cmakedefine VA_LIST_IS_ARRAY
#cmakedefine HAVE_WCHAR_H
#cmakedefine HAVE_SETENV
#define HAVE_SYS_IOCTL_H 0@HAVE_SYS_IOCTL_H@
--
1.4.2

View File

@ -20,6 +20,8 @@ Patch104: http://ensc.de/xmlrpc-c/0007-implemented-testsuite.txt
Patch105: http://ensc.de/xmlrpc-c/0008-use-a-macro-to-set-the-linker-flags-for-executables.txt
Patch106: http://ensc.de/xmlrpc-c/0009-Install-xmlrpc-c-config-and-man-pages-added-mandir-variable.txt
Patch107: http://ensc.de/xmlrpc-c/0010-install-libxmlrpc_util.so-and-set-version-information.txt
Patch108: http://ensc.de/xmlrpc-c/0011-added-main-to-give-TRY_COMPILE-a-chance-to-succeed.txt
Patch109: http://ensc.de/xmlrpc-c/0012-added-VA_LIST_IS_ARRAY-check.txt
BuildRoot: %_tmppath/%name-%version-%release-root
#BuildRequires: w3c-libwww-devel
BuildRequires: cmake
@ -65,7 +67,8 @@ This package contains some handy XML-RPC demo applications.
%patch6 -p1 -b .sizet
cat %PATCH100 %PATCH101 %PATCH102 %PATCH103 \
%PATCH104 %PATCH105 %PATCH106 %PATCH107 | patch -p1
%PATCH104 %PATCH105 %PATCH106 %PATCH107 \
%PATCH108 %PATCH109 | patch -p1
sed -i -e '/\(chan\|init\.c\)/d' lib/abyss/src/CMakeLists.txt
sed -i -e 's!xmlrpc_decompose.c!xmlrpc_builddecomp.c!g;