📄 acinclude.m4
字号:
dnl $Aumix: aumix/acinclude.m4,v 1.3 2002/10/29 21:27:50 trevor Exp $dnl This code originates from Ulrich Drepper's am_with_nls.AC_DEFUN(AM_GNU_GETTEXT,)AC_DEFUN(AUMIX_WITH_NLS, [AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], HAVE_NLS=$enableval, HAVE_NLS=yes) AC_MSG_RESULT($HAVE_NLS) dnl If something goes wrong, we may still decide not to use NLS. dnl For this reason, defer AC_SUBST'ing HAVE_NLS until the very dnl last moment. if test x"$HAVE_NLS" = xyes; then AC_MSG_RESULT("language catalogs: $ALL_LINGUAS") AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_SUBST(MSGFMT) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) CATOBJEXT=.gmo INSTOBJEXT=.mo dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext programs is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi AC_CHECK_HEADERS(locale.h libintl.h) AC_CHECK_FUNCS(gettext, [], [ AC_CHECK_LIB(intl, gettext, [ dnl gettext is in libintl; announce the fact manually. LIBS="-lintl $LIBS" AC_DEFINE(HAVE_GETTEXT) ], [ AC_MSG_RESULT( [gettext not found; disabling NLS]) HAVE_NLS=no ]) ]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Construct list of names of catalog files to be constructed. for lang in $ALL_LINGUAS; do CATALOGS="$CATALOGS ${lang}${CATOBJEXT}" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(POFILES) fi AC_SUBST(HAVE_NLS) dnl Some independently maintained files, such as po/Makefile.in, dnl use `USE_NLS', so support it. USE_NLS=$HAVE_NLS AC_SUBST(USE_NLS) if test "x$HAVE_NLS" = xyes; then AC_DEFINE(HAVE_NLS) fi dnl In the intl/Makefile.in we have a special dependency which makes dnl only sense for gettext. We comment this out for non-gettext dnl packages. if test "$PACKAGE" = "gettext"; then GT_NO="#NO#" GT_YES= else GT_NO= GT_YES="#YES#" fi AC_SUBST(GT_NO) AC_SUBST(GT_YES) ])dnl Generate list of files to be processed by xgettext which willdnl be included in po/Makefile.dnldnl This is not strictly an Autoconf macro, because it is run fromdnl within `config.status' rather than from within configure. Thisdnl is why special rules must be applied for it.AC_DEFUN(AUMIX_PROCESS_PO, [srcdir=$ac_given_srcdir # Advanced autoconf hackery dnl I wonder what the following several lines do... if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi elsednl posrcprefix="../" posrcprefix="../src/" fi rm -f po/POTFILES dnl Use `echo' rather than AC_MSG_RESULT, because this is run from dnl `config.status'. echo "generating po/POTFILES from $srcdir/po/POTFILES.in" sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," \ -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES echo "creating po/Makefile" sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile ])# Search path for a program which passes the given test.# Ulrich Drepper <drepper@cygnus.com>, 1996.## This file may be copied and used freely without restrictions. It# can be used in projects which are not available under the GNU Public# License but which still want to provide support for the GNU gettext# functionality. Please note that the actual code is *not* freely# available.# serial 1dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])AC_DEFUN(AM_PATH_PROG_WITH_TEST,[# Extract the first word of "$2", so it can be a program name with args.set dummy $2; ac_word=[$]2AC_MSG_CHECKING([for $ac_word])AC_CACHE_VAL(ac_cv_path_$1,[case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs"dnl If no 4th arg is given, leave the cache variable unset,dnl so AC_PATH_PROGS will keep looking.ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"])dnl ;;esac])dnl$1="$ac_cv_path_$1"if test -n "[$]$1"; then AC_MSG_RESULT([$]$1)else AC_MSG_RESULT(no)fiAC_SUBST($1)dnl])# Configure paths for GTK+# Owen Taylor 97-11-3dnl AM_PATH_GTK1([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBSdnlAC_DEFUN(AM_PATH_GTK1,[dnl dnl Get the cflags and libraries from the gtk-config scriptdnlAC_ARG_WITH(gtk1-prefix,[ --with-gtk1-prefix=PFX Prefix where GTK 1.2 is installed (optional)], gtk_config_prefix="$withval", gtk_config_prefix="")AC_ARG_WITH(gtk1-exec-prefix,[ --with-gtk1-exec-prefix=PFX Exec prefix where GTK 1.2 is installed (optional)], gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")AC_ARG_ENABLE(gtk1test, [ --disable-gtk1test Do not try to compile and run a test GTK 1.2 program], , enable_gtk1test=yes) for module in . $4 do case "$module" in gthread) gtk_config_args="$gtk_config_args gthread" ;; esac done if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK 1.2 - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk1=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS"dnldnl Now check if the installed GTK is sufficiently new. (Also sanitydnl checks the results of gtk-config to some extentdnl rm -f conf.gtktest AC_TRY_RUN([#include <gtk/gtk.h>#include <stdio.h>#include <stdlib.h>int main (){ int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. 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 gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) ||
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -