Use a variable for the package name we're querying.

Add SVN Id.

svn path=/trunk/; revision=47538
This commit is contained in:
Jeff Morriss 2013-02-07 20:58:45 +00:00
parent 8a6b4d596d
commit 5f101234d6
3 changed files with 31 additions and 29 deletions

View File

@ -1,5 +1,6 @@
# Configure paths for GTK+
# Owen Taylor 1997-2001
# $Id$
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
@ -12,7 +13,7 @@ dnl
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
, enable_gtktest=yes)
pkg_config_args=gtk+-2.0
pkg_config_module=gtk+-2.0
for module in . $4
do
# No modules to check for now
@ -40,12 +41,12 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
if $PKG_CONFIG --uninstalled $pkg_config_args; then
if $PKG_CONFIG --uninstalled $pkg_config_module; then
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
enable_gtktest=no
fi
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_module; then
:
else
no_gtk=yes
@ -53,13 +54,13 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
fi
if test x"$no_gtk" = x ; then
GTK_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
GTK_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
GTK_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_module`
GTK_LIBS=`$PKG_CONFIG --libs $pkg_config_module`
gtk_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
gtk_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
gtk_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
@ -95,7 +96,7 @@ main ()
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
printf("\n*** 'pkg-config --modversion $pkg_config_module' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");

View File

@ -1,18 +1,19 @@
# Configure paths for GTK+
# Owen Taylor 1997-2001
# $Id$
dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
dnl pass to pkg-config
dnl
AC_DEFUN([AM_PATH_GTK_3_0],
[dnl
[dnl
dnl Get the cflags and libraries from pkg-config
dnl
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
, enable_gtktest=yes)
pkg_config_args=gtk+-3.0
pkg_config_module=gtk+-3.0
for module in . $4
do
# No modules to check for now
@ -40,12 +41,12 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
if $PKG_CONFIG --uninstalled $pkg_config_args; then
if $PKG_CONFIG --uninstalled $pkg_config_module; then
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
enable_gtktest=no
fi
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_module; then
:
else
no_gtk=yes
@ -53,13 +54,13 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
fi
if test x"$no_gtk" = x ; then
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_module --cflags`
GTK_LIBS=`$PKG_CONFIG $pkg_config_module --libs`
gtk_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
gtk_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
gtk_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
@ -76,7 +77,7 @@ dnl
#include <stdio.h>
#include <stdlib.h>
int
int
main ()
{
int major, minor, micro;
@ -95,7 +96,7 @@ main ()
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
printf("\n*** 'pkg-config --modversion $pkg_config_module' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
@ -105,7 +106,7 @@ main ()
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
}
}
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))

View File

@ -8,7 +8,7 @@ dnl
AC_DEFUN([AM_PATH_QT],
[
pkg_config_args=Qt
pkg_config_module=Qt
no_qt=""
@ -30,16 +30,16 @@ AC_DEFUN([AM_PATH_QT],
AC_MSG_CHECKING(for Qt - version >= $min_qt_version)
if test x"$no_qt" = x ; then
QT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
QT_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_args | \
QT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_module`
QT_LIBS=`$PKG_CONFIG --libs $pkg_config_module`
qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_args | \
qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_args | \
qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_args; then
if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_module; then
:
else
no_qt=yes