configure.in | 164 +++++++++++------------------------------------------------
1 file changed, 31 insertions(+), 133 deletions(-)
New commits:
commit bb02899d9ff9813738809fb5349a9f3ae2dba76f
Author: Akira TAGOH <akira at tagoh.org>
Date: Mon Apr 2 15:38:27 2012 +0900
Use pkgconfig to check builddeps
diff --git a/configure.in b/configure.in
index 55b0d85..7637c02 100644
--- a/configure.in
+++ b/configure.in
@@ -63,6 +63,7 @@ AC_PROG_LN_S
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
+PKG_PROG_PKG_CONFIG
AC_MSG_CHECKING([for RM macro])
_predefined_rm=`make -p -f /dev/null 2>/dev/null|grep ''^RM
=''|sed -e ''s/^RM = //''`
@@ -170,24 +171,7 @@ AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.])
#
# Checks for FreeType
#
-
-AC_ARG_WITH(freetype-config,
- [AC_HELP_STRING([--with-freetype-config=PROG],
- [Use FreeType configuration program PROG])],
- freetype_config=$withval,
- freetype_config=yes)
-
-if test "$freetype_config" = "yes"; then
- AC_PATH_PROG(ft_config,freetype-config,no)
- if test "$ft_config" = "no"; then
- AC_MSG_ERROR([You must have freetype installed; see
http://www.freetype.org/])
- fi
-else
- ft_config="$freetype_config"
-fi
-
-FREETYPE_CFLAGS="`$ft_config --cflags`"
-FREETYPE_LIBS="`$ft_config --libs`"
+PKG_CHECK_MODULES(FREETYPE, freetype2)
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
@@ -210,134 +194,48 @@ LIBS="$fontconfig_save_libs"
#
# Check expat configuration
#
-
-AC_ARG_WITH(expat,
- [AC_HELP_STRING([--with-expat=DIR],
- [Use Expat in DIR])],
- expat=$withval, expat=yes)
-AC_ARG_WITH(expat-includes,
- [AC_HELP_STRING([--with-expat-includes=DIR],
- [Use Expat includes in DIR])],
- expat_includes=$withval, expat_includes=yes)
-AC_ARG_WITH(expat-lib,
- [AC_HELP_STRING([--with-expat-lib=DIR],
- [Use Expat library in DIR])],
- expat_lib=$withval, expat_lib=yes)
-
if test "$enable_libxml2" != "yes"; then
- case "$expat" in
- no)
- ;;
- *)
- case "$expat_includes" in
- yes)
- case "$expat" in
- yes)
- ;;
- *)
- EXPAT_CFLAGS="-I$expat/include"
- ;;
- esac
- ;;
- no)
- EXPAT_CFLAGS=""
- ;;
- *)
- EXPAT_CFLAGS="-I$expat_includes"
- ;;
- esac
- case "$expat_lib" in
- yes)
- case "$expat" in
- yes)
- EXPAT_LIBS="-lexpat"
- ;;
- *)
- EXPAT_LIBS="-L$expat/lib -lexpat"
- ;;
- esac
- ;;
- no)
- ;;
- *)
- EXPAT_LIBS="-L$expat_lib -lexpat"
- ;;
- esac
-
- expatsaved_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"
- expatsaved_LIBS="$LIBS"
- LIBS="$LIBS $EXPAT_LIBS"
-
- AC_CHECK_HEADER(expat.h)
- case "$ac_cv_header_expat_h" in
- no)
- AC_CHECK_HEADER(xmlparse.h)
- case "$ac_cv_header_xmlparse_h" in
- no)
- have_expat_header=no;
- ;;
- yes)
- HAVE_XMLPARSE_H=1
- AC_SUBST(HAVE_XMLPARSE_H)
- AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H,
+ # specify EXPAT_CFLAGS and/or EXPAT_LIBS if you like the old behavior
+ # with --with-expat-includes and --with-expat-lib.
+ PKG_CHECK_MODULES(EXPAT, expat)
+ expatsaved_CPPFLAGS="$CPPFLAGS"
+ expatsaved_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"
+ LIBS="$LIBS $EXPAT_LIBS"
+
+ AC_CHECK_HEADER(expat.h)
+ if test "$ac_cv_header_expat_h" = "no"; then
+ AC_CHECK_HEADER(xmlparse.h)
+ if test "$ac_cv_header_xmlparse_h" = "yes"; then
+ HAVE_XMLPARSE_H=1
+ AC_SUBST(HAVE_XMLPARSE_H)
+ AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H,
[Use xmlparse.h instead of expat.h])
- have_expat_header=yes
- ;;
- esac
- ;;
- yes)
- have_expat_header=yes
- ;;
- esac
- case "$have_expat_header" in
- no)
- expat=no
- ;;
- yes)
- AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler)
- case "$ac_cv_func_XML_SetDoctypeDeclHandler" in
- yes)
- HAVE_EXPAT=1
- AC_SUBST(HAVE_EXPAT)
- AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT,
- [Found a useable expat library])
- ;;
- *)
- expat=no
- ;;
- esac
- ;;
- esac
- CPPFLAGS="$expatsaved_CPPFLAGS"
- LIBS="$expatsaved_LIBS"
- ;;
- esac
-
+ else
+ AC_MSG_ERROR([
+*** expat is required. or try to use --enable-libxml2])
+ fi
+ fi
+ AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler)
+ if test "$ac_cv_func_XML_SetDoctypeDeclHandler" = "no";
then
+ AC_MSG_ERROR([
+*** expat is required. or try to use --enable-libxml2])
+ fi
+ CPPFLAGS="$expatsaved_CPPFLAGS"
+ LIBS="$expatsaved_LIBS"
+
AC_SUBST(EXPAT_CFLAGS)
AC_SUBST(EXPAT_LIBS)
-
- case "$expat" in
- no)
- EXPAT_CFLAGS=""
- EXPAT_LIBS=""
-
- AC_MSG_WARN([Cannot find usable expat library. Trying to use libxml2 as
fallback.])
- ;;
- esac
fi
#
# Check libxml2 configuration
#
-
AC_ARG_ENABLE(libxml2,
[AC_HELP_STRING([--enable-libxml2],
[Use libxml2 instead of Expat])])
-PKG_PROG_PKG_CONFIG
-
-if test "$enable_libxml2" = "yes" -o "$expat" =
"no"; then
+if test "$enable_libxml2" = "yes"; then
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6])
AC_DEFINE_UNQUOTED(ENABLE_LIBXML2,1,[Use libxml2 instead of Expat])
This caused tinderbox to fail: http://tinderbox.x.org/builds/2012-04-03-0002/ I think expat did not start providing a .pc file until 2.1.0, which is still in beta. Please revert the expat portion of this change. On Apr 1, 2012, at 11:40 PM, Akira TAGOH <tagoh at kemper.freedesktop.org> wrote:> configure.in | 164 +++++++++++------------------------------------------------ > 1 file changed, 31 insertions(+), 133 deletions(-) > > New commits: > commit bb02899d9ff9813738809fb5349a9f3ae2dba76f > Author: Akira TAGOH <akira at tagoh.org> > Date: Mon Apr 2 15:38:27 2012 +0900 > > Use pkgconfig to check builddeps > > diff --git a/configure.in b/configure.in > index 55b0d85..7637c02 100644 > --- a/configure.in > +++ b/configure.in > @@ -63,6 +63,7 @@ AC_PROG_LN_S > AC_LIBTOOL_WIN32_DLL > AM_PROG_LIBTOOL > AC_PROG_MAKE_SET > +PKG_PROG_PKG_CONFIG > > AC_MSG_CHECKING([for RM macro]) > _predefined_rm=`make -p -f /dev/null 2>/dev/null|grep ''^RM =''|sed -e ''s/^RM = //''` > @@ -170,24 +171,7 @@ AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.]) > # > # Checks for FreeType > # > - > -AC_ARG_WITH(freetype-config, > - [AC_HELP_STRING([--with-freetype-config=PROG], > - [Use FreeType configuration program PROG])], > - freetype_config=$withval, > - freetype_config=yes) > - > -if test "$freetype_config" = "yes"; then > - AC_PATH_PROG(ft_config,freetype-config,no) > - if test "$ft_config" = "no"; then > - AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/]) > - fi > -else > - ft_config="$freetype_config" > -fi > - > -FREETYPE_CFLAGS="`$ft_config --cflags`" > -FREETYPE_LIBS="`$ft_config --libs`" > +PKG_CHECK_MODULES(FREETYPE, freetype2) > > AC_SUBST(FREETYPE_LIBS) > AC_SUBST(FREETYPE_CFLAGS) > @@ -210,134 +194,48 @@ LIBS="$fontconfig_save_libs" > # > # Check expat configuration > # > - > -AC_ARG_WITH(expat, > - [AC_HELP_STRING([--with-expat=DIR], > - [Use Expat in DIR])], > - expat=$withval, expat=yes) > -AC_ARG_WITH(expat-includes, > - [AC_HELP_STRING([--with-expat-includes=DIR], > - [Use Expat includes in DIR])], > - expat_includes=$withval, expat_includes=yes) > -AC_ARG_WITH(expat-lib, > - [AC_HELP_STRING([--with-expat-lib=DIR], > - [Use Expat library in DIR])], > - expat_lib=$withval, expat_lib=yes) > - > if test "$enable_libxml2" != "yes"; then > - case "$expat" in > - no) > - ;; > - *) > - case "$expat_includes" in > - yes) > - case "$expat" in > - yes) > - ;; > - *) > - EXPAT_CFLAGS="-I$expat/include" > - ;; > - esac > - ;; > - no) > - EXPAT_CFLAGS="" > - ;; > - *) > - EXPAT_CFLAGS="-I$expat_includes" > - ;; > - esac > - case "$expat_lib" in > - yes) > - case "$expat" in > - yes) > - EXPAT_LIBS="-lexpat" > - ;; > - *) > - EXPAT_LIBS="-L$expat/lib -lexpat" > - ;; > - esac > - ;; > - no) > - ;; > - *) > - EXPAT_LIBS="-L$expat_lib -lexpat" > - ;; > - esac > - > - expatsaved_CPPFLAGS="$CPPFLAGS" > - CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" > - expatsaved_LIBS="$LIBS" > - LIBS="$LIBS $EXPAT_LIBS" > - > - AC_CHECK_HEADER(expat.h) > - case "$ac_cv_header_expat_h" in > - no) > - AC_CHECK_HEADER(xmlparse.h) > - case "$ac_cv_header_xmlparse_h" in > - no) > - have_expat_header=no; > - ;; > - yes) > - HAVE_XMLPARSE_H=1 > - AC_SUBST(HAVE_XMLPARSE_H) > - AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, > + # specify EXPAT_CFLAGS and/or EXPAT_LIBS if you like the old behavior > + # with --with-expat-includes and --with-expat-lib. > + PKG_CHECK_MODULES(EXPAT, expat) > + expatsaved_CPPFLAGS="$CPPFLAGS" > + expatsaved_LIBS="$LIBS" > + CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" > + LIBS="$LIBS $EXPAT_LIBS" > + > + AC_CHECK_HEADER(expat.h) > + if test "$ac_cv_header_expat_h" = "no"; then > + AC_CHECK_HEADER(xmlparse.h) > + if test "$ac_cv_header_xmlparse_h" = "yes"; then > + HAVE_XMLPARSE_H=1 > + AC_SUBST(HAVE_XMLPARSE_H) > + AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, > [Use xmlparse.h instead of expat.h]) > - have_expat_header=yes > - ;; > - esac > - ;; > - yes) > - have_expat_header=yes > - ;; > - esac > - case "$have_expat_header" in > - no) > - expat=no > - ;; > - yes) > - AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler) > - case "$ac_cv_func_XML_SetDoctypeDeclHandler" in > - yes) > - HAVE_EXPAT=1 > - AC_SUBST(HAVE_EXPAT) > - AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT, > - [Found a useable expat library]) > - ;; > - *) > - expat=no > - ;; > - esac > - ;; > - esac > - CPPFLAGS="$expatsaved_CPPFLAGS" > - LIBS="$expatsaved_LIBS" > - ;; > - esac > - > + else > + AC_MSG_ERROR([ > +*** expat is required. or try to use --enable-libxml2]) > + fi > + fi > + AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler) > + if test "$ac_cv_func_XML_SetDoctypeDeclHandler" = "no"; then > + AC_MSG_ERROR([ > +*** expat is required. or try to use --enable-libxml2]) > + fi > + CPPFLAGS="$expatsaved_CPPFLAGS" > + LIBS="$expatsaved_LIBS" > + > AC_SUBST(EXPAT_CFLAGS) > AC_SUBST(EXPAT_LIBS) > - > - case "$expat" in > - no) > - EXPAT_CFLAGS="" > - EXPAT_LIBS="" > - > - AC_MSG_WARN([Cannot find usable expat library. Trying to use libxml2 as fallback.]) > - ;; > - esac > fi > > # > # Check libxml2 configuration > # > - > AC_ARG_ENABLE(libxml2, > [AC_HELP_STRING([--enable-libxml2], > [Use libxml2 instead of Expat])]) > > -PKG_PROG_PKG_CONFIG > - > -if test "$enable_libxml2" = "yes" -o "$expat" = "no"; then > +if test "$enable_libxml2" = "yes"; then > PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6]) > AC_DEFINE_UNQUOTED(ENABLE_LIBXML2,1,[Use libxml2 instead of Expat]) > > _______________________________________________ > Fontconfig mailing list > Fontconfig at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/fontconfig >
On Fri, Apr 13, 2012 at 3:22 AM, Jeremy Huddleston <jeremyhu at freedesktop.org> wrote:> This caused tinderbox to fail: > http://tinderbox.x.org/builds/2012-04-03-0002/ > > I think expat did not start providing a .pc file until 2.1.0, which is still in beta. ?Please revert the expat portion of this change.Hmm, sure. though you could still do "configure EXPAT_CFLAGS=-I/usr/include EXPAT_LIBS=-lexpat" to avoid that. I don''t see so much difference compared to --with-expat, --with-expat-includes and --with-expat-lib. -- Akira TAGOH
On Apr 12, 2012, at 18:40, Akira TAGOH wrote:> On Fri, Apr 13, 2012 at 3:22 AM, Jeremy Huddleston > <jeremyhu at freedesktop.org> wrote: >> This caused tinderbox to fail: >> http://tinderbox.x.org/builds/2012-04-03-0002/ >> >> I think expat did not start providing a .pc file until 2.1.0, which is still in beta. Please revert the expat portion of this change. > > Hmm, sure. though you could still do "configure > EXPAT_CFLAGS=-I/usr/include EXPAT_LIBS=-lexpat" to avoid that. I don''t > see so much difference compared to --with-expat, --with-expat-includes > and --with-expat-lib.You''re right, I could pass in those environment variables to work around this, but that still represents a regression. Previously, libexpat was found automagically (without needing the --with* arguments).
On Thursday 12 April 2012 14:22:31 Jeremy Huddleston wrote:> This caused tinderbox to fail: > http://tinderbox.x.org/builds/2012-04-03-0002/ > > I think expat did not start providing a .pc file until 2.1.0, which is > still in beta. Please revert the expat portion of this change.moving to pkg-config is a great thing. i can understand if the fallback logic of the PKG macro calls included running older xxx-config scripts, but restoring that great glob of build crap to support older versions seems like a step backwards. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120412/162999e5/attachment-0001.pgp>
On Fri, Apr 13, 2012 at 10:55 AM, Jeremy Huddleston <jeremyhu at freedesktop.org> wrote:> You''re right, I could pass in those environment variables to work around this, but that still represents a regression. ?Previously, libexpat was found automagically (without needing the --with* arguments).That''s true. will add it back and keep them bit. Thanks, -- Akira TAGOH
On Apr 12, 2012, at 7:00 PM, Mike Frysinger <vapier at gentoo.org> wrote:> On Thursday 12 April 2012 14:22:31 Jeremy Huddleston wrote: >> This caused tinderbox to fail: >> http://tinderbox.x.org/builds/2012-04-03-0002/ >> >> I think expat did not start providing a .pc file until 2.1.0, which is >> still in beta. Please revert the expat portion of this change. > > moving to pkg-config is a great thing. i can understand if the fallback logic > of the PKG macro calls included running older xxx-config scripts, but restoring > that great glob of build crap to support older versions seems like a step > backwards.Yeah, I agree, pkg-config rocks. It shouldn''t be reverted completely. I''m just saying that if pkg-config fails for expat, we should continue to use the ugly fallback path for now rather than abort. --Jeremy
On Fri, 13 Apr 2012, Jeremy Huddleston wrote:> > On Apr 12, 2012, at 7:00 PM, Mike Frysinger <vapier at gentoo.org> wrote: > >> On Thursday 12 April 2012 14:22:31 Jeremy Huddleston wrote: >>> This caused tinderbox to fail: >>> http://tinderbox.x.org/builds/2012-04-03-0002/ >>> >>> I think expat did not start providing a .pc file until 2.1.0, which is >>> still in beta. Please revert the expat portion of this change. >> >> moving to pkg-config is a great thing. i can understand if the fallback logic >> of the PKG macro calls included running older xxx-config scripts, but restoring >> that great glob of build crap to support older versions seems like a step >> backwards. > > Yeah, I agree, pkg-config rocks. It shouldn''t be reverted completely. I''m just saying that if pkg-config fails for expat, we should continue to use the ugly fallback path for now rather than abort.usually, in those cases, i do that: 1) i check the .pc file. 2) if it fails, I check header file(s) and library, with an m4 macro if it''s needed for several libraries. I wrote that one for openjpeg: http://code.google.com/p/openjpeg/source/browse/branches/openjpeg-1.5/m4/opj_check_lib.m4 These days, I tend to reduce the number of configure options so that the users is less lost. So for include and library search paths, I use only 2 options (a bit like ffmpeg, actually): --extra-cppflags --extra-ldflags instead of plenty of --with-mylib-prefix, as, most of the time, they are in /usr/(include,lib) anyway regards Vincent Torri