summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-08-17 14:35:41 (GMT)
committerUwe Hermann <uwe@hermann-uwe.de>2014-08-17 21:37:14 (GMT)
commit22306acb01428db92c5efee5f9eb180cca40293f (patch)
treed4b334fc752f7bbd1e4981645507265e63dad68c /src
parente578464aaf4ef53b656d33610d732eee8b710808 (diff)
downloadmxe-22306acb01428db92c5efee5f9eb180cca40293f.zip
mxe-22306acb01428db92c5efee5f9eb180cca40293f.tar.gz
mxe-22306acb01428db92c5efee5f9eb180cca40293f.tar.bz2
libftdi1: enable shared build
Diffstat (limited to 'src')
-rw-r--r--src/libftdi1-2-shared-build.patch33
-rw-r--r--src/libftdi1.mk4
2 files changed, 35 insertions, 2 deletions
diff --git a/src/libftdi1-2-shared-build.patch b/src/libftdi1-2-shared-build.patch
new file mode 100644
index 0000000..8a292e6
--- /dev/null
+++ b/src/libftdi1-2-shared-build.patch
@@ -0,0 +1,33 @@
+This file is part of MXE.
+See index.html for further information.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e8688d4..66c1ba2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -46,6 +46,7 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
+ set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
+ set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+
++option ( SHAREDLIBS "Build shared libraries" ON )
+ option ( STATICLIBS "Build static libraries" ON )
+
+ # guess LIB_SUFFIX, don't take debian multiarch into account
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 9fd86a6..5d0e52a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -32,11 +32,13 @@ set_target_properties ( ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1 )
+ # Dependencies
+ target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES})
+
++if ( SHAREDLIBS )
+ install ( TARGETS ftdi1
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
++endif ()
+
+ if ( STATICLIBS )
+ add_library(ftdi1-static STATIC ${c_sources})
diff --git a/src/libftdi1.mk b/src/libftdi1.mk
index f53d184..e29c3b9 100644
--- a/src/libftdi1.mk
+++ b/src/libftdi1.mk
@@ -20,6 +20,8 @@ define $(PKG)_BUILD
cd '$(1)' && cmake . \
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
-DCMAKE_BUILD_TYPE=Release \
+ -DSHAREDLIBS=$(if $(BUILD_SHARED),yes,no) \
+ -DSTATICLIBS=$(if $(BUILD_SHARED),no,yes) \
-DLIBUSB_INCLUDE_DIR=$(PREFIX)/$(TARGET)/include/libusb-1.0 \
-DDOCUMENTATION=no \
-DEXAMPLES=no \
@@ -33,5 +35,3 @@ define $(PKG)_BUILD
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libftdi1.exe' \
`'$(TARGET)-pkg-config' libftdi1 --cflags --libs`
endef
-
-$(PKG)_BUILD_SHARED =