]> git.pld-linux.org Git - packages/lftp.git/blob - lftp-use_system_gettext.m4.patch
- release 4,
[packages/lftp.git] / lftp-use_system_gettext.m4.patch
1 diff -Nru lftp-2.3.9/Makefile.am lftp-2.3.9.new/Makefile.am
2 --- lftp-2.3.9/Makefile.am      Thu Mar 22 13:56:34 2001
3 +++ lftp-2.3.9.new/Makefile.am  Fri Apr 13 01:36:18 2001
4 @@ -4,7 +4,7 @@
5  AUTOMAKE_OPTIONS = foreign
6  M4DIR = $(srcdir)/m4
7  ACLOCAL_AMFLAGS = -I $(M4DIR)
8 -ACINCLUDE_INPUTS = $(M4DIR)/gettext.m4 $(M4DIR)/lcmessage.m4 $(M4DIR)/progtest.m4
9 +ACINCLUDE_INPUTS = $(M4DIR)/lcmessage.m4 $(M4DIR)/progtest.m4
10  
11  install-data-local:
12         if [ ! -f $(DESTDIR)$(sysconfdir)/lftp.conf ]; then \
13 diff -Nru lftp-2.3.9/acinclude.m4 lftp-2.3.9.new/acinclude.m4
14 --- lftp-2.3.9/acinclude.m4     Thu Mar 22 13:58:35 2001
15 +++ lftp-2.3.9.new/acinclude.m4 Thu Jan  1 01:00:00 1970
16 @@ -1,398 +0,0 @@
17 -# Macro to add for using GNU gettext.
18 -# Ulrich Drepper <drepper@cygnus.com>, 1995.
19 -#
20 -# This file can be copied and used freely without restrictions.  It can
21 -# be used in projects which are not available under the GNU Public License
22 -# but which still want to provide support for the GNU gettext functionality.
23 -# Please note that the actual code is *not* freely available.
24 -
25 -# serial 108
26 -
27 -AC_PREREQ(2.13)               dnl Minimum Autoconf version required.
28 -
29 -AC_DEFUN(AM_WITH_NLS,
30 -  [AC_MSG_CHECKING([whether NLS is requested])
31 -    dnl Default is enabled NLS
32 -    AC_ARG_ENABLE(nls,
33 -      [  --disable-nls           do not use Native Language Support],
34 -      USE_NLS=$enableval, USE_NLS=yes)
35 -    AC_MSG_RESULT($USE_NLS)
36 -    AC_SUBST(USE_NLS)
37 -
38 -    USE_INCLUDED_LIBINTL=no
39 -
40 -    AC_ARG_WITH(locale-dir,
41 -      [  --with-locale-dir=DIR   specify locale directory],
42 -      LOCALE_DIR=$withval)
43 -    test -z "$LOCALE_DIR" && LOCALE_DIR='$(datadir)/locale'
44 -    AC_SUBST(LOCALE_DIR)
45 -
46 -    AC_ARG_WITH(gnu-locale-dir,
47 -      [  --with-gnu-locale-dir=DIR specify GNU locale directory],
48 -      GNU_LOCALE_DIR=$withval)
49 -    test -z "$GNU_LOCALE_DIR" && GNU_LOCALE_DIR='$(prefix)/share/locale'
50 -    AC_SUBST(GNU_LOCALE_DIR)
51 -
52 -    dnl If we use NLS figure out what method
53 -    if test "$USE_NLS" = "yes"; then
54 -      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
55 -      AC_MSG_CHECKING([whether included gettext is requested])
56 -      AC_ARG_WITH(included-gettext,
57 -        [  --with-included-gettext use the GNU gettext library included here],
58 -        nls_cv_force_use_gnu_gettext=$withval,
59 -        nls_cv_force_use_gnu_gettext=no)
60 -      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
61 -
62 -      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
63 -      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
64 -        dnl User does not insist on using GNU NLS library.  Figure out what
65 -        dnl to use.  If gettext or catgets are available (in this order) we
66 -        dnl use this.  Else we have to fall back to GNU NLS library.
67 -       dnl catgets is only used if permitted by option --with-catgets.
68 -       nls_cv_header_intl=
69 -       nls_cv_header_libgt=
70 -       CATOBJEXT=NONE
71 -
72 -       AC_CHECK_HEADER(libintl.h,
73 -         [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
74 -           [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
75 -              gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
76 -
77 -          if test "$gt_cv_func_gettext_libc" != "yes"; then
78 -            AC_CHECK_LIB(intl, bindtextdomain,
79 -              [AC_CHECK_LIB(intl, gettext)])
80 -          fi
81 -
82 -          if test "$gt_cv_func_gettext_libc" = "yes" \
83 -             || test "$ac_cv_lib_intl_gettext" = "yes"; then
84 -             AC_DEFINE(HAVE_GETTEXT, 1,
85 -         [Define to 1 if you have gettext and don't want to use GNU gettext.])
86 -             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
87 -               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
88 -             if test "$MSGFMT" != "no"; then
89 -               AC_CHECK_FUNCS(dcgettext)
90 -               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
91 -               AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
92 -                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
93 -               AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
94 -                              return _nl_msg_cat_cntr],
95 -                 [CATOBJEXT=.gmo
96 -                  DATADIRNAME=share],
97 -                 [CATOBJEXT=.mo
98 -                  DATADIRNAME=lib])
99 -               INSTOBJEXT=.mo
100 -             fi
101 -           fi
102 -       ])
103 -
104 -        if test "$CATOBJEXT" = "NONE"; then
105 -         AC_MSG_CHECKING([whether catgets can be used])
106 -         AC_ARG_WITH(catgets,
107 -           [  --with-catgets          use catgets functions if available],
108 -           nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
109 -         AC_MSG_RESULT($nls_cv_use_catgets)
110 -
111 -         if test "$nls_cv_use_catgets" = "yes"; then
112 -           dnl No gettext in C library.  Try catgets next.
113 -           AC_CHECK_LIB(i, main)
114 -           AC_CHECK_FUNC(catgets,
115 -             [AC_DEFINE(HAVE_CATGETS, 1,
116 -                        [Define as 1 if you have catgets and don't want to use GNU gettext.])
117 -              INTLOBJS="\$(CATOBJS)"
118 -              AC_PATH_PROG(GENCAT, gencat, no)dnl
119 -              if test "$GENCAT" != "no"; then
120 -                AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
121 -                if test "$GMSGFMT" = "no"; then
122 -                  AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
123 -                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
124 -                fi
125 -                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
126 -                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
127 -                USE_INCLUDED_LIBINTL=yes
128 -                CATOBJEXT=.cat
129 -                INSTOBJEXT=.cat
130 -                DATADIRNAME=lib
131 -                INTLDEPS='$(top_builddir)/intl/libintl.a'
132 -                INTLLIBS=$INTLDEPS
133 -                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
134 -                nls_cv_header_intl=intl/libintl.h
135 -                nls_cv_header_libgt=intl/libgettext.h
136 -              fi])
137 -         fi
138 -        fi
139 -
140 -        if test "$CATOBJEXT" = "NONE"; then
141 -         dnl Neither gettext nor catgets in included in the C library.
142 -         dnl Fall back on GNU gettext library.
143 -         nls_cv_use_gnu_gettext=yes
144 -        fi
145 -      fi
146 -
147 -      if test "$nls_cv_use_gnu_gettext" = "yes"; then
148 -        dnl Mark actions used to generate GNU NLS library.
149 -        INTLOBJS="\$(GETTOBJS)"
150 -        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
151 -         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
152 -        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
153 -        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
154 -         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
155 -        AC_SUBST(MSGFMT)
156 -       USE_INCLUDED_LIBINTL=yes
157 -        CATOBJEXT=.gmo
158 -        INSTOBJEXT=.mo
159 -        DATADIRNAME=share
160 -       INTLDEPS='$(top_builddir)/intl/libintl.a'
161 -       INTLLIBS=$INTLDEPS
162 -       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
163 -        nls_cv_header_intl=intl/libintl.h
164 -        nls_cv_header_libgt=intl/libgettext.h
165 -      fi
166 -
167 -      dnl Test whether we really found GNU xgettext.
168 -      if test "$XGETTEXT" != ":"; then
169 -       dnl If it is no GNU xgettext we define it as : so that the
170 -       dnl Makefiles still can work.
171 -       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
172 -         : ;
173 -       else
174 -         AC_MSG_RESULT(
175 -           [found xgettext program is not GNU xgettext; ignore it])
176 -         XGETTEXT=":"
177 -       fi
178 -      fi
179 -
180 -      # We need to process the po/ directory.
181 -      POSUB=po
182 -    else
183 -      DATADIRNAME=share
184 -      nls_cv_header_intl=intl/libintl.h
185 -      nls_cv_header_libgt=intl/libgettext.h
186 -    fi
187 -    if test -z "$nls_cv_header_intl"; then
188 -      # Clean out junk possibly left behind by a previous configuration.
189 -      rm -f intl/libintl.h
190 -    fi
191 -    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
192 -    AC_OUTPUT_COMMANDS(
193 -     [case "$CONFIG_FILES" in *po/Makefile.in*)
194 -        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
195 -      esac])
196 -
197 -
198 -    # If this is used in GNU gettext we have to set USE_NLS to `yes'
199 -    # because some of the sources are only built for this goal.
200 -    if test "$PACKAGE" = gettext; then
201 -      USE_NLS=yes
202 -      USE_INCLUDED_LIBINTL=yes
203 -    fi
204 -
205 -    dnl These rules are solely for the distribution goal.  While doing this
206 -    dnl we only have to keep exactly one list of the available catalogs
207 -    dnl in configure.in.
208 -    for lang in $ALL_LINGUAS; do
209 -      GMOFILES="$GMOFILES $lang.gmo"
210 -      POFILES="$POFILES $lang.po"
211 -    done
212 -
213 -    dnl Make all variables we use known to autoconf.
214 -    AC_SUBST(USE_INCLUDED_LIBINTL)
215 -    AC_SUBST(CATALOGS)
216 -    AC_SUBST(CATOBJEXT)
217 -    AC_SUBST(DATADIRNAME)
218 -    AC_SUBST(GMOFILES)
219 -    AC_SUBST(INSTOBJEXT)
220 -    AC_SUBST(INTLDEPS)
221 -    AC_SUBST(INTLLIBS)
222 -    AC_SUBST(INTLOBJS)
223 -    AC_SUBST(POFILES)
224 -    AC_SUBST(POSUB)
225 -  ])
226 -
227 -AC_DEFUN(AM_GNU_GETTEXT,
228 -  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
229 -   AC_REQUIRE([AC_PROG_CC])dnl
230 -   AC_REQUIRE([AC_PROG_RANLIB])dnl
231 -   AC_REQUIRE([AC_ISC_POSIX])dnl
232 -   AC_REQUIRE([AC_HEADER_STDC])dnl
233 -   AC_REQUIRE([AC_C_CONST])dnl
234 -   AC_REQUIRE([AC_C_INLINE])dnl
235 -   AC_REQUIRE([AC_TYPE_OFF_T])dnl
236 -   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
237 -   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
238 -   AC_REQUIRE([AC_FUNC_MMAP])dnl
239 -
240 -   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
241 -unistd.h sys/param.h])
242 -   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
243 -strdup __argz_count __argz_stringify __argz_next])
244 -
245 -   if test "${ac_cv_func_stpcpy+set}" != "set"; then
246 -     AC_CHECK_FUNCS(stpcpy)
247 -   fi
248 -   if test "${ac_cv_func_stpcpy}" = "yes"; then
249 -     AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
250 -   fi
251 -
252 -   AM_LC_MESSAGES
253 -   AM_WITH_NLS
254 -
255 -   if test "x$CATOBJEXT" != "x"; then
256 -     if test "x$ALL_LINGUAS" = "x"; then
257 -       LINGUAS=
258 -     else
259 -       AC_MSG_CHECKING(for catalogs to be installed)
260 -       NEW_LINGUAS=
261 -       for lang in ${LINGUAS=$ALL_LINGUAS}; do
262 -         case "$ALL_LINGUAS" in
263 -          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
264 -         esac
265 -       done
266 -       LINGUAS=$NEW_LINGUAS
267 -       AC_MSG_RESULT($LINGUAS)
268 -     fi
269 -
270 -     dnl Construct list of names of catalog files to be constructed.
271 -     if test -n "$LINGUAS"; then
272 -       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
273 -     fi
274 -   fi
275 -
276 -   dnl The reference to <locale.h> in the installed <libintl.h> file
277 -   dnl must be resolved because we cannot expect the users of this
278 -   dnl to define HAVE_LOCALE_H.
279 -   if test $ac_cv_header_locale_h = yes; then
280 -     INCLUDE_LOCALE_H="#include <locale.h>"
281 -   else
282 -     INCLUDE_LOCALE_H="\
283 -/* The system does not provide the header <locale.h>.  Take care yourself.  */"
284 -   fi
285 -   AC_SUBST(INCLUDE_LOCALE_H)
286 -
287 -   dnl Determine which catalog format we have (if any is needed)
288 -   dnl For now we know about two different formats:
289 -   dnl   Linux libc-5 and the normal X/Open format
290 -   test -d intl || mkdir intl
291 -   if test "$CATOBJEXT" = ".cat"; then
292 -     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
293 -
294 -     dnl Transform the SED scripts while copying because some dumb SEDs
295 -     dnl cannot handle comments.
296 -     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
297 -   fi
298 -   dnl po2tbl.sed is always needed.
299 -   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
300 -     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
301 -
302 -   dnl In the intl/Makefile.in we have a special dependency which makes
303 -   dnl only sense for gettext.  We comment this out for non-gettext
304 -   dnl packages.
305 -   if test "$PACKAGE" = "gettext"; then
306 -     GT_NO="#NO#"
307 -     GT_YES=
308 -   else
309 -     GT_NO=
310 -     GT_YES="#YES#"
311 -   fi
312 -   AC_SUBST(GT_NO)
313 -   AC_SUBST(GT_YES)
314 -
315 -   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
316 -   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
317 -   dnl Try to locate is.
318 -   MKINSTALLDIRS=
319 -   if test -n "$ac_aux_dir"; then
320 -     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
321 -   fi
322 -   if test -z "$MKINSTALLDIRS"; then
323 -     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
324 -   fi
325 -   AC_SUBST(MKINSTALLDIRS)
326 -
327 -   dnl *** For now the libtool support in intl/Makefile is not for real.
328 -   l=
329 -   AC_SUBST(l)
330 -
331 -   dnl Generate list of files to be processed by xgettext which will
332 -   dnl be included in po/Makefile.
333 -   test -d po || mkdir po
334 -   case "$srcdir" in
335 -   .)
336 -     posrcprefix="../" ;;
337 -   /* | [[A-Za-z]]:*)
338 -     posrcprefix="$srcdir/" ;;
339 -   *)
340 -     posrcprefix="../$srcdir/" ;;
341 -   esac
342 -   rm -f po/POTFILES
343 -   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,        $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
344 -       < $srcdir/po/POTFILES.in > po/POTFILES
345 -  ])
346 -# Check whether LC_MESSAGES is available in <locale.h>.
347 -# Ulrich Drepper <drepper@cygnus.com>, 1995.
348 -#
349 -# This file can be copied and used freely without restrictions.  It can
350 -# be used in projects which are not available under the GNU Public License
351 -# but which still want to provide support for the GNU gettext functionality.
352 -# Please note that the actual code is *not* freely available.
353 -
354 -# serial 2
355 -
356 -AC_PREREQ(2.13)               dnl Minimum Autoconf version required.
357 -
358 -AC_DEFUN(AM_LC_MESSAGES,
359 -  [if test $ac_cv_header_locale_h = yes; then
360 -    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
361 -      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
362 -       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
363 -    if test $am_cv_val_LC_MESSAGES = yes; then
364 -      AC_DEFINE(HAVE_LC_MESSAGES, 1,
365 -               [Define if your locale.h file contains LC_MESSAGES.])
366 -    fi
367 -  fi])
368 -# Search path for a program which passes the given test.
369 -# Ulrich Drepper <drepper@cygnus.com>, 1996.
370 -#
371 -# This file can be copied and used freely without restrictions.  It can
372 -# be used in projects which are not available under the GNU Public License
373 -# but which still want to provide support for the GNU gettext functionality.
374 -# Please note that the actual code is *not* freely available.
375 -
376 -# serial 1
377 -
378 -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
379 -dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
380 -AC_DEFUN(AM_PATH_PROG_WITH_TEST,
381 -[# Extract the first word of "$2", so it can be a program name with args.
382 -set dummy $2; ac_word=[$]2
383 -AC_MSG_CHECKING([for $ac_word])
384 -AC_CACHE_VAL(ac_cv_path_$1,
385 -[case "[$]$1" in
386 -  /*)
387 -  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
388 -  ;;
389 -  *)
390 -  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
391 -  for ac_dir in ifelse([$5], , $PATH, [$5]); do
392 -    test -z "$ac_dir" && ac_dir=.
393 -    if test -f $ac_dir/$ac_word; then
394 -      if [$3]; then
395 -       ac_cv_path_$1="$ac_dir/$ac_word"
396 -       break
397 -      fi
398 -    fi
399 -  done
400 -  IFS="$ac_save_ifs"
401 -dnl If no 4th arg is given, leave the cache variable unset,
402 -dnl so AC_PATH_PROGS will keep looking.
403 -ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
404 -])dnl
405 -  ;;
406 -esac])dnl
407 -$1="$ac_cv_path_$1"
408 -if test -n "[$]$1"; then
409 -  AC_MSG_RESULT([$]$1)
410 -else
411 -  AC_MSG_RESULT(no)
412 -fi
413 -AC_SUBST($1)dnl
414 -])
415 diff -Nru lftp-2.3.9/m4/gettext.m4 lftp-2.3.9.new/m4/gettext.m4
416 --- lftp-2.3.9/m4/gettext.m4    Fri Feb 16 09:10:54 2001
417 +++ lftp-2.3.9.new/m4/gettext.m4        Thu Jan  1 01:00:00 1970
418 @@ -1,329 +0,0 @@
419 -# Macro to add for using GNU gettext.
420 -# Ulrich Drepper <drepper@cygnus.com>, 1995.
421 -#
422 -# This file can be copied and used freely without restrictions.  It can
423 -# be used in projects which are not available under the GNU Public License
424 -# but which still want to provide support for the GNU gettext functionality.
425 -# Please note that the actual code is *not* freely available.
426 -
427 -# serial 108
428 -
429 -AC_PREREQ(2.13)               dnl Minimum Autoconf version required.
430 -
431 -AC_DEFUN(AM_WITH_NLS,
432 -  [AC_MSG_CHECKING([whether NLS is requested])
433 -    dnl Default is enabled NLS
434 -    AC_ARG_ENABLE(nls,
435 -      [  --disable-nls           do not use Native Language Support],
436 -      USE_NLS=$enableval, USE_NLS=yes)
437 -    AC_MSG_RESULT($USE_NLS)
438 -    AC_SUBST(USE_NLS)
439 -
440 -    USE_INCLUDED_LIBINTL=no
441 -
442 -    AC_ARG_WITH(locale-dir,
443 -      [  --with-locale-dir=DIR   specify locale directory],
444 -      LOCALE_DIR=$withval)
445 -    test -z "$LOCALE_DIR" && LOCALE_DIR='$(datadir)/locale'
446 -    AC_SUBST(LOCALE_DIR)
447 -
448 -    AC_ARG_WITH(gnu-locale-dir,
449 -      [  --with-gnu-locale-dir=DIR specify GNU locale directory],
450 -      GNU_LOCALE_DIR=$withval)
451 -    test -z "$GNU_LOCALE_DIR" && GNU_LOCALE_DIR='$(prefix)/share/locale'
452 -    AC_SUBST(GNU_LOCALE_DIR)
453 -
454 -    dnl If we use NLS figure out what method
455 -    if test "$USE_NLS" = "yes"; then
456 -      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
457 -      AC_MSG_CHECKING([whether included gettext is requested])
458 -      AC_ARG_WITH(included-gettext,
459 -        [  --with-included-gettext use the GNU gettext library included here],
460 -        nls_cv_force_use_gnu_gettext=$withval,
461 -        nls_cv_force_use_gnu_gettext=no)
462 -      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
463 -
464 -      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
465 -      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
466 -        dnl User does not insist on using GNU NLS library.  Figure out what
467 -        dnl to use.  If gettext or catgets are available (in this order) we
468 -        dnl use this.  Else we have to fall back to GNU NLS library.
469 -       dnl catgets is only used if permitted by option --with-catgets.
470 -       nls_cv_header_intl=
471 -       nls_cv_header_libgt=
472 -       CATOBJEXT=NONE
473 -
474 -       AC_CHECK_HEADER(libintl.h,
475 -         [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
476 -           [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
477 -              gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
478 -
479 -          if test "$gt_cv_func_gettext_libc" != "yes"; then
480 -            AC_CHECK_LIB(intl, bindtextdomain,
481 -              [AC_CHECK_LIB(intl, gettext)])
482 -          fi
483 -
484 -          if test "$gt_cv_func_gettext_libc" = "yes" \
485 -             || test "$ac_cv_lib_intl_gettext" = "yes"; then
486 -             AC_DEFINE(HAVE_GETTEXT, 1,
487 -         [Define to 1 if you have gettext and don't want to use GNU gettext.])
488 -             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
489 -               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
490 -             if test "$MSGFMT" != "no"; then
491 -               AC_CHECK_FUNCS(dcgettext)
492 -               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
493 -               AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
494 -                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
495 -               AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
496 -                              return _nl_msg_cat_cntr],
497 -                 [CATOBJEXT=.gmo
498 -                  DATADIRNAME=share],
499 -                 [CATOBJEXT=.mo
500 -                  DATADIRNAME=lib])
501 -               INSTOBJEXT=.mo
502 -             fi
503 -           fi
504 -       ])
505 -
506 -        if test "$CATOBJEXT" = "NONE"; then
507 -         AC_MSG_CHECKING([whether catgets can be used])
508 -         AC_ARG_WITH(catgets,
509 -           [  --with-catgets          use catgets functions if available],
510 -           nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
511 -         AC_MSG_RESULT($nls_cv_use_catgets)
512 -
513 -         if test "$nls_cv_use_catgets" = "yes"; then
514 -           dnl No gettext in C library.  Try catgets next.
515 -           AC_CHECK_LIB(i, main)
516 -           AC_CHECK_FUNC(catgets,
517 -             [AC_DEFINE(HAVE_CATGETS, 1,
518 -                        [Define as 1 if you have catgets and don't want to use GNU gettext.])
519 -              INTLOBJS="\$(CATOBJS)"
520 -              AC_PATH_PROG(GENCAT, gencat, no)dnl
521 -              if test "$GENCAT" != "no"; then
522 -                AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
523 -                if test "$GMSGFMT" = "no"; then
524 -                  AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
525 -                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
526 -                fi
527 -                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
528 -                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
529 -                USE_INCLUDED_LIBINTL=yes
530 -                CATOBJEXT=.cat
531 -                INSTOBJEXT=.cat
532 -                DATADIRNAME=lib
533 -                INTLDEPS='$(top_builddir)/intl/libintl.a'
534 -                INTLLIBS=$INTLDEPS
535 -                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
536 -                nls_cv_header_intl=intl/libintl.h
537 -                nls_cv_header_libgt=intl/libgettext.h
538 -              fi])
539 -         fi
540 -        fi
541 -
542 -        if test "$CATOBJEXT" = "NONE"; then
543 -         dnl Neither gettext nor catgets in included in the C library.
544 -         dnl Fall back on GNU gettext library.
545 -         nls_cv_use_gnu_gettext=yes
546 -        fi
547 -      fi
548 -
549 -      if test "$nls_cv_use_gnu_gettext" = "yes"; then
550 -        dnl Mark actions used to generate GNU NLS library.
551 -        INTLOBJS="\$(GETTOBJS)"
552 -        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
553 -         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
554 -        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
555 -        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
556 -         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
557 -        AC_SUBST(MSGFMT)
558 -       USE_INCLUDED_LIBINTL=yes
559 -        CATOBJEXT=.gmo
560 -        INSTOBJEXT=.mo
561 -        DATADIRNAME=share
562 -       INTLDEPS='$(top_builddir)/intl/libintl.a'
563 -       INTLLIBS=$INTLDEPS
564 -       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
565 -        nls_cv_header_intl=intl/libintl.h
566 -        nls_cv_header_libgt=intl/libgettext.h
567 -      fi
568 -
569 -      dnl Test whether we really found GNU xgettext.
570 -      if test "$XGETTEXT" != ":"; then
571 -       dnl If it is no GNU xgettext we define it as : so that the
572 -       dnl Makefiles still can work.
573 -       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
574 -         : ;
575 -       else
576 -         AC_MSG_RESULT(
577 -           [found xgettext program is not GNU xgettext; ignore it])
578 -         XGETTEXT=":"
579 -       fi
580 -      fi
581 -
582 -      # We need to process the po/ directory.
583 -      POSUB=po
584 -    else
585 -      DATADIRNAME=share
586 -      nls_cv_header_intl=intl/libintl.h
587 -      nls_cv_header_libgt=intl/libgettext.h
588 -    fi
589 -    if test -z "$nls_cv_header_intl"; then
590 -      # Clean out junk possibly left behind by a previous configuration.
591 -      rm -f intl/libintl.h
592 -    fi
593 -    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
594 -    AC_OUTPUT_COMMANDS(
595 -     [case "$CONFIG_FILES" in *po/Makefile.in*)
596 -        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
597 -      esac])
598 -
599 -
600 -    # If this is used in GNU gettext we have to set USE_NLS to `yes'
601 -    # because some of the sources are only built for this goal.
602 -    if test "$PACKAGE" = gettext; then
603 -      USE_NLS=yes
604 -      USE_INCLUDED_LIBINTL=yes
605 -    fi
606 -
607 -    dnl These rules are solely for the distribution goal.  While doing this
608 -    dnl we only have to keep exactly one list of the available catalogs
609 -    dnl in configure.in.
610 -    for lang in $ALL_LINGUAS; do
611 -      GMOFILES="$GMOFILES $lang.gmo"
612 -      POFILES="$POFILES $lang.po"
613 -    done
614 -
615 -    dnl Make all variables we use known to autoconf.
616 -    AC_SUBST(USE_INCLUDED_LIBINTL)
617 -    AC_SUBST(CATALOGS)
618 -    AC_SUBST(CATOBJEXT)
619 -    AC_SUBST(DATADIRNAME)
620 -    AC_SUBST(GMOFILES)
621 -    AC_SUBST(INSTOBJEXT)
622 -    AC_SUBST(INTLDEPS)
623 -    AC_SUBST(INTLLIBS)
624 -    AC_SUBST(INTLOBJS)
625 -    AC_SUBST(POFILES)
626 -    AC_SUBST(POSUB)
627 -  ])
628 -
629 -AC_DEFUN(AM_GNU_GETTEXT,
630 -  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
631 -   AC_REQUIRE([AC_PROG_CC])dnl
632 -   AC_REQUIRE([AC_PROG_RANLIB])dnl
633 -   AC_REQUIRE([AC_ISC_POSIX])dnl
634 -   AC_REQUIRE([AC_HEADER_STDC])dnl
635 -   AC_REQUIRE([AC_C_CONST])dnl
636 -   AC_REQUIRE([AC_C_INLINE])dnl
637 -   AC_REQUIRE([AC_TYPE_OFF_T])dnl
638 -   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
639 -   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
640 -   AC_REQUIRE([AC_FUNC_MMAP])dnl
641 -
642 -   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
643 -unistd.h sys/param.h])
644 -   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
645 -strdup __argz_count __argz_stringify __argz_next])
646 -
647 -   if test "${ac_cv_func_stpcpy+set}" != "set"; then
648 -     AC_CHECK_FUNCS(stpcpy)
649 -   fi
650 -   if test "${ac_cv_func_stpcpy}" = "yes"; then
651 -     AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
652 -   fi
653 -
654 -   AM_LC_MESSAGES
655 -   AM_WITH_NLS
656 -
657 -   if test "x$CATOBJEXT" != "x"; then
658 -     if test "x$ALL_LINGUAS" = "x"; then
659 -       LINGUAS=
660 -     else
661 -       AC_MSG_CHECKING(for catalogs to be installed)
662 -       NEW_LINGUAS=
663 -       for lang in ${LINGUAS=$ALL_LINGUAS}; do
664 -         case "$ALL_LINGUAS" in
665 -          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
666 -         esac
667 -       done
668 -       LINGUAS=$NEW_LINGUAS
669 -       AC_MSG_RESULT($LINGUAS)
670 -     fi
671 -
672 -     dnl Construct list of names of catalog files to be constructed.
673 -     if test -n "$LINGUAS"; then
674 -       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
675 -     fi
676 -   fi
677 -
678 -   dnl The reference to <locale.h> in the installed <libintl.h> file
679 -   dnl must be resolved because we cannot expect the users of this
680 -   dnl to define HAVE_LOCALE_H.
681 -   if test $ac_cv_header_locale_h = yes; then
682 -     INCLUDE_LOCALE_H="#include <locale.h>"
683 -   else
684 -     INCLUDE_LOCALE_H="\
685 -/* The system does not provide the header <locale.h>.  Take care yourself.  */"
686 -   fi
687 -   AC_SUBST(INCLUDE_LOCALE_H)
688 -
689 -   dnl Determine which catalog format we have (if any is needed)
690 -   dnl For now we know about two different formats:
691 -   dnl   Linux libc-5 and the normal X/Open format
692 -   test -d intl || mkdir intl
693 -   if test "$CATOBJEXT" = ".cat"; then
694 -     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
695 -
696 -     dnl Transform the SED scripts while copying because some dumb SEDs
697 -     dnl cannot handle comments.
698 -     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
699 -   fi
700 -   dnl po2tbl.sed is always needed.
701 -   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
702 -     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
703 -
704 -   dnl In the intl/Makefile.in we have a special dependency which makes
705 -   dnl only sense for gettext.  We comment this out for non-gettext
706 -   dnl packages.
707 -   if test "$PACKAGE" = "gettext"; then
708 -     GT_NO="#NO#"
709 -     GT_YES=
710 -   else
711 -     GT_NO=
712 -     GT_YES="#YES#"
713 -   fi
714 -   AC_SUBST(GT_NO)
715 -   AC_SUBST(GT_YES)
716 -
717 -   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
718 -   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
719 -   dnl Try to locate is.
720 -   MKINSTALLDIRS=
721 -   if test -n "$ac_aux_dir"; then
722 -     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
723 -   fi
724 -   if test -z "$MKINSTALLDIRS"; then
725 -     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
726 -   fi
727 -   AC_SUBST(MKINSTALLDIRS)
728 -
729 -   dnl *** For now the libtool support in intl/Makefile is not for real.
730 -   l=
731 -   AC_SUBST(l)
732 -
733 -   dnl Generate list of files to be processed by xgettext which will
734 -   dnl be included in po/Makefile.
735 -   test -d po || mkdir po
736 -   case "$srcdir" in
737 -   .)
738 -     posrcprefix="../" ;;
739 -   /* | [[A-Za-z]]:*)
740 -     posrcprefix="$srcdir/" ;;
741 -   *)
742 -     posrcprefix="../$srcdir/" ;;
743 -   esac
744 -   rm -f po/POTFILES
745 -   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,        $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
746 -       < $srcdir/po/POTFILES.in > po/POTFILES
747 -  ])
This page took 0.119627 seconds and 3 git commands to generate.