Project

General

Profile

Bug #271

configure.ac depends on PKG_CHECK_VAR

Added by Luís Picciochi over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Major
Assignee:
-
Category:
-
Target version:
Start date:
March 27, 2013
Due date:
% Done:

100%

Estimated time:
Affects version:

Description

The audacious-plugins configure.ac script depends on PKG_CHECK_VAR:

$ grep -n PKG_CHECK_VAR configure.ac
1062:PKG_CHECK_VAR([plugindir], [audacious], [plugin_dir], [], [AC_MSG_ERROR([Cannot retrieve plugin_dir pkgconfig variable])])

However, this macro is only available starting at pkg-config 0.28 (release notes here).

Either increase the dependency on pkg-config (currently at 2.59) or don't use this macro.
As a workaround, I defined the macro locally (ripped from the upstream commit). I'm not sure if we want to do this even if only when it's not provided by the installed pkg-config.

$ git diff configure.ac
diff --git a/configure.ac b/configure.ac
index 0d0f839..db28962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,16 @@ AUD_COMMON_PROGS
 BUILDSYS_INIT
 BUILDSYS_SHARED_LIB

+  AC_DEFUN([PKG_CHECK_VAR],
+    [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+     AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+     _PKG_CONFIG([$1], [variable="][$3]["], [$2])
+     AS_VAR_COPY([$1], [pkg_cv_][$1])
+     AS_VAR_IF([$1], [""], [$5], [$4])dnl
+    ])# PKG_CHECK_VAR
+
 dnl Headers and functions
 dnl =====================
 AC_CHECK_FUNCS([mkdtemp])

History

#1 Updated by Luís Picciochi over 11 years ago

  • Target version set to 3.4

#3 Updated by Michael Schwendt over 11 years ago

This would work:

m4_ifdef([PKG_CHECK_VAR], [],
[AC_DEFUN([PKG_CHECK_VAR],
    [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
     AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
     _PKG_CONFIG([$1], [variable="][$3]["], [$2])
     AS_VAR_COPY([$1], [pkg_cv_][$1])
     AS_VAR_IF([$1], [""], [$5], [$4])dnl
    ])# PKG_CHECK_VAR
])

While at it, I just noticed there is also the AM_PATH_SIDPLAY macro, which is undefined unless the not-fully-free libsidplay2 is installed and provides it. That macro also breaks a simple autoreconf and could be wrapped into m4_ifdef([AM_PATH_SIDPLAY],[..]), but that is off-topic here. ;)

#4 Updated by Luís Picciochi over 11 years ago

I should take more attention when submitting bugs so late in the night. When I said:

Either increase the dependency on pkg-config (currently at 2.59) or don't use this macro.

I should have said:
Either declare a dependency on pkg-config >= 0.28 (somehow, I'm not sure if there's a macro for that) or don't use this macro (in which case, Michael's suggestion above should be good for backwards compatibility).

Also available in: Atom PDF