From: Antonio Ospite Date: Tue, 7 Nov 2017 12:06:33 +0000 (+0100) Subject: [PATCH] Fix building against the system portaudio library X-Git-Tag: archive/raspbian/3.6.3+dfsg-1+rpi1~1^2^2^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ffee2b8a62f7ee7115f9e9c470407beefb33b5c;p=audacity.git [PATCH] Fix building against the system portaudio library Building against the system portaudio results in this error: ./src/AudioIO.cpp:983: undefined reference to `PaUtil_GetTime' audacity-AudioIO.o: In function `audacityAudioCallback(void const*, void*, unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)': ./src/AudioIO.cpp:4630: undefined reference to `PaUtil_GetTime' collect2: error: ld returned 1 exit status Makefile:2349: recipe for target 'audacity' failed make[3]: *** [audacity] Error 1 This is because PaUtil_GetTime is declared as a C symbol in pa_util.h but is resolved as a C++ symbol at link time. Audacity fixes this in the local tree with this change: https://github.com/audacity/audacity/commit/38fd97b8e26060332ab3e9e000a8882326a70ba7 However this is not general enough for the portaudio debian package. Since PaUtil_GetTime() is the only function causing problems, just copy over the code where it's used. [Sebastian Ramacher]: Call clock_gettime directly. Gbp-Pq: Name 0002-PATCH-Fix-building-against-the-system-portaudio-libr.patch --- diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 0187e396..bfb0848b 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -491,8 +491,16 @@ time warp info and AudioIOListener and whether the playback is looped. #define ROUND(x) (int) ((x)+0.5) //#include // #include "../lib-src/portmidi/pm_common/portmidi.h" - #include "../lib-src/portaudio-v19/src/common/pa_util.h" #include "NoteTrack.h" +#include + +PaTime PaUtil_GetTime( void ) +{ + struct timespec tp; + clock_gettime(CLOCK_REALTIME, &tp); + return (PaTime)(tp.tv_sec + tp.tv_nsec * 1e-9); +} + #endif #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT