📄 aclocal.m4
字号:
INTLLIBS="-lintl $LIBICONV" fi gt_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) LIBS="$gt_save_LIBS" dnl Search for GNU msgfmt in the PATH. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext in the PATH. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) CATOBJEXT=.gmo fi ]) if test "$CATOBJEXT" = "NONE"; then dnl GNU gettext is not found in the C library. dnl Fall back on GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) AC_SUBST(MSGFMT) BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then : ; else AC_MSG_RESULT( [found msgfmt program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi dnl We need to process the po/ directory. POSUB=po fi AC_OUTPUT_COMMANDS( [for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.inn. case "$ac_file" in */[Mm]akefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` ac_base=`basename $ac_file .in` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base" sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base" fi ;; esac done]) dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison])changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi 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 Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(GMOFILES) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) ])dnldnl ---------------------------------------------------------------------------dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56dnl ------------dnl Conditionally generate script according to whether we're using the releasednl version of autoconf, or a patched version (using the ternary component asdnl the patch-version).define(CF_AC_PREREQ,[CF_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnldnl ---------------------------------------------------------------------------dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52dnl -------------dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it'sdnl redundant. We don't normally need to add -I/usr/local/include for gcc,dnl but old versions (and some misinstalled ones) need that. To make thingsdnl worse, gcc 3.x gives error messages if -I/usr/local/include is added todnl the include-path).AC_DEFUN([CF_ADD_INCDIR],[for cf_add_incdir in $1do while true do case $cf_add_incdir in /usr/include) # (vi ;; /usr/local/include) # (vi if test "$GCC" = yes then cf_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" AC_TRY_COMPILE([#include <stdio.h>], [printf("Hello")], [], [CPPFLAGS="$cf_save_CPPFLAGS"]) fi ;; *) # (vi CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" ;; esac cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" donedone])dnldnl ---------------------------------------------------------------------------dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31dnl --------------dnl Allow user to disable a normally-on option.AC_DEFUN([CF_ARG_DISABLE],[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnldnl ---------------------------------------------------------------------------dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31dnl -------------dnl Allow user to enable a normally-off option.AC_DEFUN([CF_ARG_ENABLE],[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnldnl ---------------------------------------------------------------------------dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03dnl -----------------dnl Verbose form of AC_ARG_ENABLE:dnldnl Parameters:dnl $1 = messagednl $2 = option namednl $3 = help-stringdnl $4 = action to perform if option is enableddnl $5 = action if perform if option is disableddnl $6 = default option value (either 'yes' or 'no')AC_DEFUN([CF_ARG_MSG_ENABLE],[AC_MSG_CHECKING($1)AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))AC_MSG_RESULT($enableval)if test "$enableval" != no ; thenifelse($4,,[ :],$4)elseifelse($5,,[ :],$5)fi])dnldnl ---------------------------------------------------------------------------dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41dnl -------------dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogusdnl values.dnldnl Parameters:dnl $1 = option namednl $2 = help-stringdnl $3 = action to perform if option is not defaultdnl $4 = action if perform if option is defaultdnl $5 = default option value (either 'yes' or 'no')AC_DEFUN([CF_ARG_OPTION],[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes) if test "$enableval" != "$5" ; thenifelse($3,,[ :]dnl,[ $3]) ifelse($4,,,[ else $4]) fi],[enableval=$5 ifelse($4,,,[ $4])dnl ])])dnldnl ---------------------------------------------------------------------------dnl CF_BUNDLED_INTL version: 10 updated: 2003/09/14 18:49:13dnl ---------------dnl Top-level macro for configuring an application with a bundled copy ofdnl the intl and po directories for gettext.dnldnl $1 specifies either Makefile or makefile, defaulting to the former.dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nlsdnldnl Sets variables which can be used to substitute in makefiles:dnl INTLDIR_MAKE - to make ./intl directorydnl MSG_DIR_MAKE - to make ./po directorydnl SUB_MAKEFILE - list of makefiles in ./intl, ./po directoriesdnl Definesdnl HAVE_LIBGETTEXT_H if we're using ./intldnldnl Environment:dnl ALL_LINGUAS if set, lists the root names of the ".po" files.dnl CONFIG_H assumed to be "config.h"dnl VERSION may be set, otherwise extract from "VERSION" file.dnlAC_DEFUN([CF_BUNDLED_INTL],[cf_makefile=ifelse($1,,Makefile,$1)dnl Set of available languages (based on source distribution). Note thatdnl setting $LINGUAS overrides $ALL_LINGUAS. Some environments set $LINGUASdnl rather than $LC_ALLtest -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`# Allow override of "config.h" definition:: ${CONFIG_H=config.h}AC_SUBST(CONFIG_H)if test -z "$VERSION" ; thenif test -f $srcdir/VERSION ; then VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1`else VERSION=unknownfifiAC_SUBST(VERSION)AM_GNU_GETTEXT(,,,[$2])INTLDIR_MAKE=MSG_DIR_MAKE=SUB_MAKEFILE=dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:CF_OUR_MESSAGES($1)if test "$USE_INCLUDED_LIBINTL" = yes ; then if test "$nls_cv_force_use_gnu_gettext" = yes ; then : elif test "$nls_cv_use_gnu_gettext" = yes ; then : else INTLDIR_MAKE="#" fi if test -z "$INTLDIR_MAKE"; then AC_DEFINE(HAVE_LIBGETTEXT_H) for cf_makefile in \ $srcdir/intl/Makefile.in \ $srcdir/intl/makefile.in do if test -f "$cf_makefile" ; then SUB_MAKEFILE="$SUB_MAKEFILE `echo ${cf_makefile}|sed -e 's/\.in$//'`:${cf_makefile}" break fi done fielse INTLDIR_MAKE="#" if test "$USE_NLS" = yes ; then AC_CHECK_HEADERS(libintl.h) fifiif test -z "$INTLDIR_MAKE" ; then CPPFLAGS="-I../intl $CPPFLAGS"fidnl FIXME: we use this in lynx (the alternative is a spurious dependency upondnl GNU make)if test "$BUILD_INCLUDED_LIBINTL" = yes ; then GT_YES="#" GT_NO=else GT_YES= GT_NO="#"fiAC_SUBST(INTLDIR_MAKE)AC_SUBST(MSG_DIR_MAKE)AC_SUBST(GT_YES)AC_SUBST(GT_NO)dnl FIXME: the underlying AM_GNU_GETTEXT macro either needs some fixes or adnl little documentation. It doesn't define anything so that we can ifdef ourdnl own code, except ENABLE_NLS, which is too vague to be of any use.if test "$USE_INCLUDED_LIBINTL" = yes ; then if test "$nls_cv_force_use_gnu_gettext" = yes ; then AC_DEFINE(HAVE_GETTEXT) elif test "$nls_cv_use_gnu_gettext" = yes ; then AC_DEFINE(HAVE_GETTEXT) fi if test -n "$nls_cv_header_intl" ; then AC_DEFINE(HAVE_LIBINTL_H) fifi])dnldnl ---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -