From d66ab65f35f7731c10db3f89661be5c241c2e05d Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 15 Dec 2012 23:28:45 +0000 Subject: [PATCH] experimental new makefile for Linux that downloads and builds most of the libraries we need, tested on Ubuntu 9.1 and 10.04 git-svn-id: https://svn.code.sf.net/p/freetel/code@1137 01035d8c-6547-0410-b346-abe4f91aad63 --- fdmdv2/Makefile | 28 ++++---- fdmdv2/README.linux | 130 ++++---------------------------------- fdmdv2/src/Makefile.linux | 10 ++- 3 files changed, 33 insertions(+), 135 deletions(-) diff --git a/fdmdv2/Makefile b/fdmdv2/Makefile index 56f9f4ec..5fd33dc8 100644 --- a/fdmdv2/Makefile +++ b/fdmdv2/Makefile @@ -96,11 +96,11 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /p/Radio/fdmdv2/missing --run aclocal-1.11 -AMTAR = ${SHELL} /p/Radio/fdmdv2/missing --run tar -AUTOCONF = ${SHELL} /p/Radio/fdmdv2/missing --run autoconf -AUTOHEADER = ${SHELL} /p/Radio/fdmdv2/missing --run autoheader -AUTOMAKE = ${SHELL} /p/Radio/fdmdv2/missing --run automake-1.11 +ACLOCAL = ${SHELL} /home/david/fdmdv2/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/david/fdmdv2/missing --run tar +AUTOCONF = ${SHELL} /home/david/fdmdv2/missing --run autoconf +AUTOHEADER = ${SHELL} /home/david/fdmdv2/missing --run autoheader +AUTOMAKE = ${SHELL} /home/david/fdmdv2/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=none @@ -114,9 +114,9 @@ ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E -EXEEXT = .exe +EXEEXT = GREP = /bin/grep -INSTALL = /bin/install -c +INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} @@ -125,7 +125,7 @@ LDFLAGS = LIBOBJS = LIBS = -lm LTLIBOBJS = -MAKEINFO = ${SHELL} /p/Radio/fdmdv2/missing --run makeinfo +MAKEINFO = ${SHELL} /home/david/fdmdv2/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = fdmdv2 @@ -137,13 +137,13 @@ PACKAGE_URL = PACKAGE_VERSION = 0.2 PATH_SEPARATOR = : SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = VERSION = 0.2 -abs_builddir = /p/Radio/fdmdv2 -abs_srcdir = /p/Radio/fdmdv2 -abs_top_builddir = /p/Radio/fdmdv2 -abs_top_srcdir = /p/Radio/fdmdv2 +abs_builddir = /home/david/fdmdv2 +abs_srcdir = /home/david/fdmdv2 +abs_top_builddir = /home/david/fdmdv2 +abs_top_srcdir = /home/david/fdmdv2 ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -162,7 +162,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /p/Radio/fdmdv2/install-sh +install_sh = ${SHELL} /home/david/fdmdv2/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/fdmdv2/README.linux b/fdmdv2/README.linux index 4829afa1..837bb8d5 100644 --- a/fdmdv2/README.linux +++ b/fdmdv2/README.linux @@ -11,131 +11,23 @@ Linux usage Notes BUILDING FreeDV for Linux ========================= -1 FreeDV was developed on Ubuntu 9.1 and 10.04 systems. I installed the - Ubuntu packages: +1. FreeDV was developed on Ubuntu 9.1 and 10.04 systems. It has been + tested on OSS (Ubuntu 9.1) and ALSA (Ubuntu 10.04) sound systems. + +2. A typical ALSA installation (e.g., Ubuntu 10.04) first install the + following packages: libsamplerate, libsamplerate-dev libsndfile1, libsndfile1-dev + libasound, libasound_dev -2. Some people have also reported needing libasound and libasound_dev (and -lasound in - the linker line of Makefile.linux) - -3. Then build the other libraries below from source. At present the - way each package is built and installed is not consistent. Some - are installed with "make install", others are pointed to via - Makefile variables. - -4. You may need to edit the Makefile.linux variables for your system: - - WX_GTK_PATH - CODEC2_PATH - SOX_LIB_PATH - -wxWidgets ---------- - -1. Download wxWidgets 2.9.4 or later and untar - -2. Install GTK development files (e.g. on Ubuntu libgtk2.0-dev) - -3. Build the gtk version: - - $ cd wxWidgets-2.9.4 - $ mkdir build_gtk - $ cd build_gtk - $ ../configure - $ make - -4. You don't actually have to "make install" wxWidgets (unless you - really want to), it can be used by fdmdv2 out of the directory you - build it in. - -Portaudio ---------- - -1. Make sure ALSA development support (libasound and headers) is - present. Portaudio will work with OSS but I found I couldn't - adjust the mic gain using OSS. On a modern version of Ubuntu the - ALSA libs can be installed with: - - sudo apt-get install libasound-dev - - Note I had problems with the ALSA development library on Ubuntu - 9.10, so used OSS and put up with not being able to adjust the mic - gain. - -2. Download and untar pa_stable_V19 - -3. Configure with C++ enabled: - - $ ./configure --enable-cxx - - : - - Configuration summary: - - Target ...................... i686-pc-linux-gnu - C++ bindings ................ yes - Debug output ................ no - - ALSA ........................ yes - ASIHPI ...................... no - - OSS ......................... yes - JACK ........................ no - -4. $ make - -5. You can test Portaudio with bin/pa_devs & bin/patest_sine8. - -6. I used a "sudo make install", and removed the default Unbuntu - portaudio libs as they were an earlier version. It's probably - possible to build fdmdv2 without "make install", by passing - --prefix to the ./configure stage. - -libsox ------- - -We use some of the internal sox functions for the equaliser feature. - -wget http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0.tar.gz/download -tar xvzf sox-14.4.0.tar.gz -cd sox-14.4.0 - -Now we only want to use a few internal functions of sox. This -configure line mkes sure we don't build in unneeded depednancies: - -sox-14.4.0$ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile - -sox-14.4.0$ make - -libctb (Communications Toolbox) -------------------------------- - -$ wget https://iftools.com/download/ctb/0.16/libctb-0.16.tar.gz -$ tar xvzf libctb-0.16.tar.gz -$ cd libctb-0.16/build -build$ make -build$ sudo make install - -I found the "sudo make DEBUG=0 GPIB=0 install" didn't install the kbhit.h file: - -build$ sudo cp ../include/ctb-0.16/kbhit.h /usr/local/include/ctb-0.16 -build$ sudo ldconfig - -codec2-dev ----------- - -1. See codec2-dev/README. No need to "make install" - -fdmdv2 ------- - -1. svn co https://freetel.svn.sourceforge.net/svnroot/freetel/fdmdv2 +3. If you would like to use OSS rather than ALSA do not install + libasound & libasound_dev. -2. Modify the paths at the top of src/Makefile.linux for wxWidgets and codec2-dev +4. Makefile.linux will download the libraries you need, configure and + build them, then build FreeDV. Makefile.linux will not install + any of the libraries you build ob your system. -3. cd fdmdv2/src make -f Makefile.linux diff --git a/fdmdv2/src/Makefile.linux b/fdmdv2/src/Makefile.linux index 141d1089..80d6f1dc 100644 --- a/fdmdv2/src/Makefile.linux +++ b/fdmdv2/src/Makefile.linux @@ -41,10 +41,16 @@ CTB=libctb-0.16 CTB_INC=-I$(CTB)/include CTB_LIB=$(CTB)/lib/libctb-0.16.a +# if libasound is available, PortAudio will be using it, so we will +# need to add it to freedv link line. To test if it is present, we try +# to link a small C program with -lasound + +LIBASOUND=$(shell echo "int main(void) {return 0;}" | gcc -xc - -lasound 2>/dev/null ; if [ $$? -eq 0 ] ; then echo "-lasound" ; fi ) + # FreeDV ------------------------------------------------ CPP_FLAGS = $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\" -FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate -lasound +FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND) OBJS = topFrame.o \ fdmdv2_main.o \ @@ -66,7 +72,7 @@ all: $(WXWIDGETS)/.built $(PORTAUDIO)/.built $(CODEC2)/.built $(SOX)/.built $(CT freedv: $(OBJS) g++ -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS) - + %.o: %.cpp $(HDRS) g++ $(CPP_FLAGS) -c $< -o $@ -- 2.25.1