On Fri, Sep 24, 2010 at 1:14 AM, Mateusz Loskot <[email protected]> wrote:

> On 17/09/10 19:21, Claudio Bantaloukas wrote:
> > Hi *,
> >
> > I tried to compile soci on aix today at work on AIX 5.3,
>
> Claudio,
>
> Which version of SOCI you're using?
>
> Hi Mateusz, I'm tracking the git repo. Sorry for not responding earlier but
I'm working on this as time permits.

I pulled from your repo today and vpn'd to an aix machine at work where I
tested some modifications

The result is these two patches that I'm attaching to the email.

Essentialy a new Threads dependency cmake, and I added ${Threads_LIBRARIES}
to all targets. The dependency file uses CMake's FindThreads default module
which handles many OS's.

It's a bit noisy but it does the job well, I've used it on windows, linux,
aix and hpux, it's saved the day at work more than once.

PS: I'm sure it can be done better but for now this builds successfully on
AIX. Now I only need to bribe our DBA to hand me over a test user for
this... :D

Regards
-- 
Claudio Bantaloukas http://www.rdfm.org/ammuzzu/
From 3cd2c96f9fcf9cb85d032b48d4ad2cee15a22b1a Mon Sep 17 00:00:00 2001
From: Claudio Bantaloukas <[email protected]>
Date: Tue, 28 Sep 2010 13:30:42 +0200
Subject: [PATCH 1/2] add thread support for aix

---
 src/cmake/SociBackend.cmake          |   11 +++++++++--
 src/cmake/SociDependencies.cmake     |    3 +++
 src/cmake/dependencies/Threads.cmake |    4 ++++
 3 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 src/cmake/dependencies/Threads.cmake

diff --git a/src/cmake/SociBackend.cmake b/src/cmake/SociBackend.cmake
index c76c218..4945adf 100644
--- a/src/cmake/SociBackend.cmake
+++ b/src/cmake/SociBackend.cmake
@@ -118,7 +118,12 @@ macro(soci_backend NAME)
 
     target_link_libraries(${THIS_BACKEND_TARGET}
       ${SOCI_CORE_TARGET}
-      ${THIS_BACKEND_DEPENDS_LIBRARIES})
+      ${THIS_BACKEND_DEPENDS_LIBRARIES}
+      ${Threads_LIBRARIES})
+    target_link_libraries(${THIS_BACKEND_TARGET}-static
+      ${SOCI_CORE_TARGET}
+      ${THIS_BACKEND_DEPENDS_LIBRARIES}
+      ${Threads_LIBRARIES})
 
     set_target_properties(${THIS_BACKEND_TARGET}-static
       PROPERTIES OUTPUT_NAME ${THIS_BACKEND_TARGET})
@@ -210,12 +215,14 @@ macro(soci_backend_test NAME)
   target_link_libraries(${THIS_TEST_TARGET}
     ${SOCI_CORE_TARGET}
     ${SOCI_${NAMEU}_TARGET}
+    ${Threads_LIBRARIES}
     ${${NAMEU}_LIBRARIES})
 
   target_link_libraries(${THIS_TEST_TARGET}_static
     ${SOCI_CORE_TARGET}-static
     ${SOCI_${NAMEU}_TARGET}-static
     ${${NAMEU}_LIBRARIES}
+    ${Threads_LIBRARIES}
     ${SOCI_CORE_STATIC_DEPENDENCIES})
 
   add_test(${THIS_TEST_TARGET}
@@ -234,4 +241,4 @@ macro(soci_backend_test NAME)
   message("THIS_TEST_TARGET_static: ${THIS_TEST_TARGET}_static")
   message("THIS_TEST_CONNSTR: ${${THIS_TEST_CONNSTR}}")
 
-endmacro()
\ No newline at end of file
+endmacro()
diff --git a/src/cmake/SociDependencies.cmake b/src/cmake/SociDependencies.cmake
index 3c1f529..1f21e9d 100644
--- a/src/cmake/SociDependencies.cmake
+++ b/src/cmake/SociDependencies.cmake
@@ -20,6 +20,7 @@
 # List of SOCI dependncies
 #
 set(SOCI_BACKENDS_ALL_DEPENDENCIES
+  Threads
   Boost
   MySQL
   Oracle
@@ -78,3 +79,5 @@ foreach(external ${SOCI_BACKENDS_ALL_DEPENDENCIES})
   endif()
 endforeach()
 message(STATUS "")
+
+set(SOCI_CORE_STATIC_DEPENDENCIES ${SOCI_CORE_STATIC_DEPENDENCIES} ${Thread_LIBRARIES})
diff --git a/src/cmake/dependencies/Threads.cmake b/src/cmake/dependencies/Threads.cmake
new file mode 100644
index 0000000..a60f6b8
--- /dev/null
+++ b/src/cmake/dependencies/Threads.cmake
@@ -0,0 +1,4 @@
+include(FindThreads)
+
+boost_external_report(Threads LIBRARIES)
+
-- 
1.7.0.4

From e3108e78b1b88915d11790d4318854515e30dba8 Mon Sep 17 00:00:00 2001
From: Claudio Bantaloukas <[email protected]>
Date: Tue, 28 Sep 2010 13:53:41 +0200
Subject: [PATCH 2/2] corrected thread library detection

---
 src/cmake/dependencies/Threads.cmake |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/cmake/dependencies/Threads.cmake b/src/cmake/dependencies/Threads.cmake
index a60f6b8..03708e7 100644
--- a/src/cmake/dependencies/Threads.cmake
+++ b/src/cmake/dependencies/Threads.cmake
@@ -1,4 +1,4 @@
 include(FindThreads)
-
+set(Threads_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
 boost_external_report(Threads LIBRARIES)
 
-- 
1.7.0.4

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to