alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: alsa-devel@alsa-project.org
Cc: Ismael Luceno <ismael@iodev.co.uk>
Subject: [PATCH] configure: Replace PKG_CONFIG calls with PKG_CHECK_VAR
Date: Thu, 26 Nov 2020 21:30:53 +0100	[thread overview]
Message-ID: <20201126203053.12028-1-ismael@iodev.co.uk> (raw)

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 configure.ac | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 29d043f18950..8e130b3f0775 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,12 +204,8 @@ AC_ARG_WITH(
         [udev-rules-dir],
         AS_HELP_STRING([--with-udev-rules-dir=DIR],[Directory where to install udev rules to (default=auto)]),
         [udevrulesdir="$withval"],
-        [udevdir=$($PKG_CONFIG udev --variable=udevdir)
-        if test "x$udevdir" = "x"; then
-            udevrulesdir="/lib/udev/rules.d"
-        else
-            udevrulesdir="$udevdir/rules.d"
-        fi])
+        [PKG_CHECK_VAR([udevdir], [udev], [udevdir])
+	 udevrulesdir="${udevdir:-/lib/udev}/rules.d"])
 AC_SUBST(udevrulesdir)
 
 dnl Checks for header files.
@@ -404,10 +400,10 @@ PKG_CHECK_MODULES(SYSTEMD, [systemd >= 18],
         [have_min_systemd="no"])
 AC_ARG_WITH([systemdsystemunitdir],
         AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
-        [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
-if test "x$with_systemdsystemunitdir" != xno; then
-        AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
-fi
+        [], [PKG_CHECK_VAR([with_systemdsystemunitdir], [systemd], [systemdsystemunitdir])])
+AS_IF([test "x$with_systemdsystemunitdir" != xno],
+	[AC_SUBST([systemdsystemunitdir], ["$with_systemdsystemunitdir"])])
+
 AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_min_systemd" = "yes" \
         -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
 
-- 
2.28.0


                 reply	other threads:[~2020-11-26 20:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201126203053.12028-1-ismael@iodev.co.uk \
    --to=ismael@iodev.co.uk \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).