From f244d10a45c3161949cf2d29b52405e23c854e2f Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 3 Jun 2018 08:57:48 +0100 Subject: [PATCH 1/2] Fix BSD build, adding missing linker flag. --- config.lib | 3 +++ src/os/strings.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.lib b/config.lib index 09bd456e4..d65dc496b 100644 --- a/config.lib +++ b/config.lib @@ -991,6 +991,9 @@ make_cflags_and_ldflags() { if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then CFLAGS="$CFLAGS -DUNIX" fi + if [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ]; then + LIBS="$LIBS -lintl" + fi # And others like Windows if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then CFLAGS="$CFLAGS -DWIN" diff --git a/src/os/strings.h b/src/os/strings.h index daac8314d..bd88ed6bc 100644 --- a/src/os/strings.h +++ b/src/os/strings.h @@ -84,7 +84,7 @@ #if !defined(__MINGW32__) && defined(__GNUC__) && !defined(snprintf) /* (v)snprintf is in fact C99, but we like to use it over (v)sprintf for the obvious reasons */ - #if !defined(__APPLE__) && !defined(TOS) && !defined(__FreeBSD__) && !defined(__DJGPP__) + #if !defined(__APPLE__) && !defined(TOS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DJGPP__) extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, va_list __arg) __THROW __attribute__ ((__format__ (__printf__, 3, 0))); #endif /* __APPLE__ */ From ec973435ea59f3b74f335535fbc988f2683237d8 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 4 Jun 2018 15:59:36 +0200 Subject: [PATCH 2/2] -Change: fix compilation under *BSD with pulse audio --- config.lib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.lib b/config.lib index d65dc496b..66fb1f5fd 100644 --- a/config.lib +++ b/config.lib @@ -991,9 +991,6 @@ make_cflags_and_ldflags() { if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then CFLAGS="$CFLAGS -DUNIX" fi - if [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ]; then - LIBS="$LIBS -lintl" - fi # And others like Windows if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then CFLAGS="$CFLAGS -DWIN" @@ -1070,6 +1067,9 @@ make_cflags_and_ldflags() { if [ "$with_pulse" != "0" ]; then LIBS="$LIBS $(pkg-config --libs-only-l libpulse)" CFLAGS="$CFLAGS $(pkg-config --cflags libpulse) -DPULSEAUDIO" + if [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ]; then + LIBS="$LIBS -lintl" + fi fi if [ "$with_munt" != "0" ]; then