From a3124bf7a78cdcb491a604fee0d60266c1628e76 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Mon, 11 Jan 2016 16:34:11 +1100 Subject: openthreads: build standalone and fix static build --- src/openthreads-1-fixes.patch | 77 +++++++++++++++++++++++++------------------ src/openthreads.mk | 5 +-- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/openthreads-1-fixes.patch b/src/openthreads-1-fixes.patch index 9ae5208..2621288 100644 --- a/src/openthreads-1-fixes.patch +++ b/src/openthreads-1-fixes.patch @@ -6,54 +6,67 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Mon, 11 Jan 2016 15:33:57 +1100 -Subject: [PATCH] only build openthreads +Subject: [PATCH] build standalone openthreads diff --git a/CMakeLists.txt b/CMakeLists.txt index 1111111..2222222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1046,16 +1046,7 @@ ENDIF() +@@ -649,7 +649,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th + # + IF(ANDROID) + ANDROID_3RD_PARTY() +-ELSE() ++ELSEIF(NOT OPENTHREADS_STANDALONE) + # Common to all platforms except android: + FIND_PACKAGE(Freetype) + FIND_PACKAGE(Inventor) +@@ -787,7 +787,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) + # Image readers/writers depend on 3rd party libraries except for OS X which + # can use Quicktime. +-IF(NOT ANDROID) ++IF(NOT ANDROID AND NOT OPENTHREADS_STANDALONE) + IF(NOT APPLE) + FIND_PACKAGE(GIFLIB) + FIND_PACKAGE(JPEG) +@@ -1044,7 +1044,9 @@ ELSE () + SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC") + ENDIF() - # OSG Core --ADD_SUBDIRECTORY(src) -- --IF (BUILD_OSG_APPLICATIONS AND NOT ANDROID) -- ADD_SUBDIRECTORY(applications) --ENDIF() -- --IF (BUILD_OSG_EXAMPLES) -- ADD_SUBDIRECTORY(examples) --ENDIF() - ++IF(OPENTHREADS_STANDALONE) +ADD_SUBDIRECTORY(src/OpenThreads) ++ELSE() + # OSG Core + ADD_SUBDIRECTORY(src) + +@@ -1055,7 +1057,7 @@ ENDIF() + IF (BUILD_OSG_EXAMPLES) + ADD_SUBDIRECTORY(examples) + ENDIF() +- ++ENDIF() IF(APPLE AND NOT ANDROID) -@@ -1251,24 +1242,7 @@ ENDIF() +@@ -1250,7 +1252,9 @@ IF(CMAKE_CPACK_COMMAND) + ENDIF() # Generate pkg-config configuration files - --SET(PKGCONFIG_FILES -- openscenegraph -- openscenegraph-osg -- openscenegraph-osgDB -- openscenegraph-osgFX -- openscenegraph-osgGA -- openscenegraph-osgParticle -- openscenegraph-osgSim -- openscenegraph-osgText -- openscenegraph-osgUtil -- openscenegraph-osgTerrain -- openscenegraph-osgManipulator -- openscenegraph-osgViewer -- openscenegraph-osgWidget -- openscenegraph-osgShadow -- openscenegraph-osgAnimation -- openscenegraph-osgVolume --) +- ++IF(OPENTHREADS_STANDALONE) +SET(PKGCONFIG_FILES) ++ELSE() + SET(PKGCONFIG_FILES + openscenegraph + openscenegraph-osg +@@ -1269,6 +1273,7 @@ SET(PKGCONFIG_FILES + openscenegraph-osgAnimation + openscenegraph-osgVolume + ) ++ENDIF() IF(QT4_FOUND OR Qt5Widgets_FOUND ) SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt) diff --git a/src/openthreads.mk b/src/openthreads.mk index 167cec6..94ed993 100644 --- a/src/openthreads.mk +++ b/src/openthreads.mk @@ -17,9 +17,10 @@ endef define $(PKG)_BUILD mkdir '$(1).build' cd '$(1).build' && '$(TARGET)-cmake' \ - -DBUILD_SHARED_LIBS=$(CMAKE_SHARED_BOOL) \ + -DDYNAMIC_OPENTHREADS=$(CMAKE_SHARED_BOOL) \ -DCMAKE_VERBOSE_MAKEFILE=TRUE \ - -DPKG_CONFIG_EXECUTABLE='$(PREFIX)/bin/$(TARGET)-pkg-config' \ + -DOPENTHREADS_STANDALONE=TRUE \ + -DOSG_USE_QT=FALSE \ -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE=1 \ -D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED=1 \ '$(1)' -- cgit v0.12