From 678c10237f39d6dde19b2513718b0a18984f4597 Mon Sep 17 00:00:00 2001 From: hobbes1069 Date: Thu, 5 Mar 2015 22:05:54 +0000 Subject: [PATCH] Fix linking order of libsndfile to be after sox to make static build of sox happy. Tweak Bootstrapping of wxWidgets, still needs work though. git-svn-id: https://svn.code.sf.net/p/freetel/code@2055 01035d8c-6547-0410-b346-abe4f91aad63 --- fdmdv2/CMakeLists.txt | 48 +++++++++++++++---------------- fdmdv2/cmake/BuildSox.cmake | 12 +------- fdmdv2/cmake/BuildWxWidgets.cmake | 11 +++++-- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/fdmdv2/CMakeLists.txt b/fdmdv2/CMakeLists.txt index 20fe1d68..e9951141 100644 --- a/fdmdv2/CMakeLists.txt +++ b/fdmdv2/CMakeLists.txt @@ -284,30 +284,6 @@ else(NOT USE_STATIC_SAMPLERATE) include(cmake/BuildSamplerate.cmake) endif(NOT USE_STATIC_SAMPLERATE) -# -# sndfile Library -# -if(NOT USE_STATIC_SNDFILE) - message(STATUS "Looking for sndfile...") - find_library(LIBSNDFILE sndfile) - find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h) - message(STATUS " sndfile library: ${LIBSNDFILE}") - message(STATUS " sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}") - if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) - list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE}) - else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) - message(FATAL_ERROR "sndfile library not found. -On Linux systems try installing: - libsndfile-devel (RPM based systems) - libsndfile-dev (DEB based systems) -On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE" - ) - endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) -else(NOT USE_STATIC_SNDFILE) - message(STATUS "Will attempt static build of sndfile.") - include(cmake/BuildSndfile.cmake) -endif(NOT USE_STATIC_SNDFILE) - # # Find sox library # @@ -333,6 +309,30 @@ else(NOT USE_STATIC_SOX) include(cmake/BuildSox.cmake) endif(NOT USE_STATIC_SOX) +# +# sndfile Library +# +if(NOT USE_STATIC_SNDFILE) + message(STATUS "Looking for sndfile...") + find_library(LIBSNDFILE sndfile) + find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h) + message(STATUS " sndfile library: ${LIBSNDFILE}") + message(STATUS " sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}") + if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) + list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE}) + else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) + message(FATAL_ERROR "sndfile library not found. +On Linux systems try installing: + libsndfile-devel (RPM based systems) + libsndfile-dev (DEB based systems) +On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE" + ) + endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR) +else(NOT USE_STATIC_SNDFILE) + message(STATUS "Will attempt static build of sndfile.") + include(cmake/BuildSndfile.cmake) +endif(NOT USE_STATIC_SNDFILE) + # # Find wxWidgets # diff --git a/fdmdv2/cmake/BuildSox.cmake b/fdmdv2/cmake/BuildSox.cmake index 9d513e16..635fc93d 100644 --- a/fdmdv2/cmake/BuildSox.cmake +++ b/fdmdv2/cmake/BuildSox.cmake @@ -20,23 +20,13 @@ On Linux systems try installing: ) endif(UNIX AND NOT AO_LIBRARIES) -# For some reason libsox is not linked against linsndfile. We workaround it -# here but need to know if we're using the system provided library or not. -#if(USE_STATIC_SNDFILE) -# # Use known location of internal build. -# set(SNDFILE_LIB ${SNDFILE_LIBRARIES}) -#else() -# # Use found system library. -# set(SNDFILE_LIB ${LIBSNDFILE}) -#endif() - include(ExternalProject) ExternalProject_Add(sox URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz BUILD_IN_SOURCE 1 INSTALL_DIR external/dist CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist - BUILD_COMMAND $(MAKE) V=1 LIBS=${SNDFILE_LIB} + BUILD_COMMAND $(MAKE) V=1 INSTALL_COMMAND $(MAKE) install ) set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a) diff --git a/fdmdv2/cmake/BuildWxWidgets.cmake b/fdmdv2/cmake/BuildWxWidgets.cmake index cf0f17b3..68114038 100644 --- a/fdmdv2/cmake/BuildWxWidgets.cmake +++ b/fdmdv2/cmake/BuildWxWidgets.cmake @@ -1,6 +1,6 @@ set(WXWIDGETS_TARBALL "wxWidgets-3.0.2") -# If we're crosscompiling then we need to set the target hose correctly. +# If we're cross-compiling then we need to set the target host manually. if(MINGW AND CMAKE_CROSSCOMPILING) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) set(HOST x86_64-w64-mingw32) @@ -9,10 +9,15 @@ if(MINGW AND CMAKE_CROSSCOMPILING) endif() endif() +# If not cross-compiling then use the built-in makefile, otherwise use standard configure. if(MINGW AND NOT CMAKE_CROSSCOMPILING) - set(CONFIGURE_COMMAND mingw32-make -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist) +# set(CONFIGURE_COMMAND "true") +# set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist) + set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist) + set(MAKE_COMMAND $(MAKE)) else() set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist) + set(MAKE_COMMAND $(MAKE)) endif() include(ExternalProject) @@ -21,7 +26,7 @@ ExternalProject_Add(wxWidgets BUILD_IN_SOURCE 1 INSTALL_DIR external/dist CONFIGURE_COMMAND ${CONFIGURE_COMMAND} - BUILD_COMMAND $(MAKE) + BUILD_COMMAND ${MAKE_COMMAND} INSTALL_COMMAND $(MAKE) install ) -- 2.25.1