Fix linking order of libsndfile to be after sox to make static build of sox happy...
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 5 Mar 2015 22:05:54 +0000 (22:05 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 5 Mar 2015 22:05:54 +0000 (22:05 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2055 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/CMakeLists.txt
fdmdv2/cmake/BuildSox.cmake
fdmdv2/cmake/BuildWxWidgets.cmake

index 20fe1d685aaf5d40ca61919182bbf76bb0c9216f..e9951141f70889ecdcf22d9251592d71ce2c4a1d 100644 (file)
@@ -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
 #
index 9d513e1665f72c5bd7e19b29bb9c706b34703281..635fc93da3fc3002929b22dc0468a1052c3ba087 100644 (file)
@@ -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)
index cf0f17b3f16d6c9ed439540a772fba8b922d92c3..68114038b83dd52a637a037a26a4221d3eeb6df6 100644 (file)
@@ -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
 )