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))