1 diff -urN gdb-5.0.org/gdb/acinclude.m4 gdb-5.0/gdb/acinclude.m4
2 --- gdb-5.0.org/gdb/acinclude.m4 Tue Sep 5 16:45:26 2000
3 +++ gdb-5.0/gdb/acinclude.m4 Tue Sep 5 17:32:45 2000
5 AC_SUBST(TIX_BUILD_LIB_SPEC)
6 dnl AC_SUBST(TIX_LIB_SPEC)
10 + [AC_MSG_CHECKING([whether NLS is requested])
11 + dnl Default is enabled NLS
13 + [ --disable-nls do not use Native Language Support],
14 + USE_NLS=$enableval, USE_NLS=yes)
15 + AC_MSG_RESULT($USE_NLS)
18 + USE_INCLUDED_LIBINTL=no
20 + dnl If we use NLS figure out what method
21 + if test "$USE_NLS" = "yes"; then
22 + AC_DEFINE(ENABLE_NLS)
23 + AC_MSG_CHECKING([whether included gettext is requested])
24 + AC_ARG_WITH(included-gettext,
25 + [ --with-included-gettext use the GNU gettext library included here],
26 + nls_cv_force_use_gnu_gettext=$withval,
27 + nls_cv_force_use_gnu_gettext=no)
28 + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
30 + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
31 + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
32 + dnl User does not insist on using GNU NLS library. Figure out what
33 + dnl to use. If gettext or catgets are available (in this order) we
34 + dnl use this. Else we have to fall back to GNU NLS library.
35 + dnl catgets is only used if permitted by option --with-catgets.
37 + nls_cv_header_libgt=
40 + AC_CHECK_HEADER(libintl.h,
41 + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
42 + [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
43 + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
45 + if test "$gt_cv_func_gettext_libc" != "yes"; then
46 + AC_CHECK_LIB(intl, bindtextdomain,
47 + [AC_CACHE_CHECK([for gettext in libintl],
48 + gt_cv_func_gettext_libintl,
49 + [AC_TRY_LINK([], [return (int) gettext ("")],
50 + gt_cv_func_gettext_libintl=yes,
51 + gt_cv_func_gettext_libintl=no)])])
54 + if test "$gt_cv_func_gettext_libc" = "yes" \
55 + || test "$gt_cv_func_gettext_libintl" = "yes"; then
56 + AC_DEFINE(HAVE_GETTEXT)
57 + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
58 + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
59 + if test "$MSGFMT" != "no"; then
60 + AC_CHECK_FUNCS(dcgettext)
61 + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
62 + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
63 + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
64 + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
65 + return _nl_msg_cat_cntr],
75 + dnl In the standard gettext, we would now check for catgets.
76 + dnl However, we never want to use catgets for our releases.
78 + if test "$CATOBJEXT" = "NONE"; then
79 + dnl Neither gettext nor catgets in included in the C library.
80 + dnl Fall back on GNU gettext library.
81 + nls_cv_use_gnu_gettext=yes
85 + if test "$nls_cv_use_gnu_gettext" = "yes"; then
86 + dnl Mark actions used to generate GNU NLS library.
87 + INTLOBJS="\$(GETTOBJS)"
88 + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
89 + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
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)'`"], :)
94 + USE_INCLUDED_LIBINTL=yes
98 + INTLDEPS='$(top_builddir)/../intl/libintl.a'
100 + LIBS=`echo $LIBS | sed -e 's/-lintl//'`
101 + nls_cv_header_intl=libintl.h
102 + nls_cv_header_libgt=libgettext.h
105 + dnl Test whether we really found GNU xgettext.
106 + if test "$XGETTEXT" != ":"; then
107 + dnl If it is no GNU xgettext we define it as : so that the
108 + dnl Makefiles still can work.
109 + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
113 + [found xgettext programs is not GNU xgettext; ignore it])
118 + # We need to process the po/ directory.
122 + nls_cv_header_intl=libintl.h
123 + nls_cv_header_libgt=libgettext.h
126 + # If this is used in GNU gettext we have to set USE_NLS to `yes'
127 + # because some of the sources are only built for this goal.
128 + if test "$PACKAGE" = gettext; then
130 + USE_INCLUDED_LIBINTL=yes
133 + dnl These rules are solely for the distribution goal. While doing this
134 + dnl we only have to keep exactly one list of the available catalogs
135 + dnl in configure.in.
136 + for lang in $ALL_LINGUAS; do
137 + GMOFILES="$GMOFILES $lang.gmo"
138 + POFILES="$POFILES $lang.po"
141 + dnl Make all variables we use known to autoconf.
142 + AC_SUBST(USE_INCLUDED_LIBINTL)
144 + AC_SUBST(CATOBJEXT)
145 + AC_SUBST(DATADIRNAME)
147 + AC_SUBST(INSTOBJEXT)
155 +AC_DEFUN(CY_GNU_GETTEXT,
156 + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
157 + AC_REQUIRE([AC_PROG_CC])dnl
158 + AC_REQUIRE([AC_PROG_RANLIB])dnl
159 + AC_REQUIRE([AC_ISC_POSIX])dnl
160 + AC_REQUIRE([AC_HEADER_STDC])dnl
161 + AC_REQUIRE([AC_C_CONST])dnl
162 + AC_REQUIRE([AC_C_INLINE])dnl
163 + AC_REQUIRE([AC_TYPE_OFF_T])dnl
164 + AC_REQUIRE([AC_TYPE_SIZE_T])dnl
165 + AC_REQUIRE([AC_FUNC_ALLOCA])dnl
166 + AC_REQUIRE([AC_FUNC_MMAP])dnl
168 + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
169 +unistd.h values.h sys/param.h])
170 + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
171 +__argz_count __argz_stringify __argz_next])
173 + if test "${ac_cv_func_stpcpy+set}" != "set"; then
174 + AC_CHECK_FUNCS(stpcpy)
176 + if test "${ac_cv_func_stpcpy}" = "yes"; then
177 + AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
183 + if test "x$CATOBJEXT" != "x"; then
184 + if test "x$ALL_LINGUAS" = "x"; then
187 + AC_MSG_CHECKING(for catalogs to be installed)
189 + for lang in ${LINGUAS=$ALL_LINGUAS}; do
190 + case "$ALL_LINGUAS" in
191 + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
194 + LINGUAS=$NEW_LINGUAS
195 + AC_MSG_RESULT($LINGUAS)
198 + dnl Construct list of names of catalog files to be constructed.
199 + if test -n "$LINGUAS"; then
200 + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
204 + dnl The reference to <locale.h> in the installed <libintl.h> file
205 + dnl must be resolved because we cannot expect the users of this
206 + dnl to define HAVE_LOCALE_H.
207 + if test $ac_cv_header_locale_h = yes; then
208 + INCLUDE_LOCALE_H="#include <locale.h>"
210 + INCLUDE_LOCALE_H="\
211 +/* The system does not provide the header <locale.h>. Take care yourself. */"
213 + AC_SUBST(INCLUDE_LOCALE_H)
215 + dnl Determine which catalog format we have (if any is needed)
216 + dnl For now we know about two different formats:
217 + dnl Linux libc-5 and the normal X/Open format
218 + if test -f $srcdir/po2tbl.sed.in; then
219 + if test "$CATOBJEXT" = ".cat"; then
220 + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
222 + dnl Transform the SED scripts while copying because some dumb SEDs
223 + dnl cannot handle comments.
224 + sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
226 + dnl po2tbl.sed is always needed.
227 + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
228 + $srcdir/po2tbl.sed.in > po2tbl.sed
231 + dnl In the intl/Makefile.in we have a special dependency which makes
232 + dnl only sense for gettext. We comment this out for non-gettext
234 + if test "$PACKAGE" = "gettext"; then
244 + MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
245 + AC_SUBST(MKINSTALLDIRS)
247 + dnl *** For now the libtool support in intl/Makefile is not for real.
251 + dnl Generate list of files to be processed by xgettext which will
252 + dnl be included in po/Makefile. But only do this if the po directory
253 + dnl exists in srcdir.
254 + if test -d $srcdir/po; then
255 + test -d po || mkdir po
256 + if test "x$srcdir" != "x."; then
257 + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
258 + posrcprefix="$srcdir/"
260 + posrcprefix="../$srcdir/"
266 + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
267 + < $srcdir/po/POTFILES.in > po/POTFILES