[PATCH] configure: Replace PKG_CONFIG calls with PKG_CHECK_VAR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ismael Luceno <ismael@xxxxxxxxxxx>
---
 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




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux