2 +++ pango-1.2.5/m4/glib-2.0.m4
4 +# Configure paths for GLIB
5 +# Owen Taylor 1997-2001
7 +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
8 +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
9 +dnl gthread is specified in MODULES, pass to pkg-config
11 +AC_DEFUN(AM_PATH_GLIB_2_0,
13 +dnl Get the cflags and libraries from pkg-config
15 +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
16 + , enable_glibtest=yes)
18 + pkg_config_args=glib-2.0
23 + pkg_config_args="$pkg_config_args gmodule-2.0"
26 + pkg_config_args="$pkg_config_args gobject-2.0"
29 + pkg_config_args="$pkg_config_args gthread-2.0"
34 + AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
38 + if test x$PKG_CONFIG != xno ; then
39 + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
42 + echo *** pkg-config too old; version 0.7 or better required.
50 + min_glib_version=ifelse([$1], ,2.0.0,$1)
51 + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
53 + if test x$PKG_CONFIG != xno ; then
54 + ## don't try to run the test against uninstalled libtool libs
55 + if $PKG_CONFIG --uninstalled $pkg_config_args; then
56 + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
60 + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
67 + if test x"$no_glib" = x ; then
68 + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
69 + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
70 + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
72 + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
73 + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
74 + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
75 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
76 + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
77 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
78 + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
79 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
80 + if test "x$enable_glibtest" = "xyes" ; then
81 + ac_save_CFLAGS="$CFLAGS"
82 + ac_save_LIBS="$LIBS"
83 + CFLAGS="$CFLAGS $GLIB_CFLAGS"
84 + LIBS="$GLIB_LIBS $LIBS"
86 +dnl Now check if the installed GLIB is sufficiently new. (Also sanity
87 +dnl checks the results of pkg-config to some extent)
98 + int major, minor, micro;
101 + system ("touch conf.glibtest");
103 + /* HP/UX 9 (%@#!) writes to sscanf strings */
104 + tmp_version = g_strdup("$min_glib_version");
105 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
106 + printf("%s, bad version string\n", "$min_glib_version");
110 + if ((glib_major_version != $glib_config_major_version) ||
111 + (glib_minor_version != $glib_config_minor_version) ||
112 + (glib_micro_version != $glib_config_micro_version))
114 + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
115 + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
116 + glib_major_version, glib_minor_version, glib_micro_version);
117 + printf ("*** was found! If pkg-config was correct, then it is best\n");
118 + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
119 + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
120 + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
121 + printf("*** required on your system.\n");
122 + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
123 + printf("*** to point to the correct configuration files\n");
125 + else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
126 + (glib_minor_version != GLIB_MINOR_VERSION) ||
127 + (glib_micro_version != GLIB_MICRO_VERSION))
129 + printf("*** GLIB header files (version %d.%d.%d) do not match\n",
130 + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
131 + printf("*** library (version %d.%d.%d)\n",
132 + glib_major_version, glib_minor_version, glib_micro_version);
136 + if ((glib_major_version > major) ||
137 + ((glib_major_version == major) && (glib_minor_version > minor)) ||
138 + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
144 + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
145 + glib_major_version, glib_minor_version, glib_micro_version);
146 + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
147 + major, minor, micro);
148 + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
150 + printf("*** If you have already installed a sufficiently new version, this error\n");
151 + printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
152 + printf("*** being found. The easiest way to fix this is to remove the old version\n");
153 + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
154 + printf("*** correct copy of pkg-config. (In this case, you will have to\n");
155 + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
156 + printf("*** so that the correct libraries are found at run-time))\n");
161 +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
162 + CFLAGS="$ac_save_CFLAGS"
163 + LIBS="$ac_save_LIBS"
166 + if test "x$no_glib" = x ; then
167 + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
168 + ifelse([$2], , :, [$2])
171 + if test "$PKG_CONFIG" = "no" ; then
172 + echo "*** A new enough version of pkg-config was not found."
173 + echo "*** See http://www.freedesktop.org/software/pkgconfig/"
175 + if test -f conf.glibtest ; then
178 + echo "*** Could not run GLIB test program, checking why..."
179 + ac_save_CFLAGS="$CFLAGS"
180 + ac_save_LIBS="$LIBS"
181 + CFLAGS="$CFLAGS $GLIB_CFLAGS"
182 + LIBS="$LIBS $GLIB_LIBS"
186 +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
187 + [ echo "*** The test program compiled, but did not run. This usually means"
188 + echo "*** that the run-time linker is not finding GLIB or finding the wrong"
189 + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
190 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
191 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
192 + echo "*** is required on your system"
194 + echo "*** If you have an old version installed, it is best to remove it, although"
195 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
196 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
197 + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
198 + CFLAGS="$ac_save_CFLAGS"
199 + LIBS="$ac_save_LIBS"
207 + ifelse([$3], , :, [$3])
209 + AC_SUBST(GLIB_CFLAGS)
210 + AC_SUBST(GLIB_LIBS)
211 + AC_SUBST(GLIB_GENMARSHAL)
212 + AC_SUBST(GOBJECT_QUERY)
213 + AC_SUBST(GLIB_MKENUMS)
214 + rm -f conf.glibtest
217 +++ pango-1.2.5/m4/glib-gettext.m4
219 +# Macro to add for using GNU gettext.
220 +# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
222 +# Modified to never use included libintl.
223 +# Owen Taylor <otaylor@redhat.com>, 12/15/1998
226 +# This file can be copied and used freely without restrictions. It can
227 +# be used in projects which are not available under the GNU Public License
228 +# but which still want to provide support for the GNU gettext functionality.
229 +# Please note that the actual code is *not* freely available.
232 +# If you make changes to this file, you MUST update the copy in
233 +# acinclude.m4. [ aclocal dies on duplicate macros, so if
234 +# we run 'aclocal -I macros/' then we'll run into problems
235 +# once we've installed glib-gettext.m4 :-( ]
238 +AC_DEFUN([AM_GLIB_LC_MESSAGES],
239 + [if test $ac_cv_header_locale_h = yes; then
240 + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
241 + [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
242 + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
243 + if test $am_cv_val_LC_MESSAGES = yes; then
244 + AC_DEFINE(HAVE_LC_MESSAGES, 1,
245 + [Define if your <locale.h> file defines LC_MESSAGES.])
249 +dnl AM_GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
250 +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
251 +AC_DEFUN([AM_GLIB_PATH_PROG_WITH_TEST],
252 +[# Extract the first word of "$2", so it can be a program name with args.
253 +set dummy $2; ac_word=[$]2
254 +AC_MSG_CHECKING([for $ac_word])
255 +AC_CACHE_VAL(ac_cv_path_$1,
258 + ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
261 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
262 + for ac_dir in ifelse([$5], , $PATH, [$5]); do
263 + test -z "$ac_dir" && ac_dir=.
264 + if test -f $ac_dir/$ac_word; then
266 + ac_cv_path_$1="$ac_dir/$ac_word"
272 +dnl If no 4th arg is given, leave the cache variable unset,
273 +dnl so AC_PATH_PROGS will keep looking.
274 +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
279 +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
280 + AC_MSG_RESULT([$]$1)
289 +AC_DEFUN(AM_GLIB_WITH_NLS,
290 + dnl NLS is obligatory
294 + dnl Figure out what method
295 + nls_cv_force_use_gnu_gettext="no"
297 + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
298 + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
299 + dnl User does not insist on using GNU NLS library. Figure out what
300 + dnl to use. If gettext or catgets are available (in this order) we
301 + dnl use this. Else we have to fall back to GNU NLS library.
302 + dnl catgets is only used if permitted by option --with-catgets.
303 + nls_cv_header_intl=
304 + nls_cv_header_libgt=
308 + AC_CHECK_HEADER(libintl.h,
309 + [AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
310 + [AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
311 + gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
313 + gt_cv_func_dgettext_libintl="no"
314 + libintl_extra_libs=""
316 + if test "$gt_cv_func_dgettext_libc" != "yes" ; then
317 + AC_CHECK_LIB(intl, bindtextdomain,
318 + [AC_CHECK_LIB(intl, dgettext,
319 + gt_cv_func_dgettext_libintl=yes)])
321 + if test "$gt_cv_func_dgettext_libc" != "yes" ; then
322 + AC_MSG_CHECKING([if -liconv is needed to use gettext])
324 + AC_CHECK_LIB(intl, dcgettext,
325 + [gt_cv_func_dgettext_libintl=yes
326 + libintl_extra_libs=-liconv],
331 + if test "$gt_cv_func_dgettext_libintl" = "yes"; then
332 + LIBS="$LIBS -lintl $libintl_extra_libs";
335 + if test "$gt_cv_func_dgettext_libc" = "yes" \
336 + || test "$gt_cv_func_dgettext_libintl" = "yes"; then
337 + AC_DEFINE(HAVE_GETTEXT,1,
338 + [Define if the GNU gettext() function is already present or preinstalled.])
339 + AM_GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
340 + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
341 + if test "$MSGFMT" != "no"; then
342 + AC_CHECK_FUNCS(dcgettext)
343 + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
344 + AM_GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
345 + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
346 + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
347 + return _nl_msg_cat_cntr],
349 + DATADIRNAME=share],
356 + # Added by Martin Baulig 12/15/98 for libc5 systems
357 + if test "$gt_cv_func_dgettext_libc" != "yes" \
358 + && test "$gt_cv_func_dgettext_libintl" = "yes"; then
359 + INTLLIBS="-lintl $libintl_extra_libs"
360 + LIBS=`echo $LIBS | sed -e 's/-lintl//'`
364 + if test "$CATOBJEXT" = "NONE"; then
365 + dnl Neither gettext nor catgets in included in the C library.
366 + dnl Fall back on GNU gettext library.
367 + nls_cv_use_gnu_gettext=yes
371 + if test "$nls_cv_use_gnu_gettext" != "yes"; then
372 + AC_DEFINE(ENABLE_NLS, 1,
373 + [always defined to indicate that i18n is enabled])
375 + dnl Unset this variable since we use the non-zero value as a flag.
379 + dnl Test whether we really found GNU xgettext.
380 + if test "$XGETTEXT" != ":"; then
381 + dnl If it is no GNU xgettext we define it as : so that the
382 + dnl Makefiles still can work.
383 + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
387 + [found xgettext program is not GNU xgettext; ignore it])
392 + # We need to process the po/ directory.
395 + AC_OUTPUT_COMMANDS(
396 + [case "$CONFIG_FILES" in *po/Makefile.in*)
397 + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
400 + dnl These rules are solely for the distribution goal. While doing this
401 + dnl we only have to keep exactly one list of the available catalogs
402 + dnl in configure.in.
403 + for lang in $ALL_LINGUAS; do
404 + GMOFILES="$GMOFILES $lang.gmo"
405 + POFILES="$POFILES $lang.po"
408 + dnl Make all variables we use known to autoconf.
410 + AC_SUBST(CATOBJEXT)
411 + AC_SUBST(DATADIRNAME)
413 + AC_SUBST(INSTOBJEXT)
421 +AC_DEFUN(AM_GLIB_GNU_GETTEXT,
422 + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
423 + AC_REQUIRE([AC_PROG_CC])dnl
424 + AC_REQUIRE([AC_PROG_RANLIB])dnl
425 + AC_REQUIRE([AC_HEADER_STDC])dnl
426 + AC_REQUIRE([AC_C_CONST])dnl
427 + AC_REQUIRE([AC_C_INLINE])dnl
428 + AC_REQUIRE([AC_TYPE_OFF_T])dnl
429 + AC_REQUIRE([AC_TYPE_SIZE_T])dnl
430 + AC_REQUIRE([AC_FUNC_ALLOCA])dnl
431 + AC_REQUIRE([AC_FUNC_MMAP])dnl
433 + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
434 +unistd.h sys/param.h])
435 + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
436 +strdup __argz_count __argz_stringify __argz_next])
438 + AM_GLIB_LC_MESSAGES
441 + if test "x$CATOBJEXT" != "x"; then
442 + if test "x$ALL_LINGUAS" = "x"; then
445 + AC_MSG_CHECKING(for catalogs to be installed)
447 + for lang in ${LINGUAS=$ALL_LINGUAS}; do
448 + case "$ALL_LINGUAS" in
449 + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
452 + LINGUAS=$NEW_LINGUAS
453 + AC_MSG_RESULT($LINGUAS)
456 + dnl Construct list of names of catalog files to be constructed.
457 + if test -n "$LINGUAS"; then
458 + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
462 + dnl Determine which catalog format we have (if any is needed)
463 + dnl For now we know about two different formats:
464 + dnl Linux libc-5 and the normal X/Open format
465 + test -d po || mkdir po
466 + if test "$CATOBJEXT" = ".cat"; then
467 + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
469 + dnl Transform the SED scripts while copying because some dumb SEDs
470 + dnl cannot handle comments.
471 + sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
474 + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
475 + dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
476 + dnl Try to locate is.
478 + if test -n "$ac_aux_dir"; then
479 + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
481 + if test -z "$MKINSTALLDIRS"; then
482 + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
484 + AC_SUBST(MKINSTALLDIRS)
486 + dnl Generate list of files to be processed by xgettext which will
487 + dnl be included in po/Makefile.
488 + test -d po || mkdir po
489 + if test "x$srcdir" != "x."; then
490 + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
491 + posrcprefix="$srcdir/"
493 + posrcprefix="../$srcdir/"
499 + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
500 + < $srcdir/po/POTFILES.in > po/POTFILES