comparison m4/intl.m4 @ 17954:65f6122c1b68

sync gettext .m4 files from gettext
author Karl Berry <karl@freefriends.org>
date Tue, 07 Apr 2015 09:46:17 -0700
parents ab58d4870664
children 0c0de4126b56
comparison
equal deleted inserted replaced
17953:d1b79c99331f 17954:65f6122c1b68
1 # intl.m4 serial 27 (gettext-0.18.3) 1 # intl.m4 serial 28 (gettext-0.19)
2 dnl Copyright (C) 1995-2015 Free Software Foundation, Inc. 2 dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation 3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it, 4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved. 5 dnl with or without modifications, as long as this notice is preserved.
6 dnl 6 dnl
7 dnl This file can can be used in projects which are not available under 7 dnl This file can can be used in projects which are not available under
40 AC_REQUIRE([gt_PRINTF_POSIX]) 40 AC_REQUIRE([gt_PRINTF_POSIX])
41 AC_REQUIRE([gl_GLIBC21])dnl 41 AC_REQUIRE([gl_GLIBC21])dnl
42 AC_REQUIRE([gl_XSIZE])dnl 42 AC_REQUIRE([gl_XSIZE])dnl
43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl 43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
44 AC_REQUIRE([gt_INTL_MACOSX])dnl 44 AC_REQUIRE([gt_INTL_MACOSX])dnl
45 AC_REQUIRE([gl_EXTERN_INLINE])dnl
46 AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
45 47
46 dnl Support for automake's --enable-silent-rules. 48 dnl Support for automake's --enable-silent-rules.
47 case "$enable_silent_rules" in 49 case "$enable_silent_rules" in
48 yes) INTL_DEFAULT_VERBOSITY=0;; 50 yes) INTL_DEFAULT_VERBOSITY=0;;
49 no) INTL_DEFAULT_VERBOSITY=1;; 51 no) INTL_DEFAULT_VERBOSITY=1;;
238 240
239 AM_ICONV 241 AM_ICONV
240 242
241 dnl intl/plural.c is generated from intl/plural.y. It requires bison, 243 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
242 dnl because plural.y uses bison specific features. It requires at least 244 dnl because plural.y uses bison specific features. It requires at least
243 dnl bison-1.26 because earlier versions generate a plural.c that doesn't 245 dnl bison-2.7 for %define api.pure.
244 dnl compile.
245 dnl bison is only needed for the maintainer (who touches plural.y). But in 246 dnl bison is only needed for the maintainer (who touches plural.y). But in
246 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put 247 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
247 dnl the rule in general Makefile. Now, some people carelessly touch the 248 dnl the rule in general Makefile. Now, some people carelessly touch the
248 dnl files or have a broken "make" program, hence the plural.c rule will 249 dnl files or have a broken "make" program, hence the plural.c rule will
249 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not 250 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
256 AC_MSG_CHECKING([version of bison]) 257 AC_MSG_CHECKING([version of bison])
257 changequote(<<,>>)dnl 258 changequote(<<,>>)dnl
258 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` 259 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
259 case $ac_prog_version in 260 case $ac_prog_version in
260 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 261 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
261 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) 262 2.[7-9]* | [3-9].*)
262 changequote([,])dnl 263 changequote([,])dnl
263 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 264 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
264 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 265 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
265 esac 266 esac
266 AC_MSG_RESULT([$ac_prog_version]) 267 AC_MSG_RESULT([$ac_prog_version])
267 fi 268 fi
268 if test $ac_verc_fail = yes; then 269 if test $ac_verc_fail = yes; then
269 INTLBISON=: 270 INTLBISON=:
270 fi 271 fi
271 ]) 272 ])
273
274 dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
275 dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
276 AC_DEFUN([gt_GL_ATTRIBUTE], [
277 m4_ifndef([gl_[]COMMON],
278 AH_VERBATIM([gt_gl_attribute],
279 [/* Define as a marker that can be attached to declarations that might not
280 be used. This helps to reduce warnings, such as from
281 GCC -Wunused-parameter. */
282 #ifndef _GL_UNUSED
283 # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
284 # define _GL_UNUSED __attribute__ ((__unused__))
285 # else
286 # define _GL_UNUSED
287 # endif
288 #endif
289
290 /* The __pure__ attribute was added in gcc 2.96. */
291 #ifndef _GL_ATTRIBUTE_PURE
292 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
293 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
294 # else
295 # define _GL_ATTRIBUTE_PURE /* empty */
296 # endif
297 #endif
298 ]))])