From 6ccb16891ea84e94ed0620a5680f4bdff0b080d1 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 15 May 2021 23:36:54 +0100 Subject: [PATCH] Updated build instructions for portaudio MinGW builds on MS Windows These instructions recommend building v19.06, and patching to enable shared library builds. This will allow users to substitute a build of libportaudio-2.dll with ASIO support if required. We cannot redistribute binaries with proprietary, closed sources, like the Steinberg ASIO SDK, although users can build it themselves for personal use. --- doc/building on MS Windows.txt | 48 +++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/doc/building on MS Windows.txt b/doc/building on MS Windows.txt index 0df690309..15e837d30 100644 --- a/doc/building on MS Windows.txt +++ b/doc/building on MS Windows.txt @@ -103,13 +103,13 @@ repository which can be cloned with this command: Next you must build Hamlib using the MinGW compiler tools bundled with Qt. As you will build Hamlib again when there are updates you should -set up you Msys2 command line environment for this. I use a +set up you MSYS2 command line environment for this. I use a $HOME/.bash_profile file containing these lines: dll_paths_64bit=/c/Tools/libusb-1.0.23/MinGW64/dll export PATH=/c/Qt/Tools/mingw810_64/bin:$dll_paths_64bit:$PATH -Test the amended ~/.bash_profile file by opening a new Msys2 shell and +Test the amended ~/.bash_profile file by opening a new MSYS2 shell and typing: which gcc @@ -122,7 +122,7 @@ Hamlib sources: cd ~/src/sf/bsomervi/hamlib ./bootstrap -Now you need to configure and build Hamlib from an Msys2 shell. Create +Now you need to configure and build Hamlib from an MSYS2 shell. Create a build directory outside of the Hamlib sources you have just cloned, then change working directory to that build directory. @@ -174,20 +174,36 @@ portaudio --------- This library is only available as sources so must be built. It uses -autotools and building using MinGW tools from an Msys shell is -recommended. Ensure your Msys shell environment (PATH) is correctly +autotools and building using MinGW tools from an MSYS2 shell is +recommended. Ensure your MSYS2 shell environment (PATH) is correctly set up for the MinGW tool chain you wish to build with, i.e. the MinGW tools bundled with the Qt installation for 32-, or 64-bit as required. -Download the latest stable version sources tarball from +Download this specific version's sources tarball from http://files.portaudio.com/download.html , at the time of writing that -was the pa_stable_v190700_20210406.tgz file. Unzip and unpack the +was the pa_stable_v190600_20161030.tgz file. Unzip and unpack the tarball in a suitable location like ~/src : cd ~/src tar xf ~/Downloads/pa_stable_v190700_20210406.tgz -out-of-source-tree builds are recommended, create a build directory in + +Note that on Windows portaudio will only build static libraries using +the standard configuration, we prefer dynamic libraries for portaudio +as users may wish to substitute a build of the library with ASIO +support for personal use (we cannot redistribute binaries built from +proprietary closed source sources like the Steinberg ASIO SDK). + +In order to build DLLs on Windows the configure script requires a +patch as follows: + + sed -i -e 's/-luuid//g' ~/src/portaudio/configure + +This removes linker dependencies on the MS uuid library since it is +only available as a static archive and using that would disallow +shared library creation. + +Out-of-source-tree builds are recommended, create a build directory in a suitable location like ~/build and change working directory to it: mkdir -p ~/build/portaudio/mingw64 @@ -196,10 +212,11 @@ a suitable location like ~/build and change working directory to it: Configure and build and install the library in a suitable place (I use ~/local as a root directory for installed packages. - ~/src/portaudio/configure --prefix=$(HOME)/local/portaudio/mingw64 --with-winapi=wmme,directx,wdmks CFLAGS=-DNDEBUG + ~/src/portaudio/configure --prefix=$(HOME)/local/portaudio/mingw64 \ + --with-winapi=wmme,directx,wdmks --disable-static --enable-shared CFLAGS=-DNDEBUG make && make install -Repeat for the 32-bit architecture if required, using a suitable Msys +Repeat for the 32-bit architecture if required, using a suitable MSYS2 environment for the required tool chain, different build directory, and install location. @@ -216,6 +233,11 @@ chain files: and similarly with the 32-bit tool chain file specifying the mingw32 portaudio installation root directory. -Note that on Windows portaudio will only build static libraries using -the standard configuration, this is fine and therefore there is no -need to add any new run-time paths to your execution environment. +To run Debug configuration WSJT-X builds you will also need to add the +location of the portaudio DLL to your PATH environment variable, like: + + SET "Path=%UserProfile%\local\portaudio\mingw64\bin;%Path%" + +Verify the setup with: + + WHERE libportaudio-2.dll