ref: 85fe52b1ef225112e9021958f56182a6d50325b8
parent: 794e0d43cbb12de4273a2636552ae5a63892ba97
author: Mans Rullgard <mans@mansr.com>
date: Sat Aug 15 11:17:10 EDT 2020
build: simplify pkg-config setup Require pkg-config on the system running autoconf and use the macros it provides.
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,10 +15,7 @@
cygbuild README.win32 README.osx scripts/batch-example.bat \
README.sh FEATURES.in
-if HAVE_PKGCONFIG
-pkgconfigdir = @PKGCONFIGDIR@
pkgconfig_DATA = sox.pc
-endif
play.1 rec.1: sox.1
$(RM) $@ && $(LN_S) $< $@
--- a/configure.ac
+++ b/configure.ac
@@ -53,23 +53,9 @@
AC_ARG_WITH(dyn-default,AS_HELP_STRING([--with-dyn-default],[Default to loading optional formats dynamically]),opt_default=dyn,opt_default=yes)
-AC_ARG_WITH(pkgconfigdir,
- AS_HELP_STRING([--with-pkgconfigdir],
- [location to install .pc files or "no" to disable (default=$(libdir)/pkgconfig)]))
+PKG_PROG_PKG_CONFIG
+PKG_INSTALLDIR
-m4_ifndef([PKG_PROG_PKG_CONFIG], with_pkgconfigdir="no")
-
-using_pkgconfig=no
-if test "$with_pkgconfigdir" != "no"; then
- if test "$with_pkgconfigdir" = ""; then
- with_pkgconfigdir="\$(libdir)/pkgconfig"
- fi
- using_pkgconfig="yes"
- PKG_PROG_PKG_CONFIG
-fi
-AM_CONDITIONAL(HAVE_PKGCONFIG, test x$using_pkgconfig = xyes)
-AC_SUBST(PKGCONFIGDIR, $with_pkgconfigdir)
-
using_win32_glob="no"
case $target in
*mingw*)
@@ -609,12 +595,6 @@
fi
fi
-if test "$using_pkgconfig" = "no"; then
- pkgconfig_option="disabled"
-else
- pkgconfig_option="$with_pkgconfigdir"
-fi
-
# Report configuration.
echo
echo "BUILD OPTIONS"
@@ -621,7 +601,7 @@
echo "Debugging build............$enable_debug"
echo "Distro name ...............$DISTRO"
echo "Dynamic loading support....$using_libltdl"
-echo "Pkg-config location........$pkgconfig_option"
+echo "Pkg-config location........$pkgconfigdir"
echo "Symlinks enabled...........${SYMLINKS:-no}"
echo
echo "OPTIONAL DEVICE DRIVERS"