diff options
author | Akira TAGOH <akira@tagoh.org> | 2012-04-13 11:09:04 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2012-04-13 11:09:04 +0900 |
commit | c5714bcf90d6b345e748b7fa7b21e421409aba60 (patch) | |
tree | c7cc0a03eaec474a070f8a97b4a34ea34afb91d0 | |
parent | 470e92c9dbdc75d354c9dce9063276996ecf535d (diff) |
Add --with-expat, --with-expat-includes and --with-expat-lib back.
-rw-r--r-- | configure.in | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/configure.in b/configure.in index 3f5c98b..1af2367 100644 --- a/configure.in +++ b/configure.in @@ -242,10 +242,45 @@ LIBS="$fontconfig_save_libs" # # Check expat configuration # +AC_ARG_WITH(expat, + [AC_HELP_STRING([--with-expat=DIR], + [Use Expat in DIR])], + [expat_prefix=$withval], + [expat_prefix=auto]) +AC_ARG_WITH(expat-includes, + [AC_HELP_STRING([--with-expat-includes=DIR], + [Use Expat includes in DIR])], + [expat_includes=$withval], + [expat_includes=auto]) +AC_ARG_WITH(expat-lib, + [AC_HELP_STRING([--with-expat-lib=DIR])], + [expat_lib=$withval], + [expat_lib=auto]) + if test "$enable_libxml2" != "yes"; then - # 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) + use_pkgconfig_for_expat=yes + if test "$expat_prefix" = "auto" -a "$expat_includes" = "auto" -a "$expat_lib" = "auto"; then + PKG_CHECK_MODULES(EXPAT, expat,,use_pkgconfig_for_expat=no) + else + use_pkgconfig_for_expat=no + fi + if test "x$use_pkgconfig_for_expat" = "xno"; then + if test "$expat_includes" != "auto" -a -r ${expat_includes}/expat.h; then + EXPAT_CFLAGS="-I${expat_includes}" + elif test "$expat_prefix" != "auto" -a -r ${expat_prefix}/include/expat.h; then + EXPAT_CFLAGS="-I${expat_prefix}/include" + else + EXPAT_CFLAGS="" + fi + if test "$expat_lib" != "auto"; then + EXPAT_LIBS="-L${expat_lib} -lexpat" + elif test "$expat_prefix" != "auto"; then + EXPAT_LIBS="-L${expat_prefix}/lib -lexpat" + else + EXPAT_LIBS="-lexpat" + fi + fi + expatsaved_CPPFLAGS="$CPPFLAGS" expatsaved_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" |