Hi All,
autogen.sh in the svn irssi-icb module produces a configure script w/
syntax errors (at least on my system, a debian sarge box). It looks
like it's due to an old check for glib. I've updated autogen.sh and
configure.in based on the files in the main irssi module. The patches
are attached.
Two new files are required for the patches to work: glib.m4_ and glib-2.0.m4_
They are also attached.
Sincerely,
Matt Dunford
Index: configure.in
===================================================================
--- configure.in (revision 3757)
+++ configure.in (working copy)
@@ -40,8 +40,108 @@
AC_ERROR(Not irssi directory: $IRSSI_INCLUDE)
fi
-AM_PATH_GLIB(1.2.0,,, gmodule)
+AC_DEFUN(AC_CHECK_GLIBDIR,[
+ AC_MSG_CHECKING([whether GLib is unpacked to irssi dir])
+ GLIB_DIR=`for d in * $IRSSI_INCLUDE/*; do test -f $d/glib.h && echo $d; done`
+ if test -n "$GLIB_DIR"; then
+ dnl * glib in irssi directory, use it
+ AC_MSG_RESULT([yes, using it])
+
+ dnl * we have to do this at this point so we know what libs gmodule needs
+ if test ! -f $GLIB_DIR/.libs/libglib.a; then
+ echo
+ echo "configuring GLib ..."
+ echo
+ cd $GLIB_DIR
+ if test ! -f glib-config; then
+ ./configure
+ fi
+ ${MAKE-make}
+ cd ..
+ echo
+ fi
+
+ GLIB_LDEXTRA=`$GLIB_DIR/glib-config --libs gmodule|$sedpath -e
's/-lglib//' -e 's/-lgmodule//' -e 's,-L/usr/local/lib ,,'|$sedpath 's/ \+/ /g'`
+ full_glib_dir="`pwd`/$GLIB_DIR"
+ GLIB_CFLAGS="-I$full_glib_dir -I$full_glib_dir/gmodule"
+ if test -f $full_glib_dir/.libs/libglib.a; then
+ GLIB_LIBS="$full_glib_dir/.libs/libglib.a $GLIB_LDEXTRA"
+ if test -f $full_glib_dir/gmodule/.libs/libgmodule.a; then
+ GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/.libs/libgmodule.a"
+ AC_DEFINE(HAVE_GMODULE)
+ have_gmodule=yes
+ fi
+ else
+ GLIB_LIBS="$full_glib_dir/libglib.a $GLIB_LDEXTRA"
+ if test -f $full_glib_dir/gmodule/libgmodule.a; then
+ GLIB_LIBS="$GLIB_LIBS $full_glib_dir/gmodule/libgmodule.a"
+ AC_DEFINE(HAVE_GMODULE)
+ have_gmodule=yes
+ fi
+ fi
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ else
+ AC_MSG_RESULT([no])
+ fi
+])
+
+AC_CHECK_GLIBDIR
+
+if test -z "$GLIB_DIR"; then
+ if test "x$with_glib1" = "xyes"; then
+ dnl * check only for glib1
+ checks="1 2"
+ else
+ dnl * check glib2 then glib1
+ checks="3 4 1 2"
+ fi
+
+ for try in $checks; do
+ glib_config_args=
+ if test $try = 1 -o $try = 3; then
+ glib_modules=gmodule
+ else
+ echo "*** trying without -lgmodule"
+ glib_modules=
+ fi
+ if test $try = 1 -o $try = 2; then
+ AM_PATH_GLIB(1.2.0,,, $glib_modules)
+ else
+ AM_PATH_GLIB_2_0(2.0.0,,, $glib_modules)
+ fi
+ if test "$GLIB_LIBS"; then
+ if test $glib_modules = gmodule; then
+ AC_DEFINE(HAVE_GMODULE)
+ have_gmodule=yes
+ fi
+ break
+ fi
+ done
+
+ if test -z "$GLIB_LIBS"; then
+ echo
+ echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
+ echo "*** If you can't install GLIB anywhere or if you don't want to,"
+ echo "*** you can just unpack it to Irssi's source directory and"
+ echo "*** Irssi will automatically compile and use it."
+ echo
+
+ dnl * I think it's pretty safe to assume GLib 1.2.9 since the next
+ dnl * will be 2.0 (or 1.4?) and it's not sure if irssi compiles
+ dnl * with it (yea, just a few weeks after I put this text for 1.2.8
+ dnl * the 1.2.9 came :) .. and then .10
+ glib_file=glib-1.2.10.tar.gz
+
+ if test -z "$GLIB_LIBS"; then
+ AC_ERROR([GLIB is required to build irssi.])
+ fi
+ fi
+fi
+
+LIBS="$LIBS $GLIB_LIBS"
+
# gcc specific options
if test "x$ac_cv_prog_gcc" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
--- autogen.sh 2005-06-06 15:20:08.166129752 -0700
+++ my.autogen.sh 2005-06-06 14:23:39.482288000 -0700
@@ -1,4 +1,122 @@
-aclocal $ACLOCAL_FLAGS
-autoheader
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+PKG_NAME="irssi-icb"
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+if test ! -f $srcdir/configure.in; then
+ echo -n "**Error**: Directory \`$srcdir\' does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+fi
+
+# get versions
+version_date=`date +%Y%m%d`
+
+echo "Checking auto* tools..."
+
+# *********** a bit modified GNOME's macros/autogen.sh **********
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+ (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run \`configure' with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo "\`$0\' command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+rm -f aclocal.m4 glib.m4 glib-2.0.m4
+if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+fi
+aclocalinclude="$ACLOCAL_FLAGS -I ."
+echo "Running aclocal $aclocalinclude ..."
+
+# see if we don't have glib.m4 or glib-2.0.m4 there yet
+error=`aclocal $aclocalinclude 2>&1`
+if test "x`echo $error|grep 'AM_PATH_GLIB[^_]'`" != "x"; then
+ cp glib.m4_ glib.m4
+ error=`aclocal $aclocalinclude 2>&1`
+fi
+if test "x`echo $error|grep AM_PATH_GLIB_2_0`" != "x"; then
+ cp glib-2.0.m4_ glib-2.0.m4
+fi
+
+aclocal $aclocalinclude
+
+# aclocal for some reason doesn't complain about glib2, so we still need
+# to check it later again..
+if grep "^AC_DEFUN.AM_PATH_GLIB_2_0" aclocal.m4 >/dev/null; then :;
+else
+ cp glib-2.0.m4_ glib-2.0.m4
+ aclocal $aclocalinclude
+fi
+
+if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+fi
+echo "Running autoconf ..."
autoconf
-automake --add-missing
+echo "Running automake --gnu $am_opt ..."
+automake --add-missing --gnu $am_opt
+
+conf_flags="" #--enable-iso-c
+
+if test x$NOCONFIGURE = x; then
+ echo Running $srcdir/configure $conf_flags "$@" ...
+ $srcdir/configure $conf_flags "$@" \
+ && echo "Now type \`make\' to compile $PKG_NAME" || exit 1
+else
+ echo "Skipping configure process."
+fi
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [,
MODULES]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
dnl gthread is specified in MODULES, pass to glib-config
dnl
AC_DEFUN(AM_PATH_GLIB,
[dnl
dnl Get the cflags and libraries from the glib-config script
dnl
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is
installed (optional)],
glib_config_prefix="$withval", glib_config_prefix="")
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where
GLIB is installed (optional)],
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and
run a test GLIB program],
, enable_glibtest=yes)
if test x$glib_config_exec_prefix != x ; then
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
fi
fi
if test x$glib_config_prefix != x ; then
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
fi
fi
for module in . $4
do
case "$module" in
gmodule)
glib_config_args="$glib_config_args gmodule"
;;
gthread)
glib_config_args="$glib_config_args gthread"
;;
esac
done
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
min_glib_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
else
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_glibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$GLIB_LIBS $LIBS"
dnl
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
dnl checks the results of glib-config to some extent
dnl
rm -f conf.glibtest
AC_TRY_RUN([
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.glibtest");
/* HP/UX 9 ([EMAIL PROTECTED]) writes to sscanf strings */
tmp_version = g_strdup("$min_glib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB
(%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version,
$glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If glib-config was correct, then it is best\n");
printf ("*** to remove the old version of GLIB. You may also be able to
fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by
editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that
is\n");
printf("*** required on your system.\n");
printf("*** If glib-config was wrong, set the environment variable
GLIB_CONFIG\n");
printf("*** to point to the correct copy of glib-config, and remove the
file config.cache\n");
printf("*** before re-running configure\n");
}
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
else
{
if ((glib_major_version > major) ||
((glib_major_version == major) && (glib_minor_version > minor)) ||
((glib_major_version == major) && (glib_minor_version == minor) &&
(glib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest
version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version,
this error\n");
printf("*** probably means that the wrong copy of the glib-config shell
script is\n");
printf("*** being found. The easiest way to fix this is to remove the
old version\n");
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment
to point to the\n");
printf("*** correct copy of glib-config. (In this case, you will have
to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit
/etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GLIB_CONFIG" = "no" ; then
echo "*** The glib-config script installed by GLIB could not be found"
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
echo "*** full path to glib-config."
else
if test -f conf.glibtest ; then
:
else
echo "*** Could not run GLIB test program, checking why..."
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
#include <glib.h>
#include <stdio.h>
], [ return ((glib_major_version) || (glib_minor_version) ||
(glib_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually
means"
echo "*** that the run-time linker is not finding GLIB or finding the
wrong"
echo "*** version of GLIB. If it is not finding GLIB, you'll need to
set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit
/etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run
ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove
it, although"
echo "*** you may also be able to get things to work by modifying
LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK
package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file
config.log for the"
echo "*** exact error that occured. This usually means GLIB was
incorrectly installed"
echo "*** or that you have moved GLIB since it was installed. In the
latter case, you"
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GLIB_CFLAGS=""
GLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
rm -f conf.glibtest
])
# Configure paths for GLIB
# Owen Taylor 1997-2001
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
[, MODULES]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
dnl gthread is specified in MODULES, pass to pkg-config
dnl
AC_DEFUN(AM_PATH_GLIB_2_0,
[dnl
dnl Get the cflags and libraries from pkg-config
dnl
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and
run a test GLIB program],
, enable_glibtest=yes)
pkg_config_args=glib-2.0
for module in . $4
do
case "$module" in
gmodule)
pkg_config_args="$pkg_config_args gmodule-2.0"
;;
gobject)
pkg_config_args="$pkg_config_args gobject-2.0"
;;
gthread)
pkg_config_args="$pkg_config_args gthread-2.0"
;;
esac
done
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
no_glib=""
if test x$PKG_CONFIG != xno ; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
:
else
echo *** pkg-config too old; version 0.7 or better required.
no_glib=yes
PKG_CONFIG=no
fi
else
no_glib=yes
fi
min_glib_version=ifelse([$1], ,2.0.0,$1)
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
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
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
enable_glibtest=no
fi
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
:
else
no_glib=yes
fi
fi
if test x"$no_glib" = x ; then
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_glibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$GLIB_LIBS $LIBS"
dnl
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
dnl checks the results of pkg-config to some extent)
dnl
rm -f conf.glibtest
AC_TRY_RUN([
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.glibtest");
/* HP/UX 9 ([EMAIL PROTECTED]) writes to sscanf strings */
tmp_version = g_strdup("$min_glib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but
GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version,
$glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
printf ("*** to remove the old version of GLib. You may also be able to
fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by
editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that
is\n");
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 ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
else
{
if ((glib_major_version > major) ||
((glib_major_version == major) && (glib_minor_version > minor)) ||
((glib_major_version == major) && (glib_minor_version == minor) &&
(glib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest
version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version,
this error\n");
printf("*** probably means that the wrong copy of the pkg-config shell
script is\n");
printf("*** being found. The easiest way to fix this is to remove the
old version\n");
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to
point to the\n");
printf("*** correct copy of pkg-config. (In this case, you will have
to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit
/etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes (version
$glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$PKG_CONFIG" = "no" ; then
echo "*** A new enough version of pkg-config was not found."
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
else
if test -f conf.glibtest ; then
:
else
echo "*** Could not run GLIB test program, checking why..."
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
#include <glib.h>
#include <stdio.h>
], [ return ((glib_major_version) || (glib_minor_version) ||
(glib_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually
means"
echo "*** that the run-time linker is not finding GLIB or finding the
wrong"
echo "*** version of GLIB. If it is not finding GLIB, you'll need to
set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit
/etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run
ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove
it, although"
echo "*** you may also be able to get things to work by modifying
LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file
config.log for the"
echo "*** exact error that occured. This usually means GLIB was
incorrectly installed"
echo "*** or that you have moved GLIB since it was installed. In the
latter case, you"
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GLIB_CFLAGS=""
GLIB_LIBS=""
GLIB_GENMARSHAL=""
GOBJECT_QUERY=""
GLIB_MKENUMS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_GENMARSHAL)
AC_SUBST(GOBJECT_QUERY)
AC_SUBST(GLIB_MKENUMS)
rm -f conf.glibtest
])