From: Mike Brady Date: Tue, 13 Feb 2018 17:17:37 +0000 (+0000) Subject: Include the -pthread flag -- including the pthread library with -lpthread isn't alway... X-Git-Tag: 3.2d29~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9264f3a8e98d9152549eccc152968b1003e47fc2;p=thirdparty%2Fshairport-sync.git Include the -pthread flag -- including the pthread library with -lpthread isn't always enough --- diff --git a/Makefile.am b/Makefile.am index 45f3b539..373ae010 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ bin_PROGRAMS = shairport-sync shairport_sync_SOURCES = shairport.c rtsp.c mdns.c mdns_external.c common.c rtp.c player.c alac.c audio.c loudness.c -AM_CFLAGS = -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\" +AM_CFLAGS = -Wno-multichar -pthread -DSYSCONFDIR=\"$(sysconfdir)\" if BUILD_FOR_FREEBSD AM_CPPFLAGS = -I/usr/local/include -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\" -O2 else diff --git a/configure.ac b/configure.ac index dec61a38..b81b2fe1 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,9 @@ else AC_CHECK_LIB([daemon],[daemon_fork], , AC_MSG_ERROR(libdaemon needed)) fi +##### The following check for the pthreads library doesn't put the compiler into the correct pthread mode +##### so we add the -pthread compilation flag in AMFLAGS in the Makefile.am as well. + AC_CHECK_LIB([pthread],[pthread_create], , AC_MSG_ERROR(pthread library needed)) AC_CHECK_LIB([m],[exp], , AC_MSG_ERROR(maths library needed))