[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r35735 - in trunk: . build/ac-macros

From: Greg Stein <gstein_at_gmail.com>
Date: Sun, 8 Feb 2009 12:37:33 -0800

If pkg-config is installed on the developer's machine, then
PKG_CHECK_MODULES() should be available for looking for packages. I
ran into this macro in Apache Thrift. Installing pkg-config on my
laptop enabled the macro (found by libtool or something).

I'd recommend we switch to use this "proper" macro. However, it *does*
mean that our developers grow a dependency.

Cheers,
-g

On Sat, Feb 7, 2009 at 12:46, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
> Author: arfrever
> Date: Sat Feb 7 12:46:30 2009
> New Revision: 35735
>
> Log:
> Search for pkg-config only once and use pkg-config found by AC_PATH_PROG.
>
> * configure.ac
> (pkg-config): Use AC_PATH_PROG to find pkg-config and store the path to
> pkg-config in PKG_CONFIG variable.
> (D-Bus, GNOME Keyring): Use PKG_CONFIG variable.
>
> * build/ac-macros/kwallet.m4
> (SVN_LIB_KWALLET):
> * build/ac-macros/neon.m4
> (SVN_LIB_NEON, SVN_NEON_CONFIG):
> * build/ac-macros/sqlite.m4
> (SVN_SQLITE_PKG_CONFIG): Use PKG_CONFIG variable.
>
> Modified:
> trunk/build/ac-macros/kwallet.m4
> trunk/build/ac-macros/neon.m4
> trunk/build/ac-macros/sqlite.m4
> trunk/configure.ac
>
> Modified: trunk/build/ac-macros/kwallet.m4
> URL: http://svn.collab.net/viewvc/svn/trunk/build/ac-macros/kwallet.m4?pathrev=35735&r1=35734&r2=35735
> ==============================================================================
> --- trunk/build/ac-macros/kwallet.m4 Sat Feb 7 05:36:53 2009 (r35734)
> +++ trunk/build/ac-macros/kwallet.m4 Sat Feb 7 12:46:30 2009 (r35735)
> @@ -18,10 +18,10 @@ AC_DEFUN(SVN_LIB_KWALLET,
> if test "$enable_shared" = "yes"; then
> if test "$APR_HAS_DSO" = "yes"; then
> if test "$USE_NLS" = "yes"; then
> - if test "$HAVE_PKG_CONFIG" = "yes"; then
> + if test -n "$PKG_CONFIG"; then
> if test "$HAVE_DBUS" = "yes"; then
> AC_MSG_CHECKING([for QtCore, QtDBus, QtGui])
> - if pkg-config --exists QtCore QtDBus QtGui; then
> + if $PKG_CONFIG --exists QtCore QtDBus QtGui; then
> AC_MSG_RESULT([yes])
> if test "$svn_lib_kwallet" != "yes"; then
> AC_MSG_CHECKING([for kde4-config])
> @@ -41,17 +41,17 @@ AC_DEFUN(SVN_LIB_KWALLET,
> old_CXXFLAGS="$CXXFLAGS"
> old_LDFLAGS="$LDFLAGS"
> old_LIBS="$LIBS"
> - for d in [`pkg-config --cflags QtCore QtDBus QtGui | $GREP -o -- -D[^[:space:]]*`]; do
> + for d in [`$PKG_CONFIG --cflags QtCore QtDBus QtGui | $GREP -o -- -D[^[:space:]]*`]; do
> CPPFLAGS="$CPPFLAGS $d"
> done
> - qt_include_dirs="`pkg-config --cflags-only-I QtCore QtDBus QtGui`"
> + qt_include_dirs="`$PKG_CONFIG --cflags-only-I QtCore QtDBus QtGui`"
> kde_dir="`$kde4_config --prefix`"
> SVN_KWALLET_INCLUDES="$DBUS_CPPFLAGS $qt_include_dirs -I$kde_dir/include"
> - qt_libs_other_options="`pkg-config --libs-only-other QtCore QtDBus QtGui`"
> + qt_libs_other_options="`$PKG_CONFIG --libs-only-other QtCore QtDBus QtGui`"
> SVN_KWALLET_LIBS="$DBUS_LIBS -lQtCore -lQtDBus -lQtGui -lkdecore -lkdeui $qt_libs_other_options"
> CXXFLAGS="$CXXFLAGS $SVN_KWALLET_INCLUDES"
> LIBS="$LIBS $SVN_KWALLET_LIBS"
> - qt_lib_dirs="`pkg-config --libs-only-L QtCore QtDBus QtGui`"
> + qt_lib_dirs="`$PKG_CONFIG --libs-only-L QtCore QtDBus QtGui`"
> LDFLAGS="$old_LDFLAGS $qt_lib_dirs -L$kde_dir/lib`$kde4_config --libsuffix`"
> AC_LANG(C++)
> AC_LINK_IFELSE([
>
> Modified: trunk/build/ac-macros/neon.m4
> URL: http://svn.collab.net/viewvc/svn/trunk/build/ac-macros/neon.m4?pathrev=35735&r1=35734&r2=35735
> ==============================================================================
> --- trunk/build/ac-macros/neon.m4 Sat Feb 7 05:36:53 2009 (r35734)
> +++ trunk/build/ac-macros/neon.m4 Sat Feb 7 12:46:30 2009 (r35735)
> @@ -36,7 +36,7 @@ AC_DEFUN(SVN_LIB_NEON,
> look for neon-config in $PATH.]),
> [
> if test "$withval" = "yes" ; then
> - if test "$HAVE_PKG_CONFIG" = "yes" && pkg-config neon --exists ; then
> + if test -n "$PKG_CONFIG" && $PKG_CONFIG neon --exists ; then
> NEON_PKG_CONFIG="yes"
> else
> AC_MSG_ERROR([--with-neon requires an argument.])
> @@ -117,7 +117,7 @@ dnl Configure neon ---------------------
>
> else
> # no --with-neon switch, and no neon subdir, look in PATH
> - if test "$HAVE_PKG_CONFIG" = "yes" && pkg-config neon --exists ; then
> + if test -n "$PKG_CONFIG" && $PKG_CONFIG neon --exists ; then
> NEON_PKG_CONFIG="yes"
> else
> AC_PATH_PROG(neon_config,neon-config)
> @@ -139,7 +139,7 @@ AC_DEFUN(SVN_NEON_CONFIG,
> if test "$NEON_PKG_CONFIG" = "yes" || test "$neon_config" != ""; then
> AC_MSG_CHECKING([neon library version])
> if test "$NEON_PKG_CONFIG" = "yes" ; then
> - NEON_VERSION=`pkg-config neon --modversion`
> + NEON_VERSION=`$PKG_CONFIG neon --modversion`
> else
> NEON_VERSION=`$neon_config --version | sed -e 's/^neon //'`
> fi
> @@ -165,11 +165,11 @@ AC_DEFUN(SVN_NEON_CONFIG,
> test "$svn_allowed_neon" = "any"; then
> svn_allowed_neon_on_system="yes"
> if test "$NEON_PKG_CONFIG" = "yes"; then
> - SVN_NEON_INCLUDES=[`pkg-config neon --cflags | sed -e 's/-D[^ ]*//g'`]
> - CFLAGS=["$CFLAGS `pkg-config neon --cflags | sed -e 's/-I[^ ]*//g'`"]
> + SVN_NEON_INCLUDES=[`$PKG_CONFIG neon --cflags | sed -e 's/-D[^ ]*//g'`]
> + CFLAGS=["$CFLAGS `$PKG_CONFIG neon --cflags | sed -e 's/-I[^ ]*//g'`"]
> old_CFLAGS="$CFLAGS"
> old_LIBS="$LIBS"
> - NEON_LIBS=`pkg-config neon --libs`
> + NEON_LIBS=`$PKG_CONFIG neon --libs`
> CFLAGS="$CFLAGS $SVN_NEON_INCLUDES"
> LIBS="$LIBS $NEON_LIBS"
> neon_test_code="
> @@ -179,7 +179,7 @@ int main()
> {ne_xml_create(); ne_decompress_destroy(NULL);}"
> AC_LINK_IFELSE([$neon_test_code], shared_linking="yes", shared_linking="no")
> if test "$shared_linking" = "no"; then
> - NEON_LIBS=`pkg-config neon --libs --static`
> + NEON_LIBS=`$PKG_CONFIG neon --libs --static`
> LIBS="$LIBS $NEON_LIBS"
> AC_LINK_IFELSE([$neon_test_code], , AC_MSG_ERROR([cannot find Neon]))
> fi
>
> Modified: trunk/build/ac-macros/sqlite.m4
> URL: http://svn.collab.net/viewvc/svn/trunk/build/ac-macros/sqlite.m4?pathrev=35735&r1=35734&r2=35735
> ==============================================================================
> --- trunk/build/ac-macros/sqlite.m4 Sat Feb 7 05:36:53 2009 (r35734)
> +++ trunk/build/ac-macros/sqlite.m4 Sat Feb 7 12:46:30 2009 (r35735)
> @@ -82,10 +82,9 @@ dnl
> dnl Look for sqlite in PATH using pkg-config.
> AC_DEFUN(SVN_SQLITE_PKG_CONFIG,
> [
> - AC_PATH_PROG(pkg_config,pkg-config)
> - if test -x "$pkg_config"; then
> + if test -n "$PKG_CONFIG"; then
> AC_MSG_CHECKING([sqlite library version (via pkg-config)])
> - sqlite_version=`$pkg_config $SQLITE_PKGNAME --modversion --silence-errors`
> + sqlite_version=`$PKG_CONFIG $SQLITE_PKGNAME --modversion --silence-errors`
>
> if test -n "$sqlite_version"; then
> SVN_SQLITE_VERNUM_PARSE
> @@ -93,8 +92,8 @@ AC_DEFUN(SVN_SQLITE_PKG_CONFIG,
> if test "$sqlite_ver_num" -ge "$sqlite_min_ver_num"; then
> AC_MSG_RESULT([$sqlite_version])
> svn_lib_sqlite="yes"
> - SVN_SQLITE_INCLUDES="`$pkg_config $SQLITE_PKGNAME --cflags`"
> - SVN_SQLITE_LIBS="`$pkg_config $SQLITE_PKGNAME --libs`"
> + SVN_SQLITE_INCLUDES="`$PKG_CONFIG $SQLITE_PKGNAME --cflags`"
> + SVN_SQLITE_LIBS="`$PKG_CONFIG $SQLITE_PKGNAME --libs`"
> else
> AC_MSG_RESULT([none or unsupported $sqlite_version])
> fi
>
> Modified: trunk/configure.ac
> URL: http://svn.collab.net/viewvc/svn/trunk/configure.ac?pathrev=35735&r1=35734&r2=35735
> ==============================================================================
> --- trunk/configure.ac Sat Feb 7 05:36:53 2009 (r35734)
> +++ trunk/configure.ac Sat Feb 7 12:46:30 2009 (r35735)
> @@ -75,7 +75,7 @@ SVN_LIB_APR($APR_VER_REGEXES)
> SVN_LIB_APRUTIL($APU_VER_REGEXES)
>
> dnl Search for pkg-config
> -AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
> +AC_PATH_PROG(PKG_CONFIG, pkg-config)
>
> # Either a space-separated list of allowable Neon versions, or "any" to
> # mean allow anything.
> @@ -340,21 +340,21 @@ CPPFLAGS="$old_CPPFLAGS"
>
> dnl D-Bus (required for support for KWallet and GNOME Keyring) -------------------
>
> -if test "$HAVE_PKG_CONFIG" = "yes"; then
> +if test -n "$PKG_CONFIG"; then
> AC_MSG_CHECKING([for D-Bus .pc file])
> - if pkg-config --exists dbus-1; then
> + if $PKG_CONFIG --exists dbus-1; then
> AC_MSG_RESULT([yes])
> old_CPPFLAGS="$CPPFLAGS"
> old_LIBS="$LIBS"
> - DBUS_CPPFLAGS="`pkg-config --cflags dbus-1`"
> + DBUS_CPPFLAGS="`$PKG_CONFIG --cflags dbus-1`"
> AC_MSG_CHECKING([D-Bus version])
> - DBUS_VERSION="`pkg-config --modversion dbus-1`"
> + DBUS_VERSION="`$PKG_CONFIG --modversion dbus-1`"
> AC_MSG_RESULT([$DBUS_VERSION])
> # D-Bus 0.* requires DBUS_API_SUBJECT_TO_CHANGE
> if test -n ["`echo "$DBUS_VERSION" | $GREP '^0\.[[:digit:]]\+'`"]; then
> DBUS_CPPFLAGS="$DBUS_CPPFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
> fi
> - DBUS_LIBS="`pkg-config --libs dbus-1`"
> + DBUS_LIBS="`$PKG_CONFIG --libs dbus-1`"
> CPPFLAGS="$CPPFLAGS $DBUS_CPPFLAGS"
> LIBS="$LIBS $DBUS_LIBS"
> AC_MSG_CHECKING([for D-Bus])
> @@ -387,13 +387,13 @@ if test "$with_gnome_keyring" != "no"; t
> AC_MSG_RESULT([yes])
> if test "$enable_shared" = "yes"; then
> if test "$APR_HAS_DSO" = "yes"; then
> - if test "$HAVE_PKG_CONFIG" = "yes"; then
> + if test -n "$PKG_CONFIG"; then
> if test "$HAVE_DBUS" = "yes"; then
> AC_MSG_CHECKING([for GLib and GNOME Keyring .pc files])
> - if pkg-config --exists glib-2.0 gnome-keyring-1; then
> + if $PKG_CONFIG --exists glib-2.0 gnome-keyring-1; then
> AC_MSG_RESULT([yes])
> old_CPPFLAGS="$CPPFLAGS"
> - SVN_GNOME_KEYRING_INCLUDES="$DBUS_CPPFLAGS `pkg-config --cflags glib-2.0 gnome-keyring-1`"
> + SVN_GNOME_KEYRING_INCLUDES="$DBUS_CPPFLAGS `$PKG_CONFIG --cflags glib-2.0 gnome-keyring-1`"
> CPPFLAGS="$CPPFLAGS $SVN_GNOME_KEYRING_INCLUDES"
> AC_CHECK_HEADER(gnome-keyring.h, with_gnome_keyring=yes, with_gnome_keyring=no)
> AC_MSG_CHECKING([for GNOME Keyring])
> @@ -402,7 +402,7 @@ if test "$with_gnome_keyring" != "no"; t
> AC_DEFINE([SVN_HAVE_GNOME_KEYRING], [1],
> [Is GNOME Keyring support enabled?])
> CPPFLAGS="$old_CPPFLAGS"
> - SVN_GNOME_KEYRING_LIBS="$DBUS_LIBS `pkg-config --libs glib-2.0 gnome-keyring-1`"
> + SVN_GNOME_KEYRING_LIBS="$DBUS_LIBS `$PKG_CONFIG --libs glib-2.0 gnome-keyring-1`"
> else
> AC_MSG_RESULT([no])
> AC_MSG_ERROR([cannot find GNOME Keyring])
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1120658
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1125480
Received on 2009-02-08 21:37:48 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.