From 282f79c95a8f79563a412fbbf68fbcf0d6a1f37c Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 4 May 2015 17:45:30 +0100 Subject: [PATCH] Add the option to selectively not use pkg-config during configuration - useful for OpenWrt --- README.md | 2 +- configure.ac | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 443fa204..867be255 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ There are two logically distinct parts to getting Shairport Sync to run properly Shairport Sync reads its configuration from a configuration file at `/etc/shairport-sync.conf`. (While it can also take configuration settings from command line options, it is recommended that you use the configuration file method.) When you run `$sudo make install`, a default configuration is installed at `/etc/shairport-sync.conf` (it won't replace an existing one) which should work in almost any system with a sound card. A sample configuration file is also installed or updated at `/etc/shairport-sync.conf.sample`. If there is a problem, it will be noted in the logfile, normally `/etc/log/syslog`. However, to get the most out of your software and hardware, you need to adjust some of the settings. -To understand what follows, note that settings and parameters are given to Shairport Sync via the file `/etc/shairport-sync.conf`. The purpose of the init script at `/etc/init.d/shairport-sync` is to launch and terminate Shairport Sync. You are perfectly free to remove the init script and launch and terminate Shairport Sync yourself directly; indeed it is useful when you are troubleshooting the program. If you do launch it directly, make sure it isn't running already! +To understand what follows, note that settings and parameters are given to Shairport Sync via the file `/etc/shairport-sync.conf`. The purpose of the init script at `/etc/init.d/shairport-sync` is merely to launch and terminate Shairport Sync. You are perfectly free to remove the init script and launch and terminate Shairport Sync yourself directly; indeed it is useful when you are troubleshooting the program. If you do launch it directly, make sure it isn't running already! As well as the man page, don't forget you can launch Shairport Sync with the `-h` option to get some help on the options available. diff --git a/configure.ac b/configure.ac index 3f84d058..2e552672 100644 --- a/configure.ac +++ b/configure.ac @@ -28,15 +28,25 @@ if test "x${with_os_type}" = xlinux; then AC_CHECK_LIB([rt],[clock_gettime], , AC_MSG_ERROR(librt needed)) fi +##### Some build systems are not fully using pkg-config, so we can use the flag ${with_pkg_config} on a case-by-case basis +##### to control how to deal with them + +AC_ARG_WITH([pkg_config], +[ --with-pkg-config = use pkg-config to find libraries], ,[with_pkg_config=1]) + AC_CHECK_LIB([daemon],[daemon_log], , AC_MSG_ERROR(libdaemon needed)) AC_CHECK_LIB([pthread],[pthread_create], , AC_MSG_ERROR(pthread library needed)) AC_CHECK_LIB([m],[exp], , AC_MSG_ERROR(maths library needed)) AC_MSG_RESULT(>>Including libpopt) -PKG_CHECK_MODULES( - [POPT], [popt], - [LIBS="${POPT_LIBS} ${LIBS}" - AC_DEFINE([HAVE_LIBPOPT],[1],[Define to 1 if you have popt])]) +if test "x${with_pkg_config}" = x1 ; then + PKG_CHECK_MODULES( + [POPT], [popt], + [LIBS="${POPT_LIBS} ${LIBS}" + AC_DEFINE([HAVE_LIBPOPT],[1],[Define to 1 if you have popt])]) +else + AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed)) +fi AC_ARG_WITH([initscript], [ --with-initscript = include a startup script], ,[with_initscript=1])