From 769a95edb5642f342c0e147a252e88836f898d51 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 28 Jan 2017 20:51:08 +0000 Subject: [PATCH] builds and runs OK on Linux with internal sox library files, speaker eq tested, README updated for no sox, modfied positioningof audio setup dialog so OK not hidden off screen git-svn-id: https://svn.code.sf.net/p/freetel/code@3003 01035d8c-6547-0410-b346-abe4f91aad63 --- freedv-dev/CMakeLists.txt | 28 --------------- freedv-dev/cmake/BuildSamplerate.cmake | 2 +- freedv-dev/cmake/BuildSndfile.cmake | 2 +- freedv-dev/cmake/BuildSox.cmake | 48 -------------------------- freedv-dev/src/dlg_audiooptions.cpp | 4 +-- freedv-dev/src/dlg_audiooptions.h | 2 +- freedv-dev/src/sox/sox_i.h | 2 ++ 7 files changed, 7 insertions(+), 81 deletions(-) delete mode 100644 freedv-dev/cmake/BuildSox.cmake diff --git a/freedv-dev/CMakeLists.txt b/freedv-dev/CMakeLists.txt index 5f575797..b3ca6bc9 100644 --- a/freedv-dev/CMakeLists.txt +++ b/freedv-dev/CMakeLists.txt @@ -86,8 +86,6 @@ set(USE_STATIC_SNDFILE FALSE CACHE BOOL "Download and build static sndfile instead of the system library.") set(USE_STATIC_SAMPLERATE FALSE CACHE BOOL "Download and build static samplerate instead of the system library.") -set(USE_STATIC_SOX FALSE CACHE BOOL - "Download and build static sox instead of the system library.") set(USE_STATIC_CODEC2 TRUE CACHE BOOL "Download and build static codec2 instead of the system library.") set(USE_STATIC_SPEEXDSP TRUE CACHE BOOL @@ -99,7 +97,6 @@ if(USE_STATIC_DEPS) set(USE_STATIC_PORTAUDIO TRUE FORCE) set(USE_STATIC_SNDFILE TRUE FORCE) set(USE_STATIC_SAMPLERATE TRUE FORCE) - set(USE_STATIC_SOX TRUE FORCE) set(USE_STATIC_CODEC2 TRUE FORCE) endif(USE_STATIC_DEPS) @@ -282,31 +279,6 @@ else(NOT USE_STATIC_SAMPLERATE) include(cmake/BuildSamplerate.cmake) endif(NOT USE_STATIC_SAMPLERATE) -# -# Find sox library -# -if(NOT USE_STATIC_SOX) - message(STATUS "Looking for sox...") - find_library(LIBSOX_LIBRARY sox) - find_path(LIBSOX_INCLUDE_DIR NAMES sox/sox.h sox.h) - message(STATUS " sox library: ${LIBSOX_LIBRARY}") - message(STATUS " sox headers: ${LIBSOX_INCLUDE_DIR}") - if(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR) - list(APPEND FREEDV_LINK_LIBS ${LIBSOX_LIBRARY}) - include_directories(${LIBSOX_INCLUDE_DIR}) - else(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR) - message(FATAL_ERROR "sox library not found. -On Linux systems try installing: - sox-devel (RPM based systems) - libsox-dev (DEB based systems) -On Windows it's easiest to use the cmake option: USE_STATIC_SOX" - ) - endif(LIBSOX_LIBRARY AND LIBSOX_INCLUDE_DIR) -else(NOT USE_STATIC_SOX) - message(STATUS "Will attempt static build of sox.") - include(cmake/BuildSox.cmake) -endif(NOT USE_STATIC_SOX) - # # sndfile Library # diff --git a/freedv-dev/cmake/BuildSamplerate.cmake b/freedv-dev/cmake/BuildSamplerate.cmake index aa09f855..8b6b7a36 100644 --- a/freedv-dev/cmake/BuildSamplerate.cmake +++ b/freedv-dev/cmake/BuildSamplerate.cmake @@ -1,7 +1,7 @@ set(SAMPLERATE_TARBALL "libsamplerate-0.1.8") if(MINGW AND CMAKE_CROSSCOMPILING) - set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile) + set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-sndfile --disable-fftw) else() set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist) endif() diff --git a/freedv-dev/cmake/BuildSndfile.cmake b/freedv-dev/cmake/BuildSndfile.cmake index 43233fb7..c49b6388 100644 --- a/freedv-dev/cmake/BuildSndfile.cmake +++ b/freedv-dev/cmake/BuildSndfile.cmake @@ -1,7 +1,7 @@ set(SNDFILE_TARBALL "libsndfile-1.0.25") if(MINGW AND CMAKE_CROSSCOMPILING) - set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared) + set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-sqlite) else() set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs) endif() diff --git a/freedv-dev/cmake/BuildSox.cmake b/freedv-dev/cmake/BuildSox.cmake deleted file mode 100644 index d54488b3..00000000 --- a/freedv-dev/cmake/BuildSox.cmake +++ /dev/null @@ -1,48 +0,0 @@ -set(SOX_TARBALL "sox-14.4.1") - -# required linking libraries on linux. Not sure about windows. -find_library(ALSA_LIBRARIES asound) -find_library(AO_LIBRARIES ao) -find_library(GSM_LIBRARIES gsm) - -if(UNIX AND NOT ALSA_LIBRARIES) - message(ERROR "Could not find alsa library. -On Linux systems try installing: - alsa-lib-devel (RPM based systems) - libasound2-dev (DEB based systems)" - ) -endif(UNIX AND NOT ALSA_LIBRARIES) - -if(UNIX AND NOT AO_LIBRARIES) - message(ERROR "Could not find libao. -On Linux systems try installing: - libao-devel (RPM based systems) - libao-dev (DEB based systems)" - ) -endif(UNIX AND NOT AO_LIBRARIES) - -if(MINGW AND CMAKE_CROSSCOMPILING) - set(CONFIGURE_COMMAND ./configure --host=${HOST} --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 --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist) -else() - set(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 --with-gsm --prefix=${CMAKE_BINARY_DIR}/external/dist) -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_COMMAND} - BUILD_COMMAND $(MAKE) V=1 - INSTALL_COMMAND $(MAKE) install -) -set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a) -if(UNIX) - list(APPEND SOX_LIBRARIES ${ALSA_LIBRARIES} ${AO_LIBRARIES} ${GSM_LIBRARIES}) -endif() -if(MINGW) - list(APPEND SOX_LIBRARIES winmm) -endif() -include_directories(${CMAKE_BINARY_DIR}/external/dist/include) -list(APPEND FREEDV_LINK_LIBS ${SOX_LIBRARIES}) -list(APPEND FREEDV_STATIC_DEPS sox) diff --git a/freedv-dev/src/dlg_audiooptions.cpp b/freedv-dev/src/dlg_audiooptions.cpp index 7d23a08f..4e8cd981 100644 --- a/freedv-dev/src/dlg_audiooptions.cpp +++ b/freedv-dev/src/dlg_audiooptions.cpp @@ -70,8 +70,8 @@ void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnT //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - this->SetSizeHints(wxSize(850, 600), wxDefaultSize); - + //this->SetSizeHints(wxSize(850, 600), wxDefaultSize); + fprintf(stderr, "pos %d %d\n", pos.x, pos.y); Pa_Init(); wxBoxSizer* mainSizer; diff --git a/freedv-dev/src/dlg_audiooptions.h b/freedv-dev/src/dlg_audiooptions.h index 7a78b59a..5aa6741d 100644 --- a/freedv-dev/src/dlg_audiooptions.h +++ b/freedv-dev/src/dlg_audiooptions.h @@ -169,7 +169,7 @@ class AudioOptsDialog : public wxDialog public: - AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxPoint(1,1), const wxSize& size = wxSize( 800, 650 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~AudioOptsDialog(); int ExchangeData(int inout); }; diff --git a/freedv-dev/src/sox/sox_i.h b/freedv-dev/src/sox/sox_i.h index e2cdbae4..9d533263 100644 --- a/freedv-dev/src/sox/sox_i.h +++ b/freedv-dev/src/sox/sox_i.h @@ -16,6 +16,8 @@ #include "soxomp.h" /* Note: soxomp.h includes soxconfig.h */ #include "sox.h" +#define __FREEDV__ + #if defined HAVE_FMEMOPEN #define _GNU_SOURCE #endif -- 2.25.1