diff options
author | Bruno Haible <bruno@clisp.org> | 2006-11-15 13:08:36 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:14:23 +0200 |
commit | 12c2cbaf0efad6fa5c213cb92ae35e6926f4d81a (patch) | |
tree | 120ac07d9dc98a49aef9ce6927276cd8090bd282 /gnulib-local/m4 | |
parent | 54eb989693a6cb0d6f4069bb0044e3f316db105e (diff) | |
download | external_gettext-12c2cbaf0efad6fa5c213cb92ae35e6926f4d81a.zip external_gettext-12c2cbaf0efad6fa5c213cb92ae35e6926f4d81a.tar.gz external_gettext-12c2cbaf0efad6fa5c213cb92ae35e6926f4d81a.tar.bz2 |
New module 'libcroco'.
Diffstat (limited to 'gnulib-local/m4')
-rw-r--r-- | gnulib-local/m4/libcroco.m4 | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/gnulib-local/m4/libcroco.m4 b/gnulib-local/m4/libcroco.m4 new file mode 100644 index 0000000..b95da3f --- /dev/null +++ b/gnulib-local/m4/libcroco.m4 @@ -0,0 +1,122 @@ +# libcroco.m4 serial 1 (gettext-0.16.1) +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([gl_LIBCROCO], +[ + dnl libcroco depends on libglib. + AC_REQUIRE([gl_LIBGLIB]) + + AC_MSG_CHECKING([whether included libcroco is requested]) + AC_ARG_WITH([included-libcroco], + [ --with-included-libcroco use the libcroco included here], + [gl_cv_libcroco_force_included=$withval], + [gl_cv_libcroco_force_included=no]) + AC_MSG_RESULT([$gl_cv_libcroco_force_included]) + + gl_cv_libcroco_use_included="$gl_cv_libcroco_force_included" + LIBCROCO= + LTLIBCROCO= + INCCROCO= + if test "$gl_cv_libcroco_use_included" != yes; then + dnl Figure out whether we can use a preinstalled libcroco-0.6, or have to + dnl use the included one. + AC_CACHE_VAL([gl_cv_libcroco], [ + gl_cv_libcroco=no + gl_cv_LIBCROCO= + gl_cv_LTLIBCROCO= + gl_cv_INCCROCO= + gl_save_LIBS="$LIBS" + dnl Search for libcroco and define LIBCROCO_0_6, LTLIBCROCO_0_6 and + dnl INCCROCO_0_6 accordingly. + dnl Don't use croco-0.6-config nor pkg-config, since it doesn't work when + dnl cross-compiling or when the C compiler in use is different from the + dnl one that built the library. + AC_LIB_LINKFLAGS_BODY([croco-0.6], [glib-2.0]) + LIBS="$gl_save_LIBS $LIBCROCO_0_6" + AC_TRY_LINK([#include <libcroco-config.h>], + [const char *version = LIBCROCO_VERSION; return !version;], + [gl_cv_libcroco=yes + gl_cv_LIBCROCO="$LIBCROCO_0_6" + gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6" + ]) + if test "$gl_cv_libcroco" != yes; then + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCCROCO_0_6" + AC_TRY_LINK([#include <libcroco-config.h>], + [const char *version = LIBCROCO_VERSION; return !version;], + [gl_cv_libcroco=yes + gl_cv_LIBCROCO="$LIBCROCO_0_6" + gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6" + gl_cv_INCCROCO="$INCCROCO_0_6" + ]) + if test "$gl_cv_libcroco" != yes; then + dnl Often the include files are installed in + dnl /usr/include/libcroco-0.6/libcroco. + AC_TRY_LINK([#include <libcroco-0.6/libcroco/libcroco-config.h>], + [const char *version = LIBCROCO_VERSION; return !version;], + [gl_ABSOLUTE_HEADER([libcroco-0.6/libcroco/libcroco-config.h]) + libcroco_include_dir=`echo "$gl_cv_absolute_libcroco_0_6_libcroco_libcroco_config_h" | sed -e 's,.libcroco-config\.h$,,'` + if test -d "$libcroco_include_dir"; then + gl_cv_libcroco=yes + gl_cv_LIBCROCO="$LIBCROCO_0_6" + gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6" + gl_cv_INCCROCO="-I$libcroco_include_dir" + fi + ]) + fi + CPPFLAGS="$gl_save_CPPFLAGS" + fi + LIBS="$gl_save_LIBS" + ]) + AC_MSG_CHECKING([for libcroco]) + AC_MSG_RESULT([$gl_cv_libcroco]) + if test $gl_cv_libcroco = yes; then + LIBCROCO="$gl_cv_LIBCROCO" + LTLIBCROCO="$gl_cv_LTLIBCROCO" + INCCROCO="$gl_cv_INCCROCO" + else + gl_cv_libcroco_use_included=yes + fi + fi + AC_SUBST([LIBCROCO]) + AC_SUBST([LTLIBCROCO]) + AC_SUBST([INCCROCO]) + AC_MSG_CHECKING([whether to use the included libcroco]) + AC_MSG_RESULT([$gl_cv_libcroco_use_included]) + + if test "$gl_cv_libcroco_use_included" = yes; then + AC_LIBOBJ([libcroco/cr-additional-sel]) + AC_LIBOBJ([libcroco/cr-attr-sel]) + AC_LIBOBJ([libcroco/cr-cascade]) + AC_LIBOBJ([libcroco/cr-declaration]) + AC_LIBOBJ([libcroco/cr-doc-handler]) + AC_LIBOBJ([libcroco/cr-enc-handler]) + AC_LIBOBJ([libcroco/cr-fonts]) + AC_LIBOBJ([libcroco/cr-input]) + AC_LIBOBJ([libcroco/cr-num]) + AC_LIBOBJ([libcroco/cr-om-parser]) + AC_LIBOBJ([libcroco/cr-parser]) + AC_LIBOBJ([libcroco/cr-parsing-location]) + AC_LIBOBJ([libcroco/cr-prop-list]) + AC_LIBOBJ([libcroco/cr-pseudo]) + AC_LIBOBJ([libcroco/cr-rgb]) + AC_LIBOBJ([libcroco/cr-sel-eng]) + AC_LIBOBJ([libcroco/cr-selector]) + AC_LIBOBJ([libcroco/cr-simple-sel]) + AC_LIBOBJ([libcroco/cr-statement]) + AC_LIBOBJ([libcroco/cr-string]) + AC_LIBOBJ([libcroco/cr-style]) + AC_LIBOBJ([libcroco/cr-stylesheet]) + AC_LIBOBJ([libcroco/cr-term]) + AC_LIBOBJ([libcroco/cr-tknzr]) + AC_LIBOBJ([libcroco/cr-token]) + AC_LIBOBJ([libcroco/cr-utils]) + fi + AM_CONDITIONAL([INCLUDED_LIBCROCO], + [test "$gl_cv_libcroco_use_included" = yes]) +]) |