modified ./configure to x-compile for windows on Unbuntu Linux. Just after first...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 17 Jun 2015 00:58:55 +0000 (00:58 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 17 Jun 2015 00:58:55 +0000 (00:58 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2199 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/README.txt
fdmdv2-dev/cmake/BuildSamplerate.cmake
fdmdv2-dev/cmake/BuildSndfile.cmake
fdmdv2-dev/cmake/BuildSox.cmake
fdmdv2-dev/cmake/BuildSpeex.cmake

index 18e6f378608d5e0ec8d04a8b766302416c8b3786..db34eefa0c9d0981e86ce5f7387f2953a757683f 100644 (file)
@@ -8,65 +8,73 @@ Quickstart 1
 Builds static versions of wxWidgets, portaudio, codec2-dev, which are commonly
 missing on many Linux systems, or of the wrong (older) version.
 
-Assuming the freedv-dev sources is checked out into ~/fdmdv2-dev:
+1/ Assuming the freedv-dev sources is checked out into ~/fdmdv2-dev:
 
-$ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
-$ cd fdmdv2-dev
-$ mkdir build_linux
-$ cd build_linux
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
-$ make
-[wxWidgets builds]
-
-Then you can use your local codec-dev, something like:
+  $ sudo apt-get install libgtk2.0-dev libhamlib-dev libsamplerate-dev libasound2-dev libao-dev
+  $ cd fdmdv2-dev
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE ~/fdmdv2-dev
+  $ make
 
-$ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/home/david/codec2-dev/src -DCODEC2_LIBRARY=/home/david/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+2/ Then you can configure FreeDV using your local codec-dev, something like:
 
-OR build a local copy of codec2-dev:
+  $ cmake -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=TRUE -DCODEC2_INCLUDE_DIRS=/home/david/codec2-dev/src -DCODEC2_LIBRARY=/home/david/codec2-dev/build_linux/src/libcodec2.so -DUSE_STATIC_CODEC2=FALSE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
 
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+3/ OR build a local copy of codec2-dev:
 
-$ make
-[FreeDV builds]
-$ ./src/freedv
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DUSE_STATIC_CODEC2=TRUE -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SOX=TRUE ../
+  
+4/ Build and run FreeDV:
 
-Note: add "-DCMAKE_BUILD_TYPE=Debug" the list above for debug (gcc -g) buildthat include source line numbers and working asserts().
+   $ make
+   $ ./src/freedv
 
 Quickstart 2
 ------------
 
-Assuming you have all the dependant libraries:
+1/ Assuming you have all the dependant libraries:
 
-$ cd /path/to/fdmdv2
-$ mkdir build_linux
-$ cd build_linux
-$ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
-(if no errors)
-$ make
-(as root)
-$ make install
+  $ cd /path/to/fdmdv2
+  $ mkdir build_linux
+  $ cd build_linux
+  $ cmake ../ (defaults to /usr/local, use CMAKE_INSTALL_PREFIX to override)
+  (if no errors)
+  $ make
+  (as root)
+  $ make install
 
 
 =======================================================
  Building for Windows on Ubuntu Linux (Cross compiling)
 =======================================================
 
-Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
+1/ Install the cross compiling toolchain:
 
-$ sudo apt-get install mingw-w64
-$ cd /path/to/fdmdv2-dev
-$ mkdir build_windows
-$ cd build_windows
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake
-$ make
+  $ sudo apt-get install mingw-w64
+
+2/ Patch cmake using: http://www.cmake.org/gitweb?p=stage/cmake.git;a=patch;h=33286235048495ceafb636d549d9a4e8891967ae
+
+3/ Checkout a fresh copy of codec2-dev and build for Windows, pointing to the generate_codebook built by a linux build of generate_codebook, using this cmake line
+
+  $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../fdmdv2-dev/cmake/Toolchain-Ubuntu-mingw32.cmake -DUNITTEST=FALSE -DGENERATE_CODEBOOK=/home/david/codec2-dev/build_linux/src/generate_codebook
+
+4/ Build WxWidgets
+
+  $ cd /path/to/fdmdv2-dev
+  $ mkdir build_windows
+  $ cd build_windows
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake
+  $ make
 
-[wxWidgets builds]
+5/ Download and install the Windows version of Hamlib:
 
-$ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
-$ unzip hamlib-win32-1.2.15.3.zip
+  $ wget http://internode.dl.sourceforge.net/project/hamlib/hamlib/1.2.15.3/hamlib-win32-1.2.15.3.zip
+  $ unzip hamlib-win32-1.2.15.3.zip
 
-$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_DEPS=TRUE -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib ..
+6/ Build All the libraries and FreeDV:
 
+  $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-Ubuntu-mingw32.cmake -DUSE_STATIC_PORTAUDIO=TRUE -DUSE_STATIC_SNDFILE=TRUE -DUSE_STATIC_SAMPLERATE=TRUE -DUSE_STATIC_SOX=TRUE -DUSE_STATIC_CODEC2=FALSE -DCODEC2_INCLUDE_DIRS=/home/david/tmp/codec2-dev/src -DCODEC2_LIBRARY=/home/david/tmp/codec2-dev/build_windows/src/libcodec2.dll.a -DHAMLIB_INCLUDE_DIR=hamlib-win32-1.2.15.3/include -DHAMLIB_LIBRARY=hamlib-win32-1.2.15.3/lib/gcc/libhamlib.dll.a ..
 
 ====================================
  Building and installing on Windows
@@ -151,6 +159,13 @@ TODO
         [ ] tx works
         [ ] clipper a check box, so we can see difference in spectrum
         [ ] cohpsk snr est
+        [ ] squelch
+        [ ] from radio plot broken
+    [ ] freedv api
+        [ ] normalise output pwr across modes?
+            + or maybe peak output?
+            + option?
+        [X] support for both varicodes
     [ ] test mode
         [ ] get error patterns working again, both 700 and 1600
         [ ] how to plot error histogram
index 7d94e4878ddf34302addf5a335294806447b8102..aa09f855fdcf10452e7975eb0525fb6a119c5e2f 100644 (file)
@@ -1,11 +1,17 @@
 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)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist)
+endif()
+
 include(ExternalProject)
 ExternalProject_Add(samplerate
     URL http://www.mega-nerd.com/SRC/${SAMPLERATE_TARBALL}.tar.gz 
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
     BUILD_COMMAND $(MAKE)
     INSTALL_COMMAND $(MAKE) install
 )
index a3706ffaab1b20664fbac379c6879d631196e302..43233fb7047774b77819389141187dc04db07fd9 100644 (file)
@@ -1,11 +1,17 @@
 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)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared --disable-external-libs)
+endif()
+
 include(ExternalProject)
 ExternalProject_Add(sndfile
     URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs --disable-shared
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
     BUILD_COMMAND $(MAKE) V=1
     INSTALL_COMMAND $(MAKE) install
 )
index 635fc93da3fc3002929b22dc0468a1052c3ba087..e2529a637be061c4a6b833790501ebb44a1c54eb 100644 (file)
@@ -20,12 +20,18 @@ On Linux systems try installing:
     )
 endif(UNIX AND NOT AO_LIBRARIES)
 
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${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 --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 --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 --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
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
     BUILD_COMMAND $(MAKE) V=1
     INSTALL_COMMAND $(MAKE) install
 )
index 17b53d6baa4a23158f06cb9a9a0995e1fc7cb830..b46c6e17e9d56db805955ab278f45bfe8936f7aa 100644 (file)
@@ -1,11 +1,17 @@
 set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
 
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+else()
+    set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
+endif()
+
 include(ExternalProject)
 ExternalProject_Add(speex
    URL http://downloads.xiph.org/releases/speex/${SPEEXDSP_TARBALL}
    BUILD_IN_SOURCE 1
    INSTALL_DIR external/dist
-   CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples
+   CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
    BUILD_COMMAND $(MAKE)
    INSTALL_COMMAND $(MAKE) install
 )