diff --git a/.cmake/ConfigureStaticLinking.cmake b/.cmake/ConfigureStaticLinking.cmake index e7cf4d3e5..0e79233a9 100644 --- a/.cmake/ConfigureStaticLinking.cmake +++ b/.cmake/ConfigureStaticLinking.cmake @@ -5,7 +5,7 @@ if (${LINK_STATICALLY} MATCHES "true") set(BOOST_INCLUDEDIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost-bin/include") set(BOOST_LIBRARYDIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost-bin/lib") set(Boost_NO_SYSTEM_PATHS ON) - set(Boost_USE_STATIC_LIBS ON) + #set(Boost_USE_STATIC_LIBS ON) set(Boost_NO_BOOST_CMAKE ON) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/ffmpeg-bin/include") @@ -19,6 +19,9 @@ if (${LINK_STATICALLY} MATCHES "true") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/include") link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/lib") + + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/include") + link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/lib") else() message(STATUS "[static linking] static linking NOT enabled!") endif() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a25142921..445a92642 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ include_directories( # our library directories link_directories("${musikcube_SOURCE_DIR}/bin/plugins") -find_package(Boost 1.55.0 REQUIRED system filesystem thread) +find_package(Boost 1.55.0 REQUIRED filesystem thread) include_directories(${Boost_INCLUDE_DIRS}) message(STATUS "[boost] libs: " ${Boost_LIBRARIES}) message(STATUS "[boost] includes: " ${Boost_INCLUDE_DIRS}) @@ -45,11 +45,13 @@ ensure_library_exists(pthread) ensure_library_exists(ssl) ensure_library_exists(crypto) ensure_library_exists(z) -find_library(LIBCURL NAMES curl) -find_library(LIBPTHREAD NAMES pthread) -find_library(LIBSSL NAMES ssl) -find_library(LIBCRYPTO NAMES crypto) -set(COMMON_LINK_LIBS ${Boost_LIBRARIES} ${LIBCURL} ${LIBPTHREAD} ${LIBSSL} ${LIBCRYPTO}) +find_library(LIBCURL NAMES libcurl.a) +find_library(LIBPTHREAD NAMES libpthread.a) +find_library(LIBSSL NAMES libssl.a) +find_library(LIBCRYPTO NAMES libcrypto.a) +find_library(LIBZ NAMES libz.a) + +set(COMMON_LINK_LIBS ${Boost_LIBRARIES} ${LIBCURL} ${LIBPTHREAD} ${LIBSSL} ${LIBCRYPTO} ${LIBZ}) if (CMAKE_SYSTEM_NAME MATCHES "Linux") find_library(LIBDL NAMES dl) @@ -66,7 +68,7 @@ endif() message(STATUS "[build] musikcube_LINK_LIBS: ${musikcube_LINK_LIBS}") add_subdirectory(src/musikcore) -add_subdirectory(src/core_c_demo) +#add_subdirectory(src/core_c_demo) add_subdirectory(src/musikcube) add_subdirectory(src/musikcubed) add_subdirectory(src/plugins/taglib_plugin) diff --git a/script/bootstrap-static-vendors.sh b/script/bootstrap-static-vendors.sh index 41823d706..9db4d3f3d 100755 --- a/script/bootstrap-static-vendors.sh +++ b/script/bootstrap-static-vendors.sh @@ -233,3 +233,14 @@ make install mv output ../zlib-bin cd .. +# +# stage +# + +mkdir -p bin/plugins/ +cp vendor/boost-bin/lib/libboost_filesystem.so.1.78.0 ./bin/ +cp vendor/boost-bin/lib/libboost_thread.so.1.78.0 ./bin/ +cp vendor/ffmpeg-bin/lib/libavcodec-musikcube.so.59 ./bin/plugins/ +cp vendor/ffmpeg-bin/lib/libavformat-musikcube.so.59 ./bin/plugins +cp vendor/ffmpeg-bin/lib/libavutil-musikcube.so.57 ./bin/plugins +cp vendor/ffmpeg-bin/lib/libswresample-musikcube.so.4 ./bin/plugins diff --git a/src/musikcore/CMakeLists.txt b/src/musikcore/CMakeLists.txt index 757979b29..7c7e3667f 100644 --- a/src/musikcore/CMakeLists.txt +++ b/src/musikcore/CMakeLists.txt @@ -87,6 +87,7 @@ set_target_properties(musikcore PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${musikcube_SOURCE_DIR}/bin) target_link_libraries(musikcore) +target_link_libraries(musikcore ${Boost_LIBRARIES} ${musikcube_LINK_LIBS}) if (ENABLE_PCH MATCHES "true") message(STATUS "[musikcore] enabling precompiled headers") diff --git a/src/plugins/ffmpegdecoder/CMakeLists.txt b/src/plugins/ffmpegdecoder/CMakeLists.txt index 9a595e314..f660b8489 100644 --- a/src/plugins/ffmpegdecoder/CMakeLists.txt +++ b/src/plugins/ffmpegdecoder/CMakeLists.txt @@ -6,13 +6,11 @@ set (ffmpegdecoder_SOURCES add_library(ffmpegdecoder SHARED ${ffmpegdecoder_SOURCES}) if (${LINK_STATICALLY} MATCHES "true") - find_library(LIBAVCODEC NAMES libavcodec-musikcube.a PATHS "/home/clangen/src/musikcube/vendor/ffmpeg-bin/lib/") - find_library(LIBAVUTIL NAMES libavutil-musikcube.a PATHS "/home/clangen/src/musikcube/vendor/ffmpeg-bin/lib/") - find_library(LIBAVFORMAT NAMES libavformat-musikcube.a PATHS "/home/clangen/src/musikcube/vendor/ffmpeg-bin/lib/") - find_library(LIBSWRESAMPLE NAMES libswresample-musikcube.a PATHS "/home/clangen/src/musikcube/vendor/ffmpeg-bin/lib/") - target_link_libraries(ffmpegdecoder ${LIBAVCODEC} ${LIBAVUTIL} ${LIBAVFORMAT} ${LIBSWRESAMPLE}) - #target_link_libraries(ffmpegdecoder -Wl,-Bdynamic libavcodec-musikcube.a libavutil-musikcube.a libavformat-musikcube.a libswresample-musikcube.a) - + ensure_library_exists(avcodec-musikcube) + ensure_library_exists(avutil-musikcube) + ensure_library_exists(avformat-musikcube) + ensure_library_exists(swresample-musikcube) + target_link_libraries(ffmpegdecoder avcodec-musikcube avutil-musikcube avformat-musikcube swresample-musikcube) else() # fedora (and probably other RPM-based distros) put ffmpeg includes here... include_directories("/usr/include/ffmpeg") @@ -24,6 +22,4 @@ else() target_link_libraries(ffmpegdecoder avcodec avutil avformat swresample) endif() -message(STATUS "clclcl ${LIBAVCODEC} ${LIBAVUTIL} ${LIBAVFORMAT} ${LIBSWRESAMPLE}") - #target_link_libraries(ffmpegdecoder ${musikcube_LINK_LIBS}) diff --git a/src/plugins/server/CMakeLists.txt b/src/plugins/server/CMakeLists.txt index b9acaac29..ef211b5b0 100644 --- a/src/plugins/server/CMakeLists.txt +++ b/src/plugins/server/CMakeLists.txt @@ -17,13 +17,13 @@ include_directories(${Boost_INCLUDE_DIRS}) ensure_library_exists(microhttpd) -if (${LINK_STATICALLY} MATCHES "true") - find_library(MICROHTTPDLIB NAMES libmicrohttpd.a) - target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB}) -else() +# if (${LINK_STATICALLY} MATCHES "true") +# find_library(MICROHTTPDLIB NAMES libmicrohttpd.a) +# target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB}) +# else() set(EXTRA_LIBS "") if (CMAKE_SYSTEM_NAME MATCHES "Darwin") set(EXTRA_LIBS "gnutls") endif() target_link_libraries(server ${server_LINK_LIBS} microhttpd z ${EXTRA_LIBS}) -endif() +# endif() diff --git a/src/plugins/stockencoders/CMakeLists.txt b/src/plugins/stockencoders/CMakeLists.txt index 88de7086d..f32567d8f 100644 --- a/src/plugins/stockencoders/CMakeLists.txt +++ b/src/plugins/stockencoders/CMakeLists.txt @@ -9,20 +9,20 @@ add_library(stockencoders SHARED ${stockencoders_SOURCES}) ensure_library_exists(mp3lame) if (${LINK_STATICALLY} MATCHES "true") - ensure_library_exists(avcodec-musikcube) - ensure_library_exists(avutil-musikcube) - ensure_library_exists(avformat-musikcube) - ensure_library_exists(swresample-musikcube) - target_link_libraries(stockencoders ${musikcube_LINK_LIBS} libavcodec-musikcube.a libavutil-musikcube.a libavformat-musikcube.a libswresample-musikcube.a) + ensure_library_exists(avcodec-musikcube) + ensure_library_exists(avutil-musikcube) + ensure_library_exists(avformat-musikcube) + ensure_library_exists(swresample-musikcube) + target_link_libraries(stockencoders avcodec-musikcube avutil-musikcube avformat-musikcube swresample-musikcube) else() - # fedora (and probably other RPM-based distros) put ffmpeg includes here... - include_directories("/usr/include/ffmpeg") - include_directories("/usr/local/include/ffmpeg") - ensure_library_exists(avcodec) - ensure_library_exists(avutil) - ensure_library_exists(avformat) - ensure_library_exists(swresample) - target_link_libraries(stockencoders ${musikcube_LINK_LIBS} avcodec avutil avformat swresample) + # fedora (and probably other RPM-based distros) put ffmpeg includes here... + include_directories("/usr/include/ffmpeg") + include_directories("/usr/local/include/ffmpeg") + ensure_library_exists(avcodec) + ensure_library_exists(avutil) + ensure_library_exists(avformat) + ensure_library_exists(swresample) + target_link_libraries(stockencoders ${musikcube_LINK_LIBS} avcodec avutil avformat swresample) endif() # prefer static libraries on mac to make redist easier