~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-10-27 09:44:27 UTC
  • mfrom: (8.4.29 sid)
  • Revision ID: package-import@ubuntu.com-20141027094427-g56dce6sg7pasdgm
Tags: 1.42.12-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
      Use the autotools-dev dh addon to update config.guess/config.sub for new
      ports.
  - debian/control:
      Regenerate with ./debian/rules debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# codeset.m4 serial AM1 (gettext-0.10.40)
2
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3
 
dnl This file is free software, distributed under the terms of the GNU
4
 
dnl General Public License.  As a special exception to the GNU General
5
 
dnl Public License, this file may be distributed as part of a program
6
 
dnl that contains a configuration script generated by Autoconf, under
7
 
dnl the same distribution terms as the rest of that program.
 
1
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
2
 
 
3
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
4
 
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
12
# PARTICULAR PURPOSE.
 
13
 
 
14
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 
15
# codeset.m4 serial 5 (gettext-0.18.2)
 
16
dnl Copyright (C) 2000-2002, 2006, 2008-2013 Free Software Foundation, Inc.
 
17
dnl This file is free software; the Free Software Foundation
 
18
dnl gives unlimited permission to copy and/or distribute it,
 
19
dnl with or without modifications, as long as this notice is preserved.
8
20
 
9
21
dnl From Bruno Haible.
10
22
 
11
23
AC_DEFUN([AM_LANGINFO_CODESET],
12
24
[
13
 
  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
14
 
    [AC_TRY_LINK([#include <langinfo.h>],
15
 
      [char* cs = nl_langinfo(CODESET);],
16
 
      am_cv_langinfo_codeset=yes,
17
 
      am_cv_langinfo_codeset=no)
 
25
  AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
 
26
    [AC_LINK_IFELSE(
 
27
       [AC_LANG_PROGRAM(
 
28
          [[#include <langinfo.h>]],
 
29
          [[char* cs = nl_langinfo(CODESET); return !cs;]])],
 
30
       [am_cv_langinfo_codeset=yes],
 
31
       [am_cv_langinfo_codeset=no])
18
32
    ])
19
33
  if test $am_cv_langinfo_codeset = yes; then
20
 
    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
 
34
    AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
21
35
      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
22
36
  fi
23
37
])
24
 
# gettext.m4 serial 28 (gettext-0.13)
25
 
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
26
 
dnl This file is free software, distributed under the terms of the GNU
27
 
dnl General Public License.  As a special exception to the GNU General
28
 
dnl Public License, this file may be distributed as part of a program
29
 
dnl that contains a configuration script generated by Autoconf, under
30
 
dnl the same distribution terms as the rest of that program.
 
38
 
 
39
dnl 'extern inline' a la ISO C99.
 
40
 
 
41
dnl Copyright 2012-2013 Free Software Foundation, Inc.
 
42
dnl This file is free software; the Free Software Foundation
 
43
dnl gives unlimited permission to copy and/or distribute it,
 
44
dnl with or without modifications, as long as this notice is preserved.
 
45
 
 
46
AC_DEFUN([gl_EXTERN_INLINE],
 
47
[
 
48
  AH_VERBATIM([extern_inline],
 
49
[/* Please see the Gnulib manual for how to use these macros.
 
50
 
 
51
   Suppress extern inline with HP-UX cc, as it appears to be broken; see
 
52
   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
 
53
 
 
54
   Suppress extern inline with Sun C in standards-conformance mode, as it
 
55
   mishandles inline functions that call each other.  E.g., for 'inline void f
 
56
   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
 
57
   'reference to static identifier "f" in extern inline function'.
 
58
   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
 
59
 
 
60
   Suppress the use of extern inline on Apple's platforms, as Libc at least
 
61
   through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
 
62
   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
 
63
   Perhaps Apple will fix this some day.  */
 
64
#if ((__GNUC__ \
 
65
      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
 
66
      : (199901L <= __STDC_VERSION__ \
 
67
         && !defined __HP_cc \
 
68
         && !(defined __SUNPRO_C && __STDC__))) \
 
69
     && !defined __APPLE__)
 
70
# define _GL_INLINE inline
 
71
# define _GL_EXTERN_INLINE extern inline
 
72
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
 
73
       && !defined __APPLE__)
 
74
# if __GNUC_GNU_INLINE__
 
75
   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 
76
#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
 
77
# else
 
78
#  define _GL_INLINE extern inline
 
79
# endif
 
80
# define _GL_EXTERN_INLINE extern
 
81
#else
 
82
# define _GL_INLINE static _GL_UNUSED
 
83
# define _GL_EXTERN_INLINE static _GL_UNUSED
 
84
#endif
 
85
 
 
86
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
 
87
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
 
88
#  define _GL_INLINE_HEADER_CONST_PRAGMA
 
89
# else
 
90
#  define _GL_INLINE_HEADER_CONST_PRAGMA \
 
91
     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
 
92
# endif
 
93
  /* Suppress GCC's bogus "no previous prototype for 'FOO'"
 
94
     and "no previous declaration for 'FOO'"  diagnostics,
 
95
     when FOO is an inline function in the header; see
 
96
     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.  */
 
97
# define _GL_INLINE_HEADER_BEGIN \
 
98
    _Pragma ("GCC diagnostic push") \
 
99
    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
 
100
    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
 
101
    _GL_INLINE_HEADER_CONST_PRAGMA
 
102
# define _GL_INLINE_HEADER_END \
 
103
    _Pragma ("GCC diagnostic pop")
 
104
#else
 
105
# define _GL_INLINE_HEADER_BEGIN
 
106
# define _GL_INLINE_HEADER_END
 
107
#endif])
 
108
])
 
109
 
 
110
# fcntl-o.m4 serial 4
 
111
dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
 
112
dnl This file is free software; the Free Software Foundation
 
113
dnl gives unlimited permission to copy and/or distribute it,
 
114
dnl with or without modifications, as long as this notice is preserved.
 
115
 
 
116
dnl Written by Paul Eggert.
 
117
 
 
118
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
 
119
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
 
120
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
 
121
AC_DEFUN([gl_FCNTL_O_FLAGS],
 
122
[
 
123
  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
 
124
  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
 
125
  dnl AC_GNU_SOURCE.
 
126
  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
 
127
    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
 
128
    [AC_REQUIRE([AC_GNU_SOURCE])])
 
129
 
 
130
  AC_CHECK_HEADERS_ONCE([unistd.h])
 
131
  AC_CHECK_FUNCS_ONCE([symlink])
 
132
  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
 
133
    [AC_RUN_IFELSE(
 
134
       [AC_LANG_PROGRAM(
 
135
          [[#include <sys/types.h>
 
136
           #include <sys/stat.h>
 
137
           #if HAVE_UNISTD_H
 
138
           # include <unistd.h>
 
139
           #else /* on Windows with MSVC */
 
140
           # include <io.h>
 
141
           # include <stdlib.h>
 
142
           # defined sleep(n) _sleep ((n) * 1000)
 
143
           #endif
 
144
           #include <fcntl.h>
 
145
           #ifndef O_NOATIME
 
146
            #define O_NOATIME 0
 
147
           #endif
 
148
           #ifndef O_NOFOLLOW
 
149
            #define O_NOFOLLOW 0
 
150
           #endif
 
151
           static int const constants[] =
 
152
            {
 
153
              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
 
154
              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
 
155
            };
 
156
          ]],
 
157
          [[
 
158
            int result = !constants;
 
159
            #if HAVE_SYMLINK
 
160
            {
 
161
              static char const sym[] = "conftest.sym";
 
162
              if (symlink ("/dev/null", sym) != 0)
 
163
                result |= 2;
 
164
              else
 
165
                {
 
166
                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
 
167
                  if (fd >= 0)
 
168
                    {
 
169
                      close (fd);
 
170
                      result |= 4;
 
171
                    }
 
172
                }
 
173
              if (unlink (sym) != 0 || symlink (".", sym) != 0)
 
174
                result |= 2;
 
175
              else
 
176
                {
 
177
                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
 
178
                  if (fd >= 0)
 
179
                    {
 
180
                      close (fd);
 
181
                      result |= 4;
 
182
                    }
 
183
                }
 
184
              unlink (sym);
 
185
            }
 
186
            #endif
 
187
            {
 
188
              static char const file[] = "confdefs.h";
 
189
              int fd = open (file, O_RDONLY | O_NOATIME);
 
190
              if (fd < 0)
 
191
                result |= 8;
 
192
              else
 
193
                {
 
194
                  struct stat st0;
 
195
                  if (fstat (fd, &st0) != 0)
 
196
                    result |= 16;
 
197
                  else
 
198
                    {
 
199
                      char c;
 
200
                      sleep (1);
 
201
                      if (read (fd, &c, 1) != 1)
 
202
                        result |= 24;
 
203
                      else
 
204
                        {
 
205
                          if (close (fd) != 0)
 
206
                            result |= 32;
 
207
                          else
 
208
                            {
 
209
                              struct stat st1;
 
210
                              if (stat (file, &st1) != 0)
 
211
                                result |= 40;
 
212
                              else
 
213
                                if (st0.st_atime != st1.st_atime)
 
214
                                  result |= 64;
 
215
                            }
 
216
                        }
 
217
                    }
 
218
                }
 
219
            }
 
220
            return result;]])],
 
221
       [gl_cv_header_working_fcntl_h=yes],
 
222
       [case $? in #(
 
223
        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
 
224
        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
 
225
        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
 
226
         *) gl_cv_header_working_fcntl_h='no';;
 
227
        esac],
 
228
       [gl_cv_header_working_fcntl_h=cross-compiling])])
 
229
 
 
230
  case $gl_cv_header_working_fcntl_h in #(
 
231
  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
 
232
  *) ac_val=1;;
 
233
  esac
 
234
  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
 
235
    [Define to 1 if O_NOATIME works.])
 
236
 
 
237
  case $gl_cv_header_working_fcntl_h in #(
 
238
  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
 
239
  *) ac_val=1;;
 
240
  esac
 
241
  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
 
242
    [Define to 1 if O_NOFOLLOW works.])
 
243
])
 
244
 
 
245
# gettext.m4 serial 66 (gettext-0.18.2)
 
246
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 
247
dnl This file is free software; the Free Software Foundation
 
248
dnl gives unlimited permission to copy and/or distribute it,
 
249
dnl with or without modifications, as long as this notice is preserved.
31
250
dnl
32
251
dnl This file can can be used in projects which are not available under
33
252
dnl the GNU General Public License or the GNU Library General Public
40
259
 
41
260
dnl Authors:
42
261
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
43
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
262
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
44
263
 
45
264
dnl Macro to add for using GNU gettext.
46
265
 
60
279
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
61
280
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
62
281
dnl INTLDIR is used to find the intl libraries.  If empty,
63
 
dnl    the value `$(top_builddir)/intl/' is used.
 
282
dnl    the value '$(top_builddir)/intl/' is used.
64
283
dnl
65
284
dnl The result of the configuration is one of three cases:
66
285
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
85
304
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
86
305
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
87
306
])])])])])
 
307
  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
 
308
    [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
88
309
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
89
310
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
90
311
])])])])
91
 
  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
92
 
  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
 
312
  define([gt_included_intl],
 
313
    ifelse([$1], [external],
 
314
      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
 
315
      [yes]))
 
316
  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
317
  gt_NEEDS_INIT
 
318
  AM_GNU_GETTEXT_NEED([$2])
93
319
 
94
320
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
95
321
  ifelse(gt_included_intl, yes, [
103
329
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
104
330
  dnl Ideally we would do this search only after the
105
331
  dnl      if test "$USE_NLS" = "yes"; then
106
 
  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
332
  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
107
333
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
108
334
  dnl the configure script would need to contain the same shell code
109
335
  dnl again, outside any 'if'. There are two solutions:
115
341
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
116
342
  ])
117
343
 
 
344
  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
 
345
  gt_INTL_MACOSX
 
346
 
118
347
  dnl Set USE_NLS.
119
 
  AM_NLS
 
348
  AC_REQUIRE([AM_NLS])
120
349
 
121
350
  ifelse(gt_included_intl, yes, [
122
351
    BUILD_INCLUDED_LIBINTL=no
126
355
  LTLIBINTL=
127
356
  POSUB=
128
357
 
 
358
  dnl Add a version number to the cache macros.
 
359
  case " $gt_needs " in
 
360
    *" need-formatstring-macros "*) gt_api_version=3 ;;
 
361
    *" need-ngettext "*) gt_api_version=2 ;;
 
362
    *) gt_api_version=1 ;;
 
363
  esac
 
364
  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
 
365
  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
 
366
 
129
367
  dnl If we use NLS figure out what method
130
368
  if test "$USE_NLS" = "yes"; then
131
369
    gt_use_preinstalled_gnugettext=no
132
370
    ifelse(gt_included_intl, yes, [
133
371
      AC_MSG_CHECKING([whether included gettext is requested])
134
 
      AC_ARG_WITH(included-gettext,
 
372
      AC_ARG_WITH([included-gettext],
135
373
        [  --with-included-gettext use the GNU gettext library included here],
136
374
        nls_cv_force_use_gnu_gettext=$withval,
137
375
        nls_cv_force_use_gnu_gettext=no)
138
 
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
376
      AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
139
377
 
140
378
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
141
379
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
144
382
        dnl to use.  If GNU gettext is available we use this.  Else we have
145
383
        dnl to fall back to GNU NLS library.
146
384
 
147
 
        dnl Add a version number to the cache macros.
148
 
        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
149
 
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
150
 
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
151
 
 
152
 
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
153
 
         [AC_TRY_LINK([#include <libintl.h>
154
 
]ifelse([$2], [need-formatstring-macros],
155
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
385
        if test $gt_api_version -ge 3; then
 
386
          gt_revision_test_code='
 
387
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
156
388
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
157
389
#endif
158
390
changequote(,)dnl
159
391
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
160
392
changequote([,])dnl
161
 
], [])[extern int _nl_msg_cat_cntr;
162
 
extern int *_nl_domain_bindings;],
163
 
            [bindtextdomain ("", "");
164
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
165
 
            gt_cv_func_gnugettext_libc=yes,
166
 
            gt_cv_func_gnugettext_libc=no)])
167
 
 
168
 
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
393
'
 
394
        else
 
395
          gt_revision_test_code=
 
396
        fi
 
397
        if test $gt_api_version -ge 2; then
 
398
          gt_expression_test_code=' + * ngettext ("", "", 0)'
 
399
        else
 
400
          gt_expression_test_code=
 
401
        fi
 
402
 
 
403
        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
 
404
         [AC_LINK_IFELSE(
 
405
            [AC_LANG_PROGRAM(
 
406
               [[
 
407
#include <libintl.h>
 
408
$gt_revision_test_code
 
409
extern int _nl_msg_cat_cntr;
 
410
extern int *_nl_domain_bindings;
 
411
               ]],
 
412
               [[
 
413
bindtextdomain ("", "");
 
414
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
 
415
               ]])],
 
416
            [eval "$gt_func_gnugettext_libc=yes"],
 
417
            [eval "$gt_func_gnugettext_libc=no"])])
 
418
 
 
419
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
169
420
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
170
421
          ifelse(gt_included_intl, yes, , [
171
422
            AM_ICONV_LINK
176
427
          dnl even if libiconv doesn't exist.
177
428
          AC_LIB_LINKFLAGS_BODY([intl])
178
429
          AC_CACHE_CHECK([for GNU gettext in libintl],
179
 
            gt_cv_func_gnugettext_libintl,
 
430
            [$gt_func_gnugettext_libintl],
180
431
           [gt_save_CPPFLAGS="$CPPFLAGS"
181
432
            CPPFLAGS="$CPPFLAGS $INCINTL"
182
433
            gt_save_LIBS="$LIBS"
183
434
            LIBS="$LIBS $LIBINTL"
184
435
            dnl Now see whether libintl exists and does not depend on libiconv.
185
 
            AC_TRY_LINK([#include <libintl.h>
186
 
]ifelse([$2], [need-formatstring-macros],
187
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
188
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
189
 
#endif
190
 
changequote(,)dnl
191
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
192
 
changequote([,])dnl
193
 
], [])[extern int _nl_msg_cat_cntr;
 
436
            AC_LINK_IFELSE(
 
437
              [AC_LANG_PROGRAM(
 
438
                 [[
 
439
#include <libintl.h>
 
440
$gt_revision_test_code
 
441
extern int _nl_msg_cat_cntr;
194
442
extern
195
443
#ifdef __cplusplus
196
444
"C"
197
445
#endif
198
 
const char *_nl_expand_alias ();],
199
 
              [bindtextdomain ("", "");
200
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
201
 
              gt_cv_func_gnugettext_libintl=yes,
202
 
              gt_cv_func_gnugettext_libintl=no)
 
446
const char *_nl_expand_alias (const char *);
 
447
                 ]],
 
448
                 [[
 
449
bindtextdomain ("", "");
 
450
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
 
451
                 ]])],
 
452
              [eval "$gt_func_gnugettext_libintl=yes"],
 
453
              [eval "$gt_func_gnugettext_libintl=no"])
203
454
            dnl Now see whether libintl exists and depends on libiconv.
204
 
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
 
455
            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
205
456
              LIBS="$LIBS $LIBICONV"
206
 
              AC_TRY_LINK([#include <libintl.h>
207
 
]ifelse([$2], [need-formatstring-macros],
208
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
209
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
210
 
#endif
211
 
changequote(,)dnl
212
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
213
 
changequote([,])dnl
214
 
], [])[extern int _nl_msg_cat_cntr;
 
457
              AC_LINK_IFELSE(
 
458
                [AC_LANG_PROGRAM(
 
459
                   [[
 
460
#include <libintl.h>
 
461
$gt_revision_test_code
 
462
extern int _nl_msg_cat_cntr;
215
463
extern
216
464
#ifdef __cplusplus
217
465
"C"
218
466
#endif
219
 
const char *_nl_expand_alias ();],
220
 
                [bindtextdomain ("", "");
221
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
222
 
               [LIBINTL="$LIBINTL $LIBICONV"
223
 
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
224
 
                gt_cv_func_gnugettext_libintl=yes
225
 
               ])
 
467
const char *_nl_expand_alias (const char *);
 
468
                   ]],
 
469
                   [[
 
470
bindtextdomain ("", "");
 
471
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
 
472
                   ]])],
 
473
                [LIBINTL="$LIBINTL $LIBICONV"
 
474
                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
 
475
                 eval "$gt_func_gnugettext_libintl=yes"
 
476
                ])
226
477
            fi
227
478
            CPPFLAGS="$gt_save_CPPFLAGS"
228
479
            LIBS="$gt_save_LIBS"])
232
483
        dnl use it.  But if this macro is used in GNU gettext, and GNU
233
484
        dnl gettext is already preinstalled in libintl, we update this
234
485
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
235
 
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
236
 
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
 
486
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
 
487
           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
237
488
                && test "$PACKAGE" != gettext-runtime \
238
489
                && test "$PACKAGE" != gettext-tools; }; then
239
490
          gt_use_preinstalled_gnugettext=yes
256
507
        dnl Mark actions used to generate GNU NLS library.
257
508
        BUILD_INCLUDED_LIBINTL=yes
258
509
        USE_INCLUDED_LIBINTL=yes
259
 
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
260
 
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
 
510
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
 
511
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
261
512
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
262
513
      fi
263
514
 
 
515
      CATOBJEXT=
264
516
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
265
517
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
266
518
        dnl Mark actions to use GNU gettext tools.
268
520
      fi
269
521
    ])
270
522
 
 
523
    if test -n "$INTL_MACOSX_LIBS"; then
 
524
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
525
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
526
        dnl Some extra flags are needed during linking.
 
527
        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
 
528
        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
 
529
      fi
 
530
    fi
 
531
 
271
532
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
272
533
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
273
 
      AC_DEFINE(ENABLE_NLS, 1,
 
534
      AC_DEFINE([ENABLE_NLS], [1],
274
535
        [Define to 1 if translation of program messages to the user's native language
275
536
   is requested.])
276
537
    else
283
544
  if test "$USE_NLS" = "yes"; then
284
545
    AC_MSG_CHECKING([where the gettext function comes from])
285
546
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
286
 
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
547
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
287
548
        gt_source="external libintl"
288
549
      else
289
550
        gt_source="libc"
297
558
  if test "$USE_NLS" = "yes"; then
298
559
 
299
560
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
300
 
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
561
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
301
562
        AC_MSG_CHECKING([how to link with libintl])
302
563
        AC_MSG_RESULT([$LIBINTL])
303
564
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
304
565
      fi
305
566
 
306
567
      dnl For backward compatibility. Some packages may be using this.
307
 
      AC_DEFINE(HAVE_GETTEXT, 1,
 
568
      AC_DEFINE([HAVE_GETTEXT], [1],
308
569
       [Define if the GNU gettext() function is already present or preinstalled.])
309
 
      AC_DEFINE(HAVE_DCGETTEXT, 1,
 
570
      AC_DEFINE([HAVE_DCGETTEXT], [1],
310
571
       [Define if the GNU dcgettext() function is already present or preinstalled.])
311
572
    fi
312
573
 
322
583
    fi
323
584
 
324
585
    dnl Make all variables we use known to autoconf.
325
 
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
326
 
    AC_SUBST(USE_INCLUDED_LIBINTL)
327
 
    AC_SUBST(CATOBJEXT)
 
586
    AC_SUBST([BUILD_INCLUDED_LIBINTL])
 
587
    AC_SUBST([USE_INCLUDED_LIBINTL])
 
588
    AC_SUBST([CATOBJEXT])
328
589
 
329
590
    dnl For backward compatibility. Some configure.ins may be using this.
330
591
    nls_cv_header_intl=
332
593
 
333
594
    dnl For backward compatibility. Some Makefiles may be using this.
334
595
    DATADIRNAME=share
335
 
    AC_SUBST(DATADIRNAME)
 
596
    AC_SUBST([DATADIRNAME])
336
597
 
337
598
    dnl For backward compatibility. Some Makefiles may be using this.
338
599
    INSTOBJEXT=.mo
339
 
    AC_SUBST(INSTOBJEXT)
 
600
    AC_SUBST([INSTOBJEXT])
340
601
 
341
602
    dnl For backward compatibility. Some Makefiles may be using this.
342
603
    GENCAT=gencat
343
 
    AC_SUBST(GENCAT)
 
604
    AC_SUBST([GENCAT])
344
605
 
345
606
    dnl For backward compatibility. Some Makefiles may be using this.
 
607
    INTLOBJS=
346
608
    if test "$USE_INCLUDED_LIBINTL" = yes; then
347
609
      INTLOBJS="\$(GETTOBJS)"
348
610
    fi
349
 
    AC_SUBST(INTLOBJS)
 
611
    AC_SUBST([INTLOBJS])
350
612
 
351
613
    dnl Enable libtool support if the surrounding package wishes it.
352
614
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
353
 
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
 
615
    AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
354
616
  ])
355
617
 
356
618
  dnl For backward compatibility. Some Makefiles may be using this.
357
619
  INTLLIBS="$LIBINTL"
358
 
  AC_SUBST(INTLLIBS)
 
620
  AC_SUBST([INTLLIBS])
359
621
 
360
622
  dnl Make all documented variables known to autoconf.
361
 
  AC_SUBST(LIBINTL)
362
 
  AC_SUBST(LTLIBINTL)
363
 
  AC_SUBST(POSUB)
364
 
])
365
 
 
366
 
 
367
 
dnl Checks for all prerequisites of the intl subdirectory,
368
 
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
369
 
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
370
 
AC_DEFUN([AM_INTL_SUBDIR],
371
 
[
372
 
  AC_REQUIRE([AC_PROG_INSTALL])dnl
373
 
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
374
 
  AC_REQUIRE([AC_PROG_CC])dnl
375
 
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
376
 
  AC_REQUIRE([AC_PROG_RANLIB])dnl
377
 
  AC_REQUIRE([AC_ISC_POSIX])dnl
378
 
  AC_REQUIRE([AC_HEADER_STDC])dnl
379
 
  AC_REQUIRE([AC_C_CONST])dnl
380
 
  AC_REQUIRE([bh_C_SIGNED])dnl
381
 
  AC_REQUIRE([AC_C_INLINE])dnl
382
 
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
383
 
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
384
 
  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
385
 
  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
386
 
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
387
 
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
388
 
  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
389
 
  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
390
 
  AC_REQUIRE([gt_TYPE_INTMAX_T])
391
 
  AC_REQUIRE([gt_PRINTF_POSIX])
392
 
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
393
 
  AC_REQUIRE([AC_FUNC_MMAP])dnl
394
 
  AC_REQUIRE([jm_GLIBC21])dnl
395
 
  AC_REQUIRE([gt_INTDIV0])dnl
396
 
  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
397
 
  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
398
 
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
399
 
  AC_REQUIRE([gl_XSIZE])dnl
400
 
 
401
 
  AC_CHECK_TYPE([ptrdiff_t], ,
402
 
    [AC_DEFINE([ptrdiff_t], [long],
403
 
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
404
 
    ])
405
 
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
406
 
stdlib.h string.h unistd.h sys/param.h])
407
 
  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
408
 
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
409
 
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
410
 
__fsetlocking])
411
 
 
412
 
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
413
 
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
414
 
  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
415
 
  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
416
 
 
417
 
  dnl Use the *_unlocked functions only if they are declared.
418
 
  dnl (because some of them were defined without being declared in Solaris
419
 
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
420
 
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
421
 
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
422
 
  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
423
 
  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
424
 
  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
425
 
 
426
 
  case $gt_cv_func_printf_posix in
427
 
    *yes) HAVE_POSIX_PRINTF=1 ;;
428
 
    *) HAVE_POSIX_PRINTF=0 ;;
429
 
  esac
430
 
  AC_SUBST([HAVE_POSIX_PRINTF])
431
 
  if test "$ac_cv_func_asprintf" = yes; then
432
 
    HAVE_ASPRINTF=1
433
 
  else
434
 
    HAVE_ASPRINTF=0
435
 
  fi
436
 
  AC_SUBST([HAVE_ASPRINTF])
437
 
  if test "$ac_cv_func_snprintf" = yes; then
438
 
    HAVE_SNPRINTF=1
439
 
  else
440
 
    HAVE_SNPRINTF=0
441
 
  fi
442
 
  AC_SUBST([HAVE_SNPRINTF])
443
 
  if test "$ac_cv_func_wprintf" = yes; then
444
 
    HAVE_WPRINTF=1
445
 
  else
446
 
    HAVE_WPRINTF=0
447
 
  fi
448
 
  AC_SUBST([HAVE_WPRINTF])
449
 
 
450
 
  AM_ICONV
451
 
  AM_LANGINFO_CODESET
452
 
  if test $ac_cv_header_locale_h = yes; then
453
 
    AM_LC_MESSAGES
454
 
  fi
455
 
 
456
 
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
457
 
  dnl because plural.y uses bison specific features. It requires at least
458
 
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
459
 
  dnl compile.
460
 
  dnl bison is only needed for the maintainer (who touches plural.y). But in
461
 
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
462
 
  dnl the rule in general Makefile. Now, some people carelessly touch the
463
 
  dnl files or have a broken "make" program, hence the plural.c rule will
464
 
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
465
 
  dnl present or too old.
466
 
  AC_CHECK_PROGS([INTLBISON], [bison])
467
 
  if test -z "$INTLBISON"; then
468
 
    ac_verc_fail=yes
469
 
  else
470
 
    dnl Found it, now check the version.
471
 
    AC_MSG_CHECKING([version of bison])
472
 
changequote(<<,>>)dnl
473
 
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
474
 
    case $ac_prog_version in
475
 
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
476
 
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
477
 
changequote([,])dnl
478
 
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
479
 
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
480
 
    esac
481
 
    AC_MSG_RESULT([$ac_prog_version])
482
 
  fi
483
 
  if test $ac_verc_fail = yes; then
484
 
    INTLBISON=:
485
 
  fi
486
 
])
487
 
 
488
 
 
489
 
dnl gt_CHECK_DECL(FUNC, INCLUDES)
490
 
dnl Check whether a function is declared.
491
 
AC_DEFUN([gt_CHECK_DECL],
492
 
[
493
 
  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
494
 
    [AC_TRY_COMPILE([$2], [
495
 
#ifndef $1
496
 
  char *p = (char *) $1;
497
 
#endif
498
 
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
499
 
  if test $ac_cv_have_decl_$1 = yes; then
500
 
    gt_value=1
501
 
  else
502
 
    gt_value=0
503
 
  fi
504
 
  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
505
 
    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
 
623
  AC_SUBST([LIBINTL])
 
624
  AC_SUBST([LTLIBINTL])
 
625
  AC_SUBST([POSUB])
 
626
])
 
627
 
 
628
 
 
629
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
 
630
m4_define([gt_NEEDS_INIT],
 
631
[
 
632
  m4_divert_text([DEFAULTS], [gt_needs=])
 
633
  m4_define([gt_NEEDS_INIT], [])
 
634
])
 
635
 
 
636
 
 
637
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
 
638
AC_DEFUN([AM_GNU_GETTEXT_NEED],
 
639
[
 
640
  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
506
641
])
507
642
 
508
643
 
509
644
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
510
645
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
511
 
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
512
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
513
 
dnl This file is free software, distributed under the terms of the GNU
514
 
dnl General Public License.  As a special exception to the GNU General
515
 
dnl Public License, this file may be distributed as part of a program
516
 
dnl that contains a configuration script generated by Autoconf, under
517
 
dnl the same distribution terms as the rest of that program.
518
 
 
519
 
# Test for the GNU C Library, version 2.1 or newer.
 
646
 
 
647
# glibc2.m4 serial 3
 
648
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
 
649
dnl Inc.
 
650
dnl This file is free software; the Free Software Foundation
 
651
dnl gives unlimited permission to copy and/or distribute it,
 
652
dnl with or without modifications, as long as this notice is preserved.
 
653
 
 
654
# Test for the GNU C Library, version 2.0 or newer.
520
655
# From Bruno Haible.
521
656
 
522
 
AC_DEFUN([jm_GLIBC21],
 
657
AC_DEFUN([gt_GLIBC2],
523
658
  [
524
 
    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
525
 
      ac_cv_gnu_library_2_1,
 
659
    AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
 
660
      [ac_cv_gnu_library_2],
526
661
      [AC_EGREP_CPP([Lucky GNU user],
527
 
        [
 
662
        [
 
663
#include <features.h>
 
664
#ifdef __GNU_LIBRARY__
 
665
 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
 
666
  Lucky GNU user
 
667
 #endif
 
668
#endif
 
669
        ],
 
670
        [ac_cv_gnu_library_2=yes],
 
671
        [ac_cv_gnu_library_2=no])
 
672
      ]
 
673
    )
 
674
    AC_SUBST([GLIBC2])
 
675
    GLIBC2="$ac_cv_gnu_library_2"
 
676
  ]
 
677
)
 
678
 
 
679
# glibc21.m4 serial 5
 
680
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
 
681
dnl Inc.
 
682
dnl This file is free software; the Free Software Foundation
 
683
dnl gives unlimited permission to copy and/or distribute it,
 
684
dnl with or without modifications, as long as this notice is preserved.
 
685
 
 
686
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
 
687
# From Bruno Haible.
 
688
 
 
689
AC_DEFUN([gl_GLIBC21],
 
690
  [
 
691
    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
 
692
      [ac_cv_gnu_library_2_1],
 
693
      [AC_EGREP_CPP([Lucky],
 
694
        [
528
695
#include <features.h>
529
696
#ifdef __GNU_LIBRARY__
530
697
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
531
698
  Lucky GNU user
532
699
 #endif
533
700
#endif
534
 
        ],
535
 
        ac_cv_gnu_library_2_1=yes,
536
 
        ac_cv_gnu_library_2_1=no)
 
701
#ifdef __UCLIBC__
 
702
 Lucky user
 
703
#endif
 
704
        ],
 
705
        [ac_cv_gnu_library_2_1=yes],
 
706
        [ac_cv_gnu_library_2_1=no])
537
707
      ]
538
708
    )
539
 
    AC_SUBST(GLIBC21)
 
709
    AC_SUBST([GLIBC21])
540
710
    GLIBC21="$ac_cv_gnu_library_2_1"
541
711
  ]
542
712
)
543
 
# iconv.m4 serial AM4 (gettext-0.11.3)
544
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
545
 
dnl This file is free software, distributed under the terms of the GNU
546
 
dnl General Public License.  As a special exception to the GNU General
547
 
dnl Public License, this file may be distributed as part of a program
548
 
dnl that contains a configuration script generated by Autoconf, under
549
 
dnl the same distribution terms as the rest of that program.
 
713
 
 
714
# iconv.m4 serial 18 (gettext-0.18.2)
 
715
dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
 
716
dnl This file is free software; the Free Software Foundation
 
717
dnl gives unlimited permission to copy and/or distribute it,
 
718
dnl with or without modifications, as long as this notice is preserved.
550
719
 
551
720
dnl From Bruno Haible.
552
721
 
565
734
[
566
735
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
567
736
  dnl those with the standalone portable GNU libiconv installed).
 
737
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
568
738
 
569
739
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
570
740
  dnl accordingly.
573
743
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
574
744
  dnl because if the user has installed libiconv and not disabled its use
575
745
  dnl via --without-libiconv-prefix, he wants to use it. The first
576
 
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
746
  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
577
747
  am_save_CPPFLAGS="$CPPFLAGS"
578
748
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
579
749
 
580
 
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
 
750
  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
581
751
    am_cv_func_iconv="no, consider installing GNU libiconv"
582
752
    am_cv_lib_iconv=no
583
 
    AC_TRY_LINK([#include <stdlib.h>
584
 
#include <iconv.h>],
585
 
      [iconv_t cd = iconv_open("","");
586
 
       iconv(cd,NULL,NULL,NULL,NULL);
587
 
       iconv_close(cd);],
588
 
      am_cv_func_iconv=yes)
 
753
    AC_LINK_IFELSE(
 
754
      [AC_LANG_PROGRAM(
 
755
         [[
 
756
#include <stdlib.h>
 
757
#include <iconv.h>
 
758
         ]],
 
759
         [[iconv_t cd = iconv_open("","");
 
760
           iconv(cd,NULL,NULL,NULL,NULL);
 
761
           iconv_close(cd);]])],
 
762
      [am_cv_func_iconv=yes])
589
763
    if test "$am_cv_func_iconv" != yes; then
590
764
      am_save_LIBS="$LIBS"
591
765
      LIBS="$LIBS $LIBICONV"
592
 
      AC_TRY_LINK([#include <stdlib.h>
593
 
#include <iconv.h>],
594
 
        [iconv_t cd = iconv_open("","");
595
 
         iconv(cd,NULL,NULL,NULL,NULL);
596
 
         iconv_close(cd);],
597
 
        am_cv_lib_iconv=yes
598
 
        am_cv_func_iconv=yes)
 
766
      AC_LINK_IFELSE(
 
767
        [AC_LANG_PROGRAM(
 
768
           [[
 
769
#include <stdlib.h>
 
770
#include <iconv.h>
 
771
           ]],
 
772
           [[iconv_t cd = iconv_open("","");
 
773
             iconv(cd,NULL,NULL,NULL,NULL);
 
774
             iconv_close(cd);]])],
 
775
        [am_cv_lib_iconv=yes]
 
776
        [am_cv_func_iconv=yes])
599
777
      LIBS="$am_save_LIBS"
600
778
    fi
601
779
  ])
602
780
  if test "$am_cv_func_iconv" = yes; then
603
 
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
 
781
    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
 
782
      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
 
783
      dnl Solaris 10.
 
784
      am_save_LIBS="$LIBS"
 
785
      if test $am_cv_lib_iconv = yes; then
 
786
        LIBS="$LIBS $LIBICONV"
 
787
      fi
 
788
      AC_RUN_IFELSE(
 
789
        [AC_LANG_SOURCE([[
 
790
#include <iconv.h>
 
791
#include <string.h>
 
792
int main ()
 
793
{
 
794
  int result = 0;
 
795
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
 
796
     returns.  */
 
797
  {
 
798
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
 
799
    if (cd_utf8_to_88591 != (iconv_t)(-1))
 
800
      {
 
801
        static const char input[] = "\342\202\254"; /* EURO SIGN */
 
802
        char buf[10];
 
803
        const char *inptr = input;
 
804
        size_t inbytesleft = strlen (input);
 
805
        char *outptr = buf;
 
806
        size_t outbytesleft = sizeof (buf);
 
807
        size_t res = iconv (cd_utf8_to_88591,
 
808
                            (char **) &inptr, &inbytesleft,
 
809
                            &outptr, &outbytesleft);
 
810
        if (res == 0)
 
811
          result |= 1;
 
812
        iconv_close (cd_utf8_to_88591);
 
813
      }
 
814
  }
 
815
  /* Test against Solaris 10 bug: Failures are not distinguishable from
 
816
     successful returns.  */
 
817
  {
 
818
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
 
819
    if (cd_ascii_to_88591 != (iconv_t)(-1))
 
820
      {
 
821
        static const char input[] = "\263";
 
822
        char buf[10];
 
823
        const char *inptr = input;
 
824
        size_t inbytesleft = strlen (input);
 
825
        char *outptr = buf;
 
826
        size_t outbytesleft = sizeof (buf);
 
827
        size_t res = iconv (cd_ascii_to_88591,
 
828
                            (char **) &inptr, &inbytesleft,
 
829
                            &outptr, &outbytesleft);
 
830
        if (res == 0)
 
831
          result |= 2;
 
832
        iconv_close (cd_ascii_to_88591);
 
833
      }
 
834
  }
 
835
  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
 
836
  {
 
837
    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
 
838
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
839
      {
 
840
        static const char input[] = "\304";
 
841
        static char buf[2] = { (char)0xDE, (char)0xAD };
 
842
        const char *inptr = input;
 
843
        size_t inbytesleft = 1;
 
844
        char *outptr = buf;
 
845
        size_t outbytesleft = 1;
 
846
        size_t res = iconv (cd_88591_to_utf8,
 
847
                            (char **) &inptr, &inbytesleft,
 
848
                            &outptr, &outbytesleft);
 
849
        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
 
850
          result |= 4;
 
851
        iconv_close (cd_88591_to_utf8);
 
852
      }
 
853
  }
 
854
#if 0 /* This bug could be worked around by the caller.  */
 
855
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
 
856
  {
 
857
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
 
858
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
859
      {
 
860
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
 
861
        char buf[50];
 
862
        const char *inptr = input;
 
863
        size_t inbytesleft = strlen (input);
 
864
        char *outptr = buf;
 
865
        size_t outbytesleft = sizeof (buf);
 
866
        size_t res = iconv (cd_88591_to_utf8,
 
867
                            (char **) &inptr, &inbytesleft,
 
868
                            &outptr, &outbytesleft);
 
869
        if ((int)res > 0)
 
870
          result |= 8;
 
871
        iconv_close (cd_88591_to_utf8);
 
872
      }
 
873
  }
 
874
#endif
 
875
  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
 
876
     provided.  */
 
877
  if (/* Try standardized names.  */
 
878
      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
 
879
      /* Try IRIX, OSF/1 names.  */
 
880
      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
 
881
      /* Try AIX names.  */
 
882
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
 
883
      /* Try HP-UX names.  */
 
884
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
 
885
    result |= 16;
 
886
  return result;
 
887
}]])],
 
888
        [am_cv_func_iconv_works=yes],
 
889
        [am_cv_func_iconv_works=no],
 
890
        [
 
891
changequote(,)dnl
 
892
         case "$host_os" in
 
893
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
 
894
           *)            am_cv_func_iconv_works="guessing yes" ;;
 
895
         esac
 
896
changequote([,])dnl
 
897
        ])
 
898
      LIBS="$am_save_LIBS"
 
899
    ])
 
900
    case "$am_cv_func_iconv_works" in
 
901
      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
 
902
      *)   am_func_iconv=yes ;;
 
903
    esac
 
904
  else
 
905
    am_func_iconv=no am_cv_lib_iconv=no
 
906
  fi
 
907
  if test "$am_func_iconv" = yes; then
 
908
    AC_DEFINE([HAVE_ICONV], [1],
 
909
      [Define if you have the iconv() function and it works.])
604
910
  fi
605
911
  if test "$am_cv_lib_iconv" = yes; then
606
912
    AC_MSG_CHECKING([how to link with libiconv])
612
918
    LIBICONV=
613
919
    LTLIBICONV=
614
920
  fi
615
 
  AC_SUBST(LIBICONV)
616
 
  AC_SUBST(LTLIBICONV)
 
921
  AC_SUBST([LIBICONV])
 
922
  AC_SUBST([LTLIBICONV])
617
923
])
618
924
 
619
 
AC_DEFUN([AM_ICONV],
 
925
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
 
926
dnl avoid warnings like
 
927
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
 
928
dnl This is tricky because of the way 'aclocal' is implemented:
 
929
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
 
930
dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
 
931
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
 
932
dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
 
933
dnl   warnings.
 
934
m4_define([gl_iconv_AC_DEFUN],
 
935
  m4_version_prereq([2.64],
 
936
    [[AC_DEFUN_ONCE(
 
937
        [$1], [$2])]],
 
938
    [m4_ifdef([gl_00GNULIB],
 
939
       [[AC_DEFUN_ONCE(
 
940
           [$1], [$2])]],
 
941
       [[AC_DEFUN(
 
942
           [$1], [$2])]])]))
 
943
gl_iconv_AC_DEFUN([AM_ICONV],
620
944
[
621
945
  AM_ICONV_LINK
622
946
  if test "$am_cv_func_iconv" = yes; then
623
947
    AC_MSG_CHECKING([for iconv declaration])
624
 
    AC_CACHE_VAL(am_cv_proto_iconv, [
625
 
      AC_TRY_COMPILE([
 
948
    AC_CACHE_VAL([am_cv_proto_iconv], [
 
949
      AC_COMPILE_IFELSE(
 
950
        [AC_LANG_PROGRAM(
 
951
           [[
626
952
#include <stdlib.h>
627
953
#include <iconv.h>
628
954
extern
629
955
#ifdef __cplusplus
630
956
"C"
631
957
#endif
632
 
#if defined(__STDC__) || defined(__cplusplus)
 
958
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
633
959
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
634
960
#else
635
961
size_t iconv();
636
962
#endif
637
 
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
 
963
           ]],
 
964
           [[]])],
 
965
        [am_cv_proto_iconv_arg1=""],
 
966
        [am_cv_proto_iconv_arg1="const"])
638
967
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
639
968
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
640
 
    AC_MSG_RESULT([$]{ac_t:-
641
 
         }[$]am_cv_proto_iconv)
642
 
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
969
    AC_MSG_RESULT([
 
970
         $am_cv_proto_iconv])
 
971
    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
643
972
      [Define as const if the declaration of iconv() needs const.])
 
973
    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
 
974
    m4_ifdef([gl_ICONV_H_DEFAULTS],
 
975
      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
 
976
       if test -n "$am_cv_proto_iconv_arg1"; then
 
977
         ICONV_CONST="const"
 
978
       fi
 
979
      ])
644
980
  fi
645
981
])
646
 
# intdiv0.m4 serial 1 (gettext-0.11.3)
647
 
dnl Copyright (C) 2002 Free Software Foundation, Inc.
648
 
dnl This file is free software, distributed under the terms of the GNU
649
 
dnl General Public License.  As a special exception to the GNU General
650
 
dnl Public License, this file may be distributed as part of a program
651
 
dnl that contains a configuration script generated by Autoconf, under
652
 
dnl the same distribution terms as the rest of that program.
 
982
 
 
983
# intdiv0.m4 serial 6 (gettext-0.18.2)
 
984
dnl Copyright (C) 2002, 2007-2008, 2010-2013 Free Software Foundation, Inc.
 
985
dnl This file is free software; the Free Software Foundation
 
986
dnl gives unlimited permission to copy and/or distribute it,
 
987
dnl with or without modifications, as long as this notice is preserved.
653
988
 
654
989
dnl From Bruno Haible.
655
990
 
661
996
  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
662
997
    gt_cv_int_divbyzero_sigfpe,
663
998
    [
664
 
      AC_TRY_RUN([
 
999
      gt_cv_int_divbyzero_sigfpe=
 
1000
changequote(,)dnl
 
1001
      case "$host_os" in
 
1002
        macos* | darwin[6-9]* | darwin[1-9][0-9]*)
 
1003
          # On Mac OS X 10.2 or newer, just assume the same as when cross-
 
1004
          # compiling. If we were to perform the real test, 1 Crash Report
 
1005
          # dialog window would pop up.
 
1006
          case "$host_cpu" in
 
1007
            i[34567]86 | x86_64)
 
1008
              gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
 
1009
          esac
 
1010
          ;;
 
1011
      esac
 
1012
changequote([,])dnl
 
1013
      if test -z "$gt_cv_int_divbyzero_sigfpe"; then
 
1014
        AC_RUN_IFELSE(
 
1015
          [AC_LANG_SOURCE([[
665
1016
#include <stdlib.h>
666
1017
#include <signal.h>
667
1018
 
668
1019
static void
669
 
#ifdef __cplusplus
670
1020
sigfpe_handler (int sig)
671
 
#else
672
 
sigfpe_handler (sig) int sig;
673
 
#endif
674
1021
{
675
1022
  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
676
1023
  exit (sig != SIGFPE);
695
1042
 
696
1043
  z = x / y;
697
1044
  nan = y / y;
698
 
  exit (1);
 
1045
  exit (2);
699
1046
}
700
 
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
701
 
        [
702
 
          # Guess based on the CPU.
703
 
          case "$host_cpu" in
704
 
            alpha* | i[34567]86 | m68k | s390*)
705
 
              gt_cv_int_divbyzero_sigfpe="guessing yes";;
706
 
            *)
707
 
              gt_cv_int_divbyzero_sigfpe="guessing no";;
708
 
          esac
709
 
        ])
 
1047
]])],
 
1048
          [gt_cv_int_divbyzero_sigfpe=yes],
 
1049
          [gt_cv_int_divbyzero_sigfpe=no],
 
1050
          [
 
1051
            # Guess based on the CPU.
 
1052
changequote(,)dnl
 
1053
            case "$host_cpu" in
 
1054
              alpha* | i[34567]86 | x86_64 | m68k | s390*)
 
1055
                gt_cv_int_divbyzero_sigfpe="guessing yes";;
 
1056
              *)
 
1057
                gt_cv_int_divbyzero_sigfpe="guessing no";;
 
1058
            esac
 
1059
changequote([,])dnl
 
1060
          ])
 
1061
      fi
710
1062
    ])
711
1063
  case "$gt_cv_int_divbyzero_sigfpe" in
712
1064
    *yes) value=1;;
713
1065
    *) value=0;;
714
1066
  esac
715
 
  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
 
1067
  AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
716
1068
    [Define if integer division by zero raises signal SIGFPE.])
717
1069
])
718
 
# intmax.m4 serial 1 (gettext-0.12)
719
 
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
720
 
dnl This file is free software, distributed under the terms of the GNU
721
 
dnl General Public License.  As a special exception to the GNU General
722
 
dnl Public License, this file may be distributed as part of a program
723
 
dnl that contains a configuration script generated by Autoconf, under
724
 
dnl the same distribution terms as the rest of that program.
 
1070
 
 
1071
# intl.m4 serial 25 (gettext-0.18.3)
 
1072
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 
1073
dnl This file is free software; the Free Software Foundation
 
1074
dnl gives unlimited permission to copy and/or distribute it,
 
1075
dnl with or without modifications, as long as this notice is preserved.
 
1076
dnl
 
1077
dnl This file can can be used in projects which are not available under
 
1078
dnl the GNU General Public License or the GNU Library General Public
 
1079
dnl License but which still want to provide support for the GNU gettext
 
1080
dnl functionality.
 
1081
dnl Please note that the actual code of the GNU gettext library is covered
 
1082
dnl by the GNU Library General Public License, and the rest of the GNU
 
1083
dnl gettext package package is covered by the GNU General Public License.
 
1084
dnl They are *not* in the public domain.
 
1085
 
 
1086
dnl Authors:
 
1087
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1088
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2009.
 
1089
 
 
1090
AC_PREREQ([2.60])
 
1091
 
 
1092
dnl Checks for all prerequisites of the intl subdirectory,
 
1093
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
 
1094
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
 
1095
AC_DEFUN([AM_INTL_SUBDIR],
 
1096
[
 
1097
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1098
  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 
1099
  AC_REQUIRE([AC_PROG_CC])dnl
 
1100
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1101
  AC_REQUIRE([gt_GLIBC2])dnl
 
1102
  AC_REQUIRE([AC_PROG_RANLIB])dnl
 
1103
  AC_REQUIRE([gl_VISIBILITY])dnl
 
1104
  AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
 
1105
  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
 
1106
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
 
1107
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
 
1108
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
1109
  AC_REQUIRE([gt_TYPE_INTMAX_T])
 
1110
  AC_REQUIRE([gt_PRINTF_POSIX])
 
1111
  AC_REQUIRE([gl_GLIBC21])dnl
 
1112
  AC_REQUIRE([gl_XSIZE])dnl
 
1113
  AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
 
1114
  AC_REQUIRE([gt_INTL_MACOSX])dnl
 
1115
  AC_REQUIRE([gl_EXTERN_INLINE])dnl
 
1116
 
 
1117
  dnl Support for automake's --enable-silent-rules.
 
1118
  case "$enable_silent_rules" in
 
1119
    yes) INTL_DEFAULT_VERBOSITY=0;;
 
1120
    no)  INTL_DEFAULT_VERBOSITY=1;;
 
1121
    *)   INTL_DEFAULT_VERBOSITY=1;;
 
1122
  esac
 
1123
  AC_SUBST([INTL_DEFAULT_VERBOSITY])
 
1124
 
 
1125
  AC_CHECK_TYPE([ptrdiff_t], ,
 
1126
    [AC_DEFINE([ptrdiff_t], [long],
 
1127
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
 
1128
    ])
 
1129
  AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
 
1130
  AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
 
1131
    snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
 
1132
 
 
1133
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
 
1134
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
 
1135
  AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
 
1136
 
 
1137
  dnl Use the *_unlocked functions only if they are declared.
 
1138
  dnl (because some of them were defined without being declared in Solaris
 
1139
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
 
1140
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
 
1141
  AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
 
1142
 
 
1143
  case $gt_cv_func_printf_posix in
 
1144
    *yes) HAVE_POSIX_PRINTF=1 ;;
 
1145
    *) HAVE_POSIX_PRINTF=0 ;;
 
1146
  esac
 
1147
  AC_SUBST([HAVE_POSIX_PRINTF])
 
1148
  if test "$ac_cv_func_asprintf" = yes; then
 
1149
    HAVE_ASPRINTF=1
 
1150
  else
 
1151
    HAVE_ASPRINTF=0
 
1152
  fi
 
1153
  AC_SUBST([HAVE_ASPRINTF])
 
1154
  if test "$ac_cv_func_snprintf" = yes; then
 
1155
    HAVE_SNPRINTF=1
 
1156
  else
 
1157
    HAVE_SNPRINTF=0
 
1158
  fi
 
1159
  AC_SUBST([HAVE_SNPRINTF])
 
1160
  if test "$ac_cv_func_newlocale" = yes; then
 
1161
    HAVE_NEWLOCALE=1
 
1162
  else
 
1163
    HAVE_NEWLOCALE=0
 
1164
  fi
 
1165
  AC_SUBST([HAVE_NEWLOCALE])
 
1166
  if test "$ac_cv_func_wprintf" = yes; then
 
1167
    HAVE_WPRINTF=1
 
1168
  else
 
1169
    HAVE_WPRINTF=0
 
1170
  fi
 
1171
  AC_SUBST([HAVE_WPRINTF])
 
1172
 
 
1173
  AM_LANGINFO_CODESET
 
1174
  gt_LC_MESSAGES
 
1175
 
 
1176
  dnl Compilation on mingw and Cygwin needs special Makefile rules, because
 
1177
  dnl 1. when we install a shared library, we must arrange to export
 
1178
  dnl    auxiliary pointer variables for every exported variable,
 
1179
  dnl 2. when we install a shared library and a static library simultaneously,
 
1180
  dnl    the include file specifies __declspec(dllimport) and therefore we
 
1181
  dnl    must arrange to define the auxiliary pointer variables for the
 
1182
  dnl    exported variables _also_ in the static library.
 
1183
  if test "$enable_shared" = yes; then
 
1184
    case "$host_os" in
 
1185
      mingw* | cygwin*) is_woe32dll=yes ;;
 
1186
      *) is_woe32dll=no ;;
 
1187
    esac
 
1188
  else
 
1189
    is_woe32dll=no
 
1190
  fi
 
1191
  WOE32DLL=$is_woe32dll
 
1192
  AC_SUBST([WOE32DLL])
 
1193
 
 
1194
  dnl On mingw and Cygwin, we can activate special Makefile rules which add
 
1195
  dnl version information to the shared libraries and executables.
 
1196
  case "$host_os" in
 
1197
    mingw* | cygwin*) is_woe32=yes ;;
 
1198
    *) is_woe32=no ;;
 
1199
  esac
 
1200
  WOE32=$is_woe32
 
1201
  AC_SUBST([WOE32])
 
1202
  if test $WOE32 = yes; then
 
1203
    dnl Check for a program that compiles Windows resource files.
 
1204
    AC_CHECK_TOOL([WINDRES], [windres])
 
1205
  fi
 
1206
 
 
1207
  dnl Determine whether when creating a library, "-lc" should be passed to
 
1208
  dnl libtool or not. On many platforms, it is required for the libtool option
 
1209
  dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
 
1210
  dnl in the *.la files - makes it impossible to create multithreaded programs,
 
1211
  dnl because libtool also reorders the -lc to come before the -pthread, and
 
1212
  dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
 
1213
  case "$host_os" in
 
1214
    hpux*) LTLIBC="" ;;
 
1215
    *)     LTLIBC="-lc" ;;
 
1216
  esac
 
1217
  AC_SUBST([LTLIBC])
 
1218
 
 
1219
  dnl Rename some macros and functions used for locking.
 
1220
  AH_BOTTOM([
 
1221
#define __libc_lock_t                   gl_lock_t
 
1222
#define __libc_lock_define              gl_lock_define
 
1223
#define __libc_lock_define_initialized  gl_lock_define_initialized
 
1224
#define __libc_lock_init                gl_lock_init
 
1225
#define __libc_lock_lock                gl_lock_lock
 
1226
#define __libc_lock_unlock              gl_lock_unlock
 
1227
#define __libc_lock_recursive_t                   gl_recursive_lock_t
 
1228
#define __libc_lock_define_recursive              gl_recursive_lock_define
 
1229
#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized
 
1230
#define __libc_lock_init_recursive                gl_recursive_lock_init
 
1231
#define __libc_lock_lock_recursive                gl_recursive_lock_lock
 
1232
#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
 
1233
#define glthread_in_use  libintl_thread_in_use
 
1234
#define glthread_lock_init_func     libintl_lock_init_func
 
1235
#define glthread_lock_lock_func     libintl_lock_lock_func
 
1236
#define glthread_lock_unlock_func   libintl_lock_unlock_func
 
1237
#define glthread_lock_destroy_func  libintl_lock_destroy_func
 
1238
#define glthread_rwlock_init_multithreaded     libintl_rwlock_init_multithreaded
 
1239
#define glthread_rwlock_init_func              libintl_rwlock_init_func
 
1240
#define glthread_rwlock_rdlock_multithreaded   libintl_rwlock_rdlock_multithreaded
 
1241
#define glthread_rwlock_rdlock_func            libintl_rwlock_rdlock_func
 
1242
#define glthread_rwlock_wrlock_multithreaded   libintl_rwlock_wrlock_multithreaded
 
1243
#define glthread_rwlock_wrlock_func            libintl_rwlock_wrlock_func
 
1244
#define glthread_rwlock_unlock_multithreaded   libintl_rwlock_unlock_multithreaded
 
1245
#define glthread_rwlock_unlock_func            libintl_rwlock_unlock_func
 
1246
#define glthread_rwlock_destroy_multithreaded  libintl_rwlock_destroy_multithreaded
 
1247
#define glthread_rwlock_destroy_func           libintl_rwlock_destroy_func
 
1248
#define glthread_recursive_lock_init_multithreaded     libintl_recursive_lock_init_multithreaded
 
1249
#define glthread_recursive_lock_init_func              libintl_recursive_lock_init_func
 
1250
#define glthread_recursive_lock_lock_multithreaded     libintl_recursive_lock_lock_multithreaded
 
1251
#define glthread_recursive_lock_lock_func              libintl_recursive_lock_lock_func
 
1252
#define glthread_recursive_lock_unlock_multithreaded   libintl_recursive_lock_unlock_multithreaded
 
1253
#define glthread_recursive_lock_unlock_func            libintl_recursive_lock_unlock_func
 
1254
#define glthread_recursive_lock_destroy_multithreaded  libintl_recursive_lock_destroy_multithreaded
 
1255
#define glthread_recursive_lock_destroy_func           libintl_recursive_lock_destroy_func
 
1256
#define glthread_once_func            libintl_once_func
 
1257
#define glthread_once_singlethreaded  libintl_once_singlethreaded
 
1258
#define glthread_once_multithreaded   libintl_once_multithreaded
 
1259
])
 
1260
])
 
1261
 
 
1262
 
 
1263
dnl Checks for the core files of the intl subdirectory:
 
1264
dnl   dcigettext.c
 
1265
dnl   eval-plural.h
 
1266
dnl   explodename.c
 
1267
dnl   finddomain.c
 
1268
dnl   gettextP.h
 
1269
dnl   gmo.h
 
1270
dnl   hash-string.h hash-string.c
 
1271
dnl   l10nflist.c
 
1272
dnl   libgnuintl.h.in (except the *printf stuff)
 
1273
dnl   loadinfo.h
 
1274
dnl   loadmsgcat.c
 
1275
dnl   localealias.c
 
1276
dnl   log.c
 
1277
dnl   plural-exp.h plural-exp.c
 
1278
dnl   plural.y
 
1279
dnl Used by libglocale.
 
1280
AC_DEFUN([gt_INTL_SUBDIR_CORE],
 
1281
[
 
1282
  AC_REQUIRE([AC_C_INLINE])dnl
 
1283
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
1284
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
1285
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
1286
  AC_REQUIRE([AC_FUNC_MMAP])dnl
 
1287
  AC_REQUIRE([gt_INTDIV0])dnl
 
1288
  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
 
1289
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
 
1290
  AC_REQUIRE([gl_LOCK])dnl
 
1291
 
 
1292
  AC_LINK_IFELSE(
 
1293
    [AC_LANG_PROGRAM(
 
1294
       [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
 
1295
       [[]])],
 
1296
    [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
 
1297
       [Define to 1 if the compiler understands __builtin_expect.])])
 
1298
 
 
1299
  AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
 
1300
  AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
 
1301
    stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
 
1302
    argz_stringify argz_next __fsetlocking])
 
1303
 
 
1304
  dnl Use the *_unlocked functions only if they are declared.
 
1305
  dnl (because some of them were defined without being declared in Solaris
 
1306
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
 
1307
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
 
1308
  AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
 
1309
 
 
1310
  AM_ICONV
 
1311
 
 
1312
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
 
1313
  dnl because plural.y uses bison specific features. It requires at least
 
1314
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
 
1315
  dnl compile.
 
1316
  dnl bison is only needed for the maintainer (who touches plural.y). But in
 
1317
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
 
1318
  dnl the rule in general Makefile. Now, some people carelessly touch the
 
1319
  dnl files or have a broken "make" program, hence the plural.c rule will
 
1320
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
 
1321
  dnl present or too old.
 
1322
  AC_CHECK_PROGS([INTLBISON], [bison])
 
1323
  if test -z "$INTLBISON"; then
 
1324
    ac_verc_fail=yes
 
1325
  else
 
1326
    dnl Found it, now check the version.
 
1327
    AC_MSG_CHECKING([version of bison])
 
1328
changequote(<<,>>)dnl
 
1329
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
 
1330
    case $ac_prog_version in
 
1331
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
 
1332
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
 
1333
changequote([,])dnl
 
1334
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
 
1335
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
1336
    esac
 
1337
    AC_MSG_RESULT([$ac_prog_version])
 
1338
  fi
 
1339
  if test $ac_verc_fail = yes; then
 
1340
    INTLBISON=:
 
1341
  fi
 
1342
])
 
1343
 
 
1344
# intlmacosx.m4 serial 5 (gettext-0.18.2)
 
1345
dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
 
1346
dnl This file is free software; the Free Software Foundation
 
1347
dnl gives unlimited permission to copy and/or distribute it,
 
1348
dnl with or without modifications, as long as this notice is preserved.
 
1349
dnl
 
1350
dnl This file can can be used in projects which are not available under
 
1351
dnl the GNU General Public License or the GNU Library General Public
 
1352
dnl License but which still want to provide support for the GNU gettext
 
1353
dnl functionality.
 
1354
dnl Please note that the actual code of the GNU gettext library is covered
 
1355
dnl by the GNU Library General Public License, and the rest of the GNU
 
1356
dnl gettext package package is covered by the GNU General Public License.
 
1357
dnl They are *not* in the public domain.
 
1358
 
 
1359
dnl Checks for special options needed on Mac OS X.
 
1360
dnl Defines INTL_MACOSX_LIBS.
 
1361
AC_DEFUN([gt_INTL_MACOSX],
 
1362
[
 
1363
  dnl Check for API introduced in Mac OS X 10.2.
 
1364
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
 
1365
    [gt_cv_func_CFPreferencesCopyAppValue],
 
1366
    [gt_save_LIBS="$LIBS"
 
1367
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
1368
     AC_LINK_IFELSE(
 
1369
       [AC_LANG_PROGRAM(
 
1370
          [[#include <CoreFoundation/CFPreferences.h>]],
 
1371
          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
 
1372
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
 
1373
       [gt_cv_func_CFPreferencesCopyAppValue=no])
 
1374
     LIBS="$gt_save_LIBS"])
 
1375
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
1376
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
 
1377
      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
 
1378
  fi
 
1379
  dnl Check for API introduced in Mac OS X 10.3.
 
1380
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
 
1381
    [gt_save_LIBS="$LIBS"
 
1382
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
1383
     AC_LINK_IFELSE(
 
1384
       [AC_LANG_PROGRAM(
 
1385
          [[#include <CoreFoundation/CFLocale.h>]],
 
1386
          [[CFLocaleCopyCurrent();]])],
 
1387
       [gt_cv_func_CFLocaleCopyCurrent=yes],
 
1388
       [gt_cv_func_CFLocaleCopyCurrent=no])
 
1389
     LIBS="$gt_save_LIBS"])
 
1390
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
1391
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
 
1392
      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
 
1393
  fi
 
1394
  INTL_MACOSX_LIBS=
 
1395
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
1396
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
 
1397
  fi
 
1398
  AC_SUBST([INTL_MACOSX_LIBS])
 
1399
])
 
1400
 
 
1401
# intmax.m4 serial 6 (gettext-0.18.2)
 
1402
dnl Copyright (C) 2002-2005, 2008-2013 Free Software Foundation, Inc.
 
1403
dnl This file is free software; the Free Software Foundation
 
1404
dnl gives unlimited permission to copy and/or distribute it,
 
1405
dnl with or without modifications, as long as this notice is preserved.
725
1406
 
726
1407
dnl From Bruno Haible.
727
1408
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
729
1410
 
730
1411
AC_DEFUN([gt_TYPE_INTMAX_T],
731
1412
[
732
 
  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
733
 
  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
734
 
  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
735
 
    [AC_TRY_COMPILE([
736
 
#include <stddef.h> 
 
1413
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
1414
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
1415
  AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
 
1416
    [AC_COMPILE_IFELSE(
 
1417
       [AC_LANG_PROGRAM(
 
1418
          [[
 
1419
#include <stddef.h>
737
1420
#include <stdlib.h>
738
1421
#if HAVE_STDINT_H_WITH_UINTMAX
739
1422
#include <stdint.h>
741
1424
#if HAVE_INTTYPES_H_WITH_UINTMAX
742
1425
#include <inttypes.h>
743
1426
#endif
744
 
], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
 
1427
          ]],
 
1428
          [[intmax_t x = -1;
 
1429
            return !x;]])],
 
1430
       [gt_cv_c_intmax_t=yes],
 
1431
       [gt_cv_c_intmax_t=no])])
745
1432
  if test $gt_cv_c_intmax_t = yes; then
746
 
    AC_DEFINE(HAVE_INTMAX_T, 1,
 
1433
    AC_DEFINE([HAVE_INTMAX_T], [1],
747
1434
      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
748
1435
  fi
749
1436
])
750
 
# inttypes.m4 serial 1 (gettext-0.11.4)
751
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
752
 
dnl This file is free software, distributed under the terms of the GNU
753
 
dnl General Public License.  As a special exception to the GNU General
754
 
dnl Public License, this file may be distributed as part of a program
755
 
dnl that contains a configuration script generated by Autoconf, under
756
 
dnl the same distribution terms as the rest of that program.
757
 
 
758
 
dnl From Paul Eggert.
759
 
 
760
 
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
761
 
# <sys/types.h>.
762
 
 
763
 
AC_DEFUN([gt_HEADER_INTTYPES_H],
764
 
[
765
 
  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
766
 
  [
767
 
    AC_TRY_COMPILE(
768
 
      [#include <sys/types.h>
769
 
#include <inttypes.h>],
770
 
      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
771
 
  ])
772
 
  if test $gt_cv_header_inttypes_h = yes; then
773
 
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
774
 
      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
775
 
  fi
776
 
])
777
 
# inttypes_h.m4 serial 5 (gettext-0.12)
778
 
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
779
 
dnl This file is free software, distributed under the terms of the GNU
780
 
dnl General Public License.  As a special exception to the GNU General
781
 
dnl Public License, this file may be distributed as part of a program
782
 
dnl that contains a configuration script generated by Autoconf, under
783
 
dnl the same distribution terms as the rest of that program.
784
 
 
785
 
dnl From Paul Eggert.
786
 
 
787
 
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
788
 
# doesn't clash with <sys/types.h>, and declares uintmax_t.
789
 
 
790
 
AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
791
 
[
792
 
  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
793
 
  [AC_TRY_COMPILE(
794
 
    [#include <sys/types.h>
795
 
#include <inttypes.h>],
796
 
    [uintmax_t i = (uintmax_t) -1;],
797
 
    jm_ac_cv_header_inttypes_h=yes,
798
 
    jm_ac_cv_header_inttypes_h=no)])
799
 
  if test $jm_ac_cv_header_inttypes_h = yes; then
800
 
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
801
 
      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
802
 
       and declares uintmax_t. ])
803
 
  fi
804
 
])
805
 
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
806
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
807
 
dnl This file is free software, distributed under the terms of the GNU
808
 
dnl General Public License.  As a special exception to the GNU General
809
 
dnl Public License, this file may be distributed as part of a program
810
 
dnl that contains a configuration script generated by Autoconf, under
811
 
dnl the same distribution terms as the rest of that program.
 
1437
 
 
1438
# inttypes-pri.m4 serial 7 (gettext-0.18.2)
 
1439
dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
 
1440
dnl This file is free software; the Free Software Foundation
 
1441
dnl gives unlimited permission to copy and/or distribute it,
 
1442
dnl with or without modifications, as long as this notice is preserved.
812
1443
 
813
1444
dnl From Bruno Haible.
814
1445
 
 
1446
AC_PREREQ([2.53])
 
1447
 
815
1448
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
816
1449
# macros to non-string values.  This is the case on AIX 4.3.3.
817
1450
 
818
1451
AC_DEFUN([gt_INTTYPES_PRI],
819
1452
[
820
 
  AC_REQUIRE([gt_HEADER_INTTYPES_H])
821
 
  if test $gt_cv_header_inttypes_h = yes; then
 
1453
  AC_CHECK_HEADERS([inttypes.h])
 
1454
  if test $ac_cv_header_inttypes_h = yes; then
822
1455
    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
823
 
      gt_cv_inttypes_pri_broken,
 
1456
      [gt_cv_inttypes_pri_broken],
824
1457
      [
825
 
        AC_TRY_COMPILE([#include <inttypes.h>
 
1458
        AC_COMPILE_IFELSE(
 
1459
          [AC_LANG_PROGRAM(
 
1460
             [[
 
1461
#include <inttypes.h>
826
1462
#ifdef PRId32
827
1463
char *p = PRId32;
828
1464
#endif
829
 
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
 
1465
             ]],
 
1466
             [[]])],
 
1467
          [gt_cv_inttypes_pri_broken=no],
 
1468
          [gt_cv_inttypes_pri_broken=yes])
830
1469
      ])
831
1470
  fi
832
1471
  if test "$gt_cv_inttypes_pri_broken" = yes; then
833
 
    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
 
1472
    AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
834
1473
      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
835
 
  fi
836
 
])
837
 
# isc-posix.m4 serial 2 (gettext-0.11.2)
838
 
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
839
 
dnl This file is free software, distributed under the terms of the GNU
840
 
dnl General Public License.  As a special exception to the GNU General
841
 
dnl Public License, this file may be distributed as part of a program
842
 
dnl that contains a configuration script generated by Autoconf, under
843
 
dnl the same distribution terms as the rest of that program.
844
 
 
845
 
# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
846
 
 
847
 
# This test replaces the one in autoconf.
848
 
# Currently this macro should have the same name as the autoconf macro
849
 
# because gettext's gettext.m4 (distributed in the automake package)
850
 
# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
851
 
# give these diagnostics:
852
 
#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
853
 
#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
854
 
 
855
 
undefine([AC_ISC_POSIX])
856
 
 
857
 
AC_DEFUN([AC_ISC_POSIX],
858
 
  [
859
 
    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
860
 
    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
861
 
  ]
862
 
)
863
 
# lcmessage.m4 serial 3 (gettext-0.11.3)
864
 
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
865
 
dnl This file is free software, distributed under the terms of the GNU
866
 
dnl General Public License.  As a special exception to the GNU General
867
 
dnl Public License, this file may be distributed as part of a program
868
 
dnl that contains a configuration script generated by Autoconf, under
869
 
dnl the same distribution terms as the rest of that program.
 
1474
    PRI_MACROS_BROKEN=1
 
1475
  else
 
1476
    PRI_MACROS_BROKEN=0
 
1477
  fi
 
1478
  AC_SUBST([PRI_MACROS_BROKEN])
 
1479
])
 
1480
 
 
1481
# inttypes_h.m4 serial 10
 
1482
dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
 
1483
dnl This file is free software; the Free Software Foundation
 
1484
dnl gives unlimited permission to copy and/or distribute it,
 
1485
dnl with or without modifications, as long as this notice is preserved.
 
1486
 
 
1487
dnl From Paul Eggert.
 
1488
 
 
1489
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
 
1490
# doesn't clash with <sys/types.h>, and declares uintmax_t.
 
1491
 
 
1492
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 
1493
[
 
1494
  AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
 
1495
    [AC_COMPILE_IFELSE(
 
1496
       [AC_LANG_PROGRAM(
 
1497
          [[
 
1498
#include <sys/types.h>
 
1499
#include <inttypes.h>
 
1500
          ]],
 
1501
          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
 
1502
       [gl_cv_header_inttypes_h=yes],
 
1503
       [gl_cv_header_inttypes_h=no])])
 
1504
  if test $gl_cv_header_inttypes_h = yes; then
 
1505
    AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
 
1506
      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
 
1507
       and declares uintmax_t. ])
 
1508
  fi
 
1509
])
 
1510
 
 
1511
# lcmessage.m4 serial 7 (gettext-0.18.2)
 
1512
dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
 
1513
dnl Inc.
 
1514
dnl This file is free software; the Free Software Foundation
 
1515
dnl gives unlimited permission to copy and/or distribute it,
 
1516
dnl with or without modifications, as long as this notice is preserved.
870
1517
dnl
871
1518
dnl This file can can be used in projects which are not available under
872
1519
dnl the GNU General Public License or the GNU Library General Public
882
1529
 
883
1530
# Check whether LC_MESSAGES is available in <locale.h>.
884
1531
 
885
 
AC_DEFUN([AM_LC_MESSAGES],
 
1532
AC_DEFUN([gt_LC_MESSAGES],
886
1533
[
887
 
  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
888
 
    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
889
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
890
 
  if test $am_cv_val_LC_MESSAGES = yes; then
891
 
    AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1534
  AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
 
1535
    [AC_LINK_IFELSE(
 
1536
       [AC_LANG_PROGRAM(
 
1537
          [[#include <locale.h>]],
 
1538
          [[return LC_MESSAGES]])],
 
1539
       [gt_cv_val_LC_MESSAGES=yes],
 
1540
       [gt_cv_val_LC_MESSAGES=no])])
 
1541
  if test $gt_cv_val_LC_MESSAGES = yes; then
 
1542
    AC_DEFINE([HAVE_LC_MESSAGES], [1],
892
1543
      [Define if your <locale.h> file defines LC_MESSAGES.])
893
1544
  fi
894
1545
])
895
 
# lib-ld.m4 serial 3 (gettext-0.13)
896
 
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
897
 
dnl This file is free software, distributed under the terms of the GNU
898
 
dnl General Public License.  As a special exception to the GNU General
899
 
dnl Public License, this file may be distributed as part of a program
900
 
dnl that contains a configuration script generated by Autoconf, under
901
 
dnl the same distribution terms as the rest of that program.
 
1546
 
 
1547
# lib-ld.m4 serial 6
 
1548
dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc.
 
1549
dnl This file is free software; the Free Software Foundation
 
1550
dnl gives unlimited permission to copy and/or distribute it,
 
1551
dnl with or without modifications, as long as this notice is preserved.
902
1552
 
903
1553
dnl Subroutines of libtool.m4,
904
 
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
905
 
dnl with libtool.m4.
 
1554
dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
 
1555
dnl collision with libtool.m4.
906
1556
 
907
 
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
1557
dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
908
1558
AC_DEFUN([AC_LIB_PROG_LD_GNU],
909
 
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
910
 
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
1559
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
 
1560
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
911
1561
case `$LD -v 2>&1 </dev/null` in
912
1562
*GNU* | *'with BFD'*)
913
 
  acl_cv_prog_gnu_ld=yes ;;
 
1563
  acl_cv_prog_gnu_ld=yes
 
1564
  ;;
914
1565
*)
915
 
  acl_cv_prog_gnu_ld=no ;;
 
1566
  acl_cv_prog_gnu_ld=no
 
1567
  ;;
916
1568
esac])
917
1569
with_gnu_ld=$acl_cv_prog_gnu_ld
918
1570
])
919
1571
 
920
 
dnl From libtool-1.4. Sets the variable LD.
 
1572
dnl From libtool-2.4. Sets the variable LD.
921
1573
AC_DEFUN([AC_LIB_PROG_LD],
922
 
[AC_ARG_WITH(gnu-ld,
923
 
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
924
 
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
925
 
AC_REQUIRE([AC_PROG_CC])dnl
 
1574
[AC_REQUIRE([AC_PROG_CC])dnl
926
1575
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1576
 
 
1577
AC_ARG_WITH([gnu-ld],
 
1578
    [AS_HELP_STRING([--with-gnu-ld],
 
1579
        [assume the C compiler uses GNU ld [default=no]])],
 
1580
    [test "$withval" = no || with_gnu_ld=yes],
 
1581
    [with_gnu_ld=no])dnl
 
1582
 
927
1583
# Prepare PATH_SEPARATOR.
928
1584
# The user is always right.
929
1585
if test "${PATH_SEPARATOR+set}" != set; then
930
 
  echo "#! /bin/sh" >conf$$.sh
931
 
  echo  "exit 0"   >>conf$$.sh
932
 
  chmod +x conf$$.sh
933
 
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
934
 
    PATH_SEPARATOR=';'
935
 
  else
936
 
    PATH_SEPARATOR=:
937
 
  fi
938
 
  rm -f conf$$.sh
 
1586
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
 
1587
  # contains only /bin. Note that ksh looks also at the FPATH variable,
 
1588
  # so we have to set that as well for the test.
 
1589
  PATH_SEPARATOR=:
 
1590
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
 
1591
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
 
1592
           || PATH_SEPARATOR=';'
 
1593
       }
939
1594
fi
 
1595
 
940
1596
ac_prog=ld
941
1597
if test "$GCC" = yes; then
942
1598
  # Check if gcc -print-prog-name=ld gives a path.
943
 
  AC_MSG_CHECKING([for ld used by GCC])
 
1599
  AC_MSG_CHECKING([for ld used by $CC])
944
1600
  case $host in
945
1601
  *-*-mingw*)
946
1602
    # gcc leaves a trailing carriage return which upsets mingw
950
1606
  esac
951
1607
  case $ac_prog in
952
1608
    # Accept absolute paths.
953
 
    [[\\/]* | [A-Za-z]:[\\/]*)]
954
 
      [re_direlt='/[^/][^/]*/\.\./']
955
 
      # Canonicalize the path of ld
956
 
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
957
 
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
958
 
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
1609
    [[\\/]]* | ?:[[\\/]]*)
 
1610
      re_direlt='/[[^/]][[^/]]*/\.\./'
 
1611
      # Canonicalize the pathname of ld
 
1612
      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
 
1613
      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
 
1614
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
959
1615
      done
960
1616
      test -z "$LD" && LD="$ac_prog"
961
1617
      ;;
973
1629
else
974
1630
  AC_MSG_CHECKING([for non-GNU ld])
975
1631
fi
976
 
AC_CACHE_VAL(acl_cv_path_LD,
 
1632
AC_CACHE_VAL([acl_cv_path_LD],
977
1633
[if test -z "$LD"; then
978
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
1634
  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
979
1635
  for ac_dir in $PATH; do
 
1636
    IFS="$acl_save_ifs"
980
1637
    test -z "$ac_dir" && ac_dir=.
981
1638
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
982
1639
      acl_cv_path_LD="$ac_dir/$ac_prog"
983
1640
      # Check to see if the program is GNU ld.  I'd rather use --version,
984
 
      # but apparently some GNU ld's only accept -v.
 
1641
      # but apparently some variants of GNU ld only accept -v.
985
1642
      # Break only if it was the GNU/non-GNU ld that we prefer.
986
 
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
1643
      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
987
1644
      *GNU* | *'with BFD'*)
988
 
        test "$with_gnu_ld" != no && break ;;
 
1645
        test "$with_gnu_ld" != no && break
 
1646
        ;;
989
1647
      *)
990
 
        test "$with_gnu_ld" != yes && break ;;
 
1648
        test "$with_gnu_ld" != yes && break
 
1649
        ;;
991
1650
      esac
992
1651
    fi
993
1652
  done
994
 
  IFS="$ac_save_ifs"
 
1653
  IFS="$acl_save_ifs"
995
1654
else
996
1655
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
997
1656
fi])
998
1657
LD="$acl_cv_path_LD"
999
1658
if test -n "$LD"; then
1000
 
  AC_MSG_RESULT($LD)
 
1659
  AC_MSG_RESULT([$LD])
1001
1660
else
1002
 
  AC_MSG_RESULT(no)
 
1661
  AC_MSG_RESULT([no])
1003
1662
fi
1004
1663
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1005
1664
AC_LIB_PROG_LD_GNU
1006
1665
])
1007
 
# lib-link.m4 serial 4 (gettext-0.12)
1008
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1009
 
dnl This file is free software, distributed under the terms of the GNU
1010
 
dnl General Public License.  As a special exception to the GNU General
1011
 
dnl Public License, this file may be distributed as part of a program
1012
 
dnl that contains a configuration script generated by Autoconf, under
1013
 
dnl the same distribution terms as the rest of that program.
 
1666
 
 
1667
# lib-link.m4 serial 26 (gettext-0.18.2)
 
1668
dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
 
1669
dnl This file is free software; the Free Software Foundation
 
1670
dnl gives unlimited permission to copy and/or distribute it,
 
1671
dnl with or without modifications, as long as this notice is preserved.
1014
1672
 
1015
1673
dnl From Bruno Haible.
1016
1674
 
 
1675
AC_PREREQ([2.54])
 
1676
 
1017
1677
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1018
1678
dnl the libraries corresponding to explicit and implicit dependencies.
1019
1679
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1020
1680
dnl augments the CPPFLAGS variable.
 
1681
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
1682
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1021
1683
AC_DEFUN([AC_LIB_LINKFLAGS],
1022
1684
[
1023
1685
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1024
1686
  AC_REQUIRE([AC_LIB_RPATH])
1025
 
  define([Name],[translit([$1],[./-], [___])])
1026
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1027
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1687
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
 
1688
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
1689
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1028
1690
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1029
1691
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1030
1692
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1031
1693
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1032
1694
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
1695
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1033
1696
  ])
1034
1697
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1035
1698
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1036
1699
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
1700
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1037
1701
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1038
1702
  AC_SUBST([LIB]NAME)
1039
1703
  AC_SUBST([LTLIB]NAME)
 
1704
  AC_SUBST([LIB]NAME[_PREFIX])
1040
1705
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1041
1706
  dnl results of this search when this library appears as a dependency.
1042
1707
  HAVE_LIB[]NAME=yes
1043
 
  undefine([Name])
1044
 
  undefine([NAME])
 
1708
  popdef([NAME])
 
1709
  popdef([Name])
1045
1710
])
1046
1711
 
1047
 
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
1712
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1048
1713
dnl searches for libname and the libraries corresponding to explicit and
1049
1714
dnl implicit dependencies, together with the specified include files and
1050
 
dnl the ability to compile and link the specified testcode. If found, it
1051
 
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1052
 
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
1715
dnl the ability to compile and link the specified testcode. The missing-message
 
1716
dnl defaults to 'no' and may contain additional hints for the user.
 
1717
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
 
1718
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1053
1719
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1054
1720
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
1721
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
1722
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1055
1723
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1056
1724
[
1057
1725
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1058
1726
  AC_REQUIRE([AC_LIB_RPATH])
1059
 
  define([Name],[translit([$1],[./-], [___])])
1060
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1061
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1727
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
 
1728
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
1729
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1062
1730
 
1063
1731
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1064
1732
  dnl accordingly.
1072
1740
 
1073
1741
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1074
1742
    ac_save_LIBS="$LIBS"
1075
 
    LIBS="$LIBS $LIB[]NAME"
1076
 
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
 
1743
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
 
1744
    dnl because these -l options might require -L options that are present in
 
1745
    dnl LIBS. -l options benefit only from the -L options listed before it.
 
1746
    dnl Otherwise, add it to the front of LIBS, because it may be a static
 
1747
    dnl library that depends on another static library that is present in LIBS.
 
1748
    dnl Static libraries benefit only from the static libraries listed after
 
1749
    dnl it.
 
1750
    case " $LIB[]NAME" in
 
1751
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
 
1752
      *)       LIBS="$LIB[]NAME $LIBS" ;;
 
1753
    esac
 
1754
    AC_LINK_IFELSE(
 
1755
      [AC_LANG_PROGRAM([[$3]], [[$4]])],
 
1756
      [ac_cv_lib[]Name=yes],
 
1757
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
1077
1758
    LIBS="$ac_save_LIBS"
1078
1759
  ])
1079
1760
  if test "$ac_cv_lib[]Name" = yes; then
1080
1761
    HAVE_LIB[]NAME=yes
1081
 
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
 
1762
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
1082
1763
    AC_MSG_CHECKING([how to link with lib[]$1])
1083
1764
    AC_MSG_RESULT([$LIB[]NAME])
1084
1765
  else
1088
1769
    CPPFLAGS="$ac_save_CPPFLAGS"
1089
1770
    LIB[]NAME=
1090
1771
    LTLIB[]NAME=
 
1772
    LIB[]NAME[]_PREFIX=
1091
1773
  fi
1092
1774
  AC_SUBST([HAVE_LIB]NAME)
1093
1775
  AC_SUBST([LIB]NAME)
1094
1776
  AC_SUBST([LTLIB]NAME)
1095
 
  undefine([Name])
1096
 
  undefine([NAME])
 
1777
  AC_SUBST([LIB]NAME[_PREFIX])
 
1778
  popdef([NAME])
 
1779
  popdef([Name])
1097
1780
])
1098
1781
 
1099
1782
dnl Determine the platform dependent parameters needed to use rpath:
1100
 
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1101
 
dnl hardcode_direct, hardcode_minus_L.
 
1783
dnl   acl_libext,
 
1784
dnl   acl_shlibext,
 
1785
dnl   acl_libname_spec,
 
1786
dnl   acl_library_names_spec,
 
1787
dnl   acl_hardcode_libdir_flag_spec,
 
1788
dnl   acl_hardcode_libdir_separator,
 
1789
dnl   acl_hardcode_direct,
 
1790
dnl   acl_hardcode_minus_L.
1102
1791
AC_DEFUN([AC_LIB_RPATH],
1103
1792
[
 
1793
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
1794
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1104
1795
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1105
1796
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1106
1797
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1107
1798
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1108
 
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
 
1799
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
1109
1800
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1110
1801
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1111
1802
    . ./conftest.sh
1113
1804
    acl_cv_rpath=done
1114
1805
  ])
1115
1806
  wl="$acl_cv_wl"
1116
 
  libext="$acl_cv_libext"
1117
 
  shlibext="$acl_cv_shlibext"
1118
 
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1119
 
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1120
 
  hardcode_direct="$acl_cv_hardcode_direct"
1121
 
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
1807
  acl_libext="$acl_cv_libext"
 
1808
  acl_shlibext="$acl_cv_shlibext"
 
1809
  acl_libname_spec="$acl_cv_libname_spec"
 
1810
  acl_library_names_spec="$acl_cv_library_names_spec"
 
1811
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
1812
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
1813
  acl_hardcode_direct="$acl_cv_hardcode_direct"
 
1814
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1122
1815
  dnl Determine whether the user wants rpath handling at all.
1123
 
  AC_ARG_ENABLE(rpath,
 
1816
  AC_ARG_ENABLE([rpath],
1124
1817
    [  --disable-rpath         do not hardcode runtime library paths],
1125
1818
    :, enable_rpath=yes)
1126
1819
])
1127
1820
 
 
1821
dnl AC_LIB_FROMPACKAGE(name, package)
 
1822
dnl declares that libname comes from the given package. The configure file
 
1823
dnl will then not have a --with-libname-prefix option but a
 
1824
dnl --with-package-prefix option. Several libraries can come from the same
 
1825
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
 
1826
dnl macro call that searches for libname.
 
1827
AC_DEFUN([AC_LIB_FROMPACKAGE],
 
1828
[
 
1829
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
1830
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
1831
  define([acl_frompackage_]NAME, [$2])
 
1832
  popdef([NAME])
 
1833
  pushdef([PACK],[$2])
 
1834
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
 
1835
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
1836
  define([acl_libsinpackage_]PACKUP,
 
1837
    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
 
1838
  popdef([PACKUP])
 
1839
  popdef([PACK])
 
1840
])
 
1841
 
1128
1842
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1129
1843
dnl the libraries corresponding to explicit and implicit dependencies.
1130
1844
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
1845
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
 
1846
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1131
1847
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1132
1848
[
1133
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1134
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1849
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1850
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
1851
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
1852
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
 
1853
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
 
1854
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
1855
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
 
1856
  dnl Autoconf >= 2.61 supports dots in --with options.
 
1857
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
1135
1858
  dnl By default, look in $includedir and $libdir.
1136
1859
  use_additional=yes
1137
1860
  AC_LIB_WITH_FINAL_PREFIX([
1138
1861
    eval additional_includedir=\"$includedir\"
1139
1862
    eval additional_libdir=\"$libdir\"
1140
1863
  ])
1141
 
  AC_LIB_ARG_WITH([lib$1-prefix],
1142
 
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1143
 
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
 
1864
  AC_ARG_WITH(P_A_C_K[-prefix],
 
1865
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
 
1866
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
1144
1867
[
1145
1868
    if test "X$withval" = "Xno"; then
1146
1869
      use_additional=no
1152
1875
        ])
1153
1876
      else
1154
1877
        additional_includedir="$withval/include"
1155
 
        additional_libdir="$withval/lib"
 
1878
        additional_libdir="$withval/$acl_libdirstem"
 
1879
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
 
1880
           && ! test -d "$withval/$acl_libdirstem"; then
 
1881
          additional_libdir="$withval/$acl_libdirstem2"
 
1882
        fi
1156
1883
      fi
1157
1884
    fi
1158
1885
])
1161
1888
  LIB[]NAME=
1162
1889
  LTLIB[]NAME=
1163
1890
  INC[]NAME=
 
1891
  LIB[]NAME[]_PREFIX=
 
1892
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
 
1893
  dnl computed. So it has to be reset here.
 
1894
  HAVE_LIB[]NAME=
1164
1895
  rpathdirs=
1165
1896
  ltrpathdirs=
1166
1897
  names_already_handled=
1180
1911
        names_already_handled="$names_already_handled $name"
1181
1912
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1182
1913
        dnl or AC_LIB_HAVE_LINKFLAGS call.
1183
 
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
1914
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
1184
1915
        eval value=\"\$HAVE_LIB$uppername\"
1185
1916
        if test -n "$value"; then
1186
1917
          if test "$value" = yes; then
1200
1931
          found_la=
1201
1932
          found_so=
1202
1933
          found_a=
 
1934
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
 
1935
          if test -n "$acl_shlibext"; then
 
1936
            shrext=".$acl_shlibext"             # typically: shrext=.so
 
1937
          else
 
1938
            shrext=
 
1939
          fi
1203
1940
          if test $use_additional = yes; then
1204
 
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1205
 
              found_dir="$additional_libdir"
1206
 
              found_so="$additional_libdir/lib$name.$shlibext"
1207
 
              if test -f "$additional_libdir/lib$name.la"; then
1208
 
                found_la="$additional_libdir/lib$name.la"
1209
 
              fi
1210
 
            else
1211
 
              if test -f "$additional_libdir/lib$name.$libext"; then
1212
 
                found_dir="$additional_libdir"
1213
 
                found_a="$additional_libdir/lib$name.$libext"
1214
 
                if test -f "$additional_libdir/lib$name.la"; then
1215
 
                  found_la="$additional_libdir/lib$name.la"
 
1941
            dir="$additional_libdir"
 
1942
            dnl The same code as in the loop below:
 
1943
            dnl First look for a shared library.
 
1944
            if test -n "$acl_shlibext"; then
 
1945
              if test -f "$dir/$libname$shrext"; then
 
1946
                found_dir="$dir"
 
1947
                found_so="$dir/$libname$shrext"
 
1948
              else
 
1949
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
1950
                  ver=`(cd "$dir" && \
 
1951
                        for f in "$libname$shrext".*; do echo "$f"; done \
 
1952
                        | sed -e "s,^$libname$shrext\\\\.,," \
 
1953
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
1954
                        | sed 1q ) 2>/dev/null`
 
1955
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
1956
                    found_dir="$dir"
 
1957
                    found_so="$dir/$libname$shrext.$ver"
 
1958
                  fi
 
1959
                else
 
1960
                  eval library_names=\"$acl_library_names_spec\"
 
1961
                  for f in $library_names; do
 
1962
                    if test -f "$dir/$f"; then
 
1963
                      found_dir="$dir"
 
1964
                      found_so="$dir/$f"
 
1965
                      break
 
1966
                    fi
 
1967
                  done
1216
1968
                fi
1217
1969
              fi
1218
1970
            fi
 
1971
            dnl Then look for a static library.
 
1972
            if test "X$found_dir" = "X"; then
 
1973
              if test -f "$dir/$libname.$acl_libext"; then
 
1974
                found_dir="$dir"
 
1975
                found_a="$dir/$libname.$acl_libext"
 
1976
              fi
 
1977
            fi
 
1978
            if test "X$found_dir" != "X"; then
 
1979
              if test -f "$dir/$libname.la"; then
 
1980
                found_la="$dir/$libname.la"
 
1981
              fi
 
1982
            fi
1219
1983
          fi
1220
1984
          if test "X$found_dir" = "X"; then
1221
1985
            for x in $LDFLAGS $LTLIB[]NAME; do
1223
1987
              case "$x" in
1224
1988
                -L*)
1225
1989
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1226
 
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1227
 
                    found_dir="$dir"
1228
 
                    found_so="$dir/lib$name.$shlibext"
1229
 
                    if test -f "$dir/lib$name.la"; then
1230
 
                      found_la="$dir/lib$name.la"
1231
 
                    fi
1232
 
                  else
1233
 
                    if test -f "$dir/lib$name.$libext"; then
 
1990
                  dnl First look for a shared library.
 
1991
                  if test -n "$acl_shlibext"; then
 
1992
                    if test -f "$dir/$libname$shrext"; then
1234
1993
                      found_dir="$dir"
1235
 
                      found_a="$dir/lib$name.$libext"
1236
 
                      if test -f "$dir/lib$name.la"; then
1237
 
                        found_la="$dir/lib$name.la"
 
1994
                      found_so="$dir/$libname$shrext"
 
1995
                    else
 
1996
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
1997
                        ver=`(cd "$dir" && \
 
1998
                              for f in "$libname$shrext".*; do echo "$f"; done \
 
1999
                              | sed -e "s,^$libname$shrext\\\\.,," \
 
2000
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
2001
                              | sed 1q ) 2>/dev/null`
 
2002
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
2003
                          found_dir="$dir"
 
2004
                          found_so="$dir/$libname$shrext.$ver"
 
2005
                        fi
 
2006
                      else
 
2007
                        eval library_names=\"$acl_library_names_spec\"
 
2008
                        for f in $library_names; do
 
2009
                          if test -f "$dir/$f"; then
 
2010
                            found_dir="$dir"
 
2011
                            found_so="$dir/$f"
 
2012
                            break
 
2013
                          fi
 
2014
                        done
1238
2015
                      fi
1239
2016
                    fi
1240
2017
                  fi
 
2018
                  dnl Then look for a static library.
 
2019
                  if test "X$found_dir" = "X"; then
 
2020
                    if test -f "$dir/$libname.$acl_libext"; then
 
2021
                      found_dir="$dir"
 
2022
                      found_a="$dir/$libname.$acl_libext"
 
2023
                    fi
 
2024
                  fi
 
2025
                  if test "X$found_dir" != "X"; then
 
2026
                    if test -f "$dir/$libname.la"; then
 
2027
                      found_la="$dir/$libname.la"
 
2028
                    fi
 
2029
                  fi
1241
2030
                  ;;
1242
2031
              esac
1243
2032
              if test "X$found_dir" != "X"; then
1252
2041
              dnl Linking with a shared library. We attempt to hardcode its
1253
2042
              dnl directory into the executable's runpath, unless it's the
1254
2043
              dnl standard /usr/lib.
1255
 
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
 
2044
              if test "$enable_rpath" = no \
 
2045
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
 
2046
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
1256
2047
                dnl No hardcoding is needed.
1257
2048
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1258
2049
              else
1271
2062
                  ltrpathdirs="$ltrpathdirs $found_dir"
1272
2063
                fi
1273
2064
                dnl The hardcoding into $LIBNAME is system dependent.
1274
 
                if test "$hardcode_direct" = yes; then
 
2065
                if test "$acl_hardcode_direct" = yes; then
1275
2066
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1276
2067
                  dnl resulting binary.
1277
2068
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1278
2069
                else
1279
 
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
2070
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1280
2071
                    dnl Use an explicit option to hardcode DIR into the resulting
1281
2072
                    dnl binary.
1282
2073
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1307
2098
                    if test -z "$haveit"; then
1308
2099
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1309
2100
                    fi
1310
 
                    if test "$hardcode_minus_L" != no; then
 
2101
                    if test "$acl_hardcode_minus_L" != no; then
1311
2102
                      dnl FIXME: Not sure whether we should use
1312
2103
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1313
2104
                      dnl here.
1314
2105
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1315
2106
                    else
1316
 
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
 
2107
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1317
2108
                      dnl here, because this doesn't fit in flags passed to the
1318
2109
                      dnl compiler. So give up. No hardcoding. This affects only
1319
2110
                      dnl very old systems.
1338
2129
            dnl Assume the include files are nearby.
1339
2130
            additional_includedir=
1340
2131
            case "$found_dir" in
1341
 
              */lib | */lib/)
1342
 
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
 
2132
              */$acl_libdirstem | */$acl_libdirstem/)
 
2133
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
 
2134
                if test "$name" = '$1'; then
 
2135
                  LIB[]NAME[]_PREFIX="$basedir"
 
2136
                fi
 
2137
                additional_includedir="$basedir/include"
 
2138
                ;;
 
2139
              */$acl_libdirstem2 | */$acl_libdirstem2/)
 
2140
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
 
2141
                if test "$name" = '$1'; then
 
2142
                  LIB[]NAME[]_PREFIX="$basedir"
 
2143
                fi
1343
2144
                additional_includedir="$basedir/include"
1344
2145
                ;;
1345
2146
            esac
1356
2157
                if test "X$additional_includedir" = "X/usr/local/include"; then
1357
2158
                  if test -n "$GCC"; then
1358
2159
                    case $host_os in
1359
 
                      linux*) haveit=yes;;
 
2160
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1360
2161
                    esac
1361
2162
                  fi
1362
2163
                fi
1400
2201
                    dnl   3. if it's already present in $LDFLAGS or the already
1401
2202
                    dnl      constructed $LIBNAME,
1402
2203
                    dnl   4. if it doesn't exist as a directory.
1403
 
                    if test "X$additional_libdir" != "X/usr/lib"; then
 
2204
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
 
2205
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
1404
2206
                      haveit=
1405
 
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
 
2207
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
 
2208
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
1406
2209
                        if test -n "$GCC"; then
1407
2210
                          case $host_os in
1408
 
                            linux*) haveit=yes;;
 
2211
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1409
2212
                          esac
1410
2213
                        fi
1411
2214
                      fi
1501
2304
    done
1502
2305
  done
1503
2306
  if test "X$rpathdirs" != "X"; then
1504
 
    if test -n "$hardcode_libdir_separator"; then
 
2307
    if test -n "$acl_hardcode_libdir_separator"; then
1505
2308
      dnl Weird platform: only the last -rpath option counts, the user must
1506
2309
      dnl pass all path elements in one option. We can arrange that for a
1507
2310
      dnl single library, but not when more than one $LIBNAMEs are used.
1508
2311
      alldirs=
1509
2312
      for found_dir in $rpathdirs; do
1510
 
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
 
2313
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1511
2314
      done
1512
 
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
 
2315
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1513
2316
      acl_save_libdir="$libdir"
1514
2317
      libdir="$alldirs"
1515
 
      eval flag=\"$hardcode_libdir_flag_spec\"
 
2318
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
1516
2319
      libdir="$acl_save_libdir"
1517
2320
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1518
2321
    else
1520
2323
      for found_dir in $rpathdirs; do
1521
2324
        acl_save_libdir="$libdir"
1522
2325
        libdir="$found_dir"
1523
 
        eval flag=\"$hardcode_libdir_flag_spec\"
 
2326
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
1524
2327
        libdir="$acl_save_libdir"
1525
2328
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1526
2329
      done
1533
2336
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1534
2337
    done
1535
2338
  fi
 
2339
  popdef([P_A_C_K])
 
2340
  popdef([PACKLIBS])
 
2341
  popdef([PACKUP])
 
2342
  popdef([PACK])
 
2343
  popdef([NAME])
1536
2344
])
1537
2345
 
1538
2346
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1555
2363
    fi
1556
2364
  done
1557
2365
])
1558
 
# lib-prefix.m4 serial 3 (gettext-0.13)
1559
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1560
 
dnl This file is free software, distributed under the terms of the GNU
1561
 
dnl General Public License.  As a special exception to the GNU General
1562
 
dnl Public License, this file may be distributed as part of a program
1563
 
dnl that contains a configuration script generated by Autoconf, under
1564
 
dnl the same distribution terms as the rest of that program.
 
2366
 
 
2367
dnl For those cases where a variable contains several -L and -l options
 
2368
dnl referring to unknown libraries and directories, this macro determines the
 
2369
dnl necessary additional linker options for the runtime path.
 
2370
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
 
2371
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
 
2372
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
 
2373
dnl otherwise linking without libtool is assumed.
 
2374
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 
2375
[
 
2376
  AC_REQUIRE([AC_LIB_RPATH])
 
2377
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
2378
  $1=
 
2379
  if test "$enable_rpath" != no; then
 
2380
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
2381
      dnl Use an explicit option to hardcode directories into the resulting
 
2382
      dnl binary.
 
2383
      rpathdirs=
 
2384
      next=
 
2385
      for opt in $2; do
 
2386
        if test -n "$next"; then
 
2387
          dir="$next"
 
2388
          dnl No need to hardcode the standard /usr/lib.
 
2389
          if test "X$dir" != "X/usr/$acl_libdirstem" \
 
2390
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
2391
            rpathdirs="$rpathdirs $dir"
 
2392
          fi
 
2393
          next=
 
2394
        else
 
2395
          case $opt in
 
2396
            -L) next=yes ;;
 
2397
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
 
2398
                 dnl No need to hardcode the standard /usr/lib.
 
2399
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
 
2400
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
2401
                   rpathdirs="$rpathdirs $dir"
 
2402
                 fi
 
2403
                 next= ;;
 
2404
            *) next= ;;
 
2405
          esac
 
2406
        fi
 
2407
      done
 
2408
      if test "X$rpathdirs" != "X"; then
 
2409
        if test -n ""$3""; then
 
2410
          dnl libtool is used for linking. Use -R options.
 
2411
          for dir in $rpathdirs; do
 
2412
            $1="${$1}${$1:+ }-R$dir"
 
2413
          done
 
2414
        else
 
2415
          dnl The linker is used for linking directly.
 
2416
          if test -n "$acl_hardcode_libdir_separator"; then
 
2417
            dnl Weird platform: only the last -rpath option counts, the user
 
2418
            dnl must pass all path elements in one option.
 
2419
            alldirs=
 
2420
            for dir in $rpathdirs; do
 
2421
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
 
2422
            done
 
2423
            acl_save_libdir="$libdir"
 
2424
            libdir="$alldirs"
 
2425
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
2426
            libdir="$acl_save_libdir"
 
2427
            $1="$flag"
 
2428
          else
 
2429
            dnl The -rpath options are cumulative.
 
2430
            for dir in $rpathdirs; do
 
2431
              acl_save_libdir="$libdir"
 
2432
              libdir="$dir"
 
2433
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
2434
              libdir="$acl_save_libdir"
 
2435
              $1="${$1}${$1:+ }$flag"
 
2436
            done
 
2437
          fi
 
2438
        fi
 
2439
      fi
 
2440
    fi
 
2441
  fi
 
2442
  AC_SUBST([$1])
 
2443
])
 
2444
 
 
2445
# lib-prefix.m4 serial 7 (gettext-0.18)
 
2446
dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc.
 
2447
dnl This file is free software; the Free Software Foundation
 
2448
dnl gives unlimited permission to copy and/or distribute it,
 
2449
dnl with or without modifications, as long as this notice is preserved.
1565
2450
 
1566
2451
dnl From Bruno Haible.
1567
2452
 
1583
2468
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1584
2469
  AC_REQUIRE([AC_PROG_CC])
1585
2470
  AC_REQUIRE([AC_CANONICAL_HOST])
 
2471
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1586
2472
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1587
2473
  dnl By default, look in $includedir and $libdir.
1588
2474
  use_additional=yes
1604
2490
        ])
1605
2491
      else
1606
2492
        additional_includedir="$withval/include"
1607
 
        additional_libdir="$withval/lib"
 
2493
        additional_libdir="$withval/$acl_libdirstem"
1608
2494
      fi
1609
2495
    fi
1610
2496
])
1628
2514
        if test "X$additional_includedir" = "X/usr/local/include"; then
1629
2515
          if test -n "$GCC"; then
1630
2516
            case $host_os in
1631
 
              linux*) haveit=yes;;
 
2517
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1632
2518
            esac
1633
2519
          fi
1634
2520
        fi
1646
2532
    dnl   2. if it's already present in $LDFLAGS,
1647
2533
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1648
2534
    dnl   4. if it doesn't exist as a directory.
1649
 
    if test "X$additional_libdir" != "X/usr/lib"; then
 
2535
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1650
2536
      haveit=
1651
2537
      for x in $LDFLAGS; do
1652
2538
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1656
2542
        fi
1657
2543
      done
1658
2544
      if test -z "$haveit"; then
1659
 
        if test "X$additional_libdir" = "X/usr/local/lib"; then
 
2545
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1660
2546
          if test -n "$GCC"; then
1661
2547
            case $host_os in
1662
2548
              linux*) haveit=yes;;
1710
2596
  exec_prefix="$acl_save_exec_prefix"
1711
2597
  prefix="$acl_save_prefix"
1712
2598
])
1713
 
# longdouble.m4 serial 1 (gettext-0.12)
1714
 
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
1715
 
dnl This file is free software, distributed under the terms of the GNU
1716
 
dnl General Public License.  As a special exception to the GNU General
1717
 
dnl Public License, this file may be distributed as part of a program
1718
 
dnl that contains a configuration script generated by Autoconf, under
1719
 
dnl the same distribution terms as the rest of that program.
 
2599
 
 
2600
dnl AC_LIB_PREPARE_MULTILIB creates
 
2601
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
 
2602
dnl   "lib" or "lib64" or "lib/64",
 
2603
dnl - a variable acl_libdirstem2, as a secondary possible value for
 
2604
dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
 
2605
dnl   "lib/amd64".
 
2606
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 
2607
[
 
2608
  dnl There is no formal standard regarding lib and lib64.
 
2609
  dnl On glibc systems, the current practice is that on a system supporting
 
2610
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
 
2611
  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
 
2612
  dnl the compiler's default mode by looking at the compiler's library search
 
2613
  dnl path. If at least one of its elements ends in /lib64 or points to a
 
2614
  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
 
2615
  dnl Otherwise we use the default, namely "lib".
 
2616
  dnl On Solaris systems, the current practice is that on a system supporting
 
2617
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
 
2618
  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
 
2619
  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
 
2620
  AC_REQUIRE([AC_CANONICAL_HOST])
 
2621
  acl_libdirstem=lib
 
2622
  acl_libdirstem2=
 
2623
  case "$host_os" in
 
2624
    solaris*)
 
2625
      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
 
2626
      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
 
2627
      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
 
2628
      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
 
2629
      dnl symlink is missing, so we set acl_libdirstem2 too.
 
2630
      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
 
2631
        [AC_EGREP_CPP([sixtyfour bits], [
 
2632
#ifdef _LP64
 
2633
sixtyfour bits
 
2634
#endif
 
2635
           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
 
2636
        ])
 
2637
      if test $gl_cv_solaris_64bit = yes; then
 
2638
        acl_libdirstem=lib/64
 
2639
        case "$host_cpu" in
 
2640
          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
 
2641
          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
 
2642
        esac
 
2643
      fi
 
2644
      ;;
 
2645
    *)
 
2646
      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
 
2647
      if test -n "$searchpath"; then
 
2648
        acl_save_IFS="${IFS=    }"; IFS=":"
 
2649
        for searchdir in $searchpath; do
 
2650
          if test -d "$searchdir"; then
 
2651
            case "$searchdir" in
 
2652
              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
 
2653
              */../ | */.. )
 
2654
                # Better ignore directories of this form. They are misleading.
 
2655
                ;;
 
2656
              *) searchdir=`cd "$searchdir" && pwd`
 
2657
                 case "$searchdir" in
 
2658
                   */lib64 ) acl_libdirstem=lib64 ;;
 
2659
                 esac ;;
 
2660
            esac
 
2661
          fi
 
2662
        done
 
2663
        IFS="$acl_save_IFS"
 
2664
      fi
 
2665
      ;;
 
2666
  esac
 
2667
  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
 
2668
])
 
2669
 
 
2670
# lock.m4 serial 13 (gettext-0.18.2)
 
2671
dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
 
2672
dnl This file is free software; the Free Software Foundation
 
2673
dnl gives unlimited permission to copy and/or distribute it,
 
2674
dnl with or without modifications, as long as this notice is preserved.
1720
2675
 
1721
2676
dnl From Bruno Haible.
1722
 
dnl Test whether the compiler supports the 'long double' type.
1723
 
dnl Prerequisite: AC_PROG_CC
1724
 
 
1725
 
AC_DEFUN([gt_TYPE_LONGDOUBLE],
1726
 
[
1727
 
  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
1728
 
    [if test "$GCC" = yes; then
1729
 
       gt_cv_c_long_double=yes
1730
 
     else
1731
 
       AC_TRY_COMPILE([
1732
 
         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
1733
 
         long double foo = 0.0;
1734
 
         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
1735
 
         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
1736
 
         ], ,
1737
 
         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
 
2677
 
 
2678
AC_DEFUN([gl_LOCK],
 
2679
[
 
2680
  AC_REQUIRE([gl_THREADLIB])
 
2681
  if test "$gl_threads_api" = posix; then
 
2682
    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
 
2683
    # pthread_rwlock_* functions.
 
2684
    AC_CHECK_TYPE([pthread_rwlock_t],
 
2685
      [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
 
2686
         [Define if the POSIX multithreading library has read/write locks.])],
 
2687
      [],
 
2688
      [#include <pthread.h>])
 
2689
    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
 
2690
    AC_COMPILE_IFELSE([
 
2691
      AC_LANG_PROGRAM(
 
2692
        [[#include <pthread.h>]],
 
2693
        [[
 
2694
#if __FreeBSD__ == 4
 
2695
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
 
2696
#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
 
2697
       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
 
2698
error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
 
2699
#else
 
2700
int x = (int)PTHREAD_MUTEX_RECURSIVE;
 
2701
return !x;
 
2702
#endif
 
2703
        ]])],
 
2704
      [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
 
2705
         [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
 
2706
  fi
 
2707
  gl_PREREQ_LOCK
 
2708
])
 
2709
 
 
2710
# Prerequisites of lib/glthread/lock.c.
 
2711
AC_DEFUN([gl_PREREQ_LOCK], [:])
 
2712
 
 
2713
# longlong.m4 serial 17
 
2714
dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
 
2715
dnl This file is free software; the Free Software Foundation
 
2716
dnl gives unlimited permission to copy and/or distribute it,
 
2717
dnl with or without modifications, as long as this notice is preserved.
 
2718
 
 
2719
dnl From Paul Eggert.
 
2720
 
 
2721
# Define HAVE_LONG_LONG_INT if 'long long int' works.
 
2722
# This fixes a bug in Autoconf 2.61, and can be faster
 
2723
# than what's in Autoconf 2.62 through 2.68.
 
2724
 
 
2725
# Note: If the type 'long long int' exists but is only 32 bits large
 
2726
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
 
2727
# defined. In this case you can treat 'long long int' like 'long int'.
 
2728
 
 
2729
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
 
2730
[
 
2731
  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
 
2732
  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
 
2733
     [ac_cv_type_long_long_int=yes
 
2734
      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
 
2735
        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
 
2736
        if test $ac_cv_type_long_long_int = yes; then
 
2737
          dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
 
2738
          dnl If cross compiling, assume the bug is not important, since
 
2739
          dnl nobody cross compiles for this platform as far as we know.
 
2740
          AC_RUN_IFELSE(
 
2741
            [AC_LANG_PROGRAM(
 
2742
               [[@%:@include <limits.h>
 
2743
                 @%:@ifndef LLONG_MAX
 
2744
                 @%:@ define HALF \
 
2745
                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
 
2746
                 @%:@ define LLONG_MAX (HALF - 1 + HALF)
 
2747
                 @%:@endif]],
 
2748
               [[long long int n = 1;
 
2749
                 int i;
 
2750
                 for (i = 0; ; i++)
 
2751
                   {
 
2752
                     long long int m = n << i;
 
2753
                     if (m >> i != n)
 
2754
                       return 1;
 
2755
                     if (LLONG_MAX / 2 < m)
 
2756
                       break;
 
2757
                   }
 
2758
                 return 0;]])],
 
2759
            [],
 
2760
            [ac_cv_type_long_long_int=no],
 
2761
            [:])
 
2762
        fi
 
2763
      fi])
 
2764
  if test $ac_cv_type_long_long_int = yes; then
 
2765
    AC_DEFINE([HAVE_LONG_LONG_INT], [1],
 
2766
      [Define to 1 if the system has the type 'long long int'.])
 
2767
  fi
 
2768
])
 
2769
 
 
2770
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
 
2771
# This fixes a bug in Autoconf 2.61, and can be faster
 
2772
# than what's in Autoconf 2.62 through 2.68.
 
2773
 
 
2774
# Note: If the type 'unsigned long long int' exists but is only 32 bits
 
2775
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
 
2776
# will not be defined. In this case you can treat 'unsigned long long int'
 
2777
# like 'unsigned long int'.
 
2778
 
 
2779
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
 
2780
[
 
2781
  AC_CACHE_CHECK([for unsigned long long int],
 
2782
    [ac_cv_type_unsigned_long_long_int],
 
2783
    [ac_cv_type_unsigned_long_long_int=yes
 
2784
     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
 
2785
       AC_LINK_IFELSE(
 
2786
         [_AC_TYPE_LONG_LONG_SNIPPET],
 
2787
         [],
 
2788
         [ac_cv_type_unsigned_long_long_int=no])
1738
2789
     fi])
1739
 
  if test $gt_cv_c_long_double = yes; then
1740
 
    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
 
2790
  if test $ac_cv_type_unsigned_long_long_int = yes; then
 
2791
    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
 
2792
      [Define to 1 if the system has the type 'unsigned long long int'.])
1741
2793
  fi
1742
2794
])
1743
 
# longlong.m4 serial 4
1744
 
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
1745
 
dnl This file is free software, distributed under the terms of the GNU
1746
 
dnl General Public License.  As a special exception to the GNU General
1747
 
dnl Public License, this file may be distributed as part of a program
1748
 
dnl that contains a configuration script generated by Autoconf, under
1749
 
dnl the same distribution terms as the rest of that program.
1750
 
 
1751
 
dnl From Paul Eggert.
1752
 
 
1753
 
# Define HAVE_LONG_LONG if 'long long' works.
1754
 
 
1755
 
AC_DEFUN([jm_AC_TYPE_LONG_LONG],
 
2795
 
 
2796
# Expands to a C program that can be used to test for simultaneous support
 
2797
# of 'long long' and 'unsigned long long'. We don't want to say that
 
2798
# 'long long' is available if 'unsigned long long' is not, or vice versa,
 
2799
# because too many programs rely on the symmetry between signed and unsigned
 
2800
# integer types (excluding 'bool').
 
2801
AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
1756
2802
[
1757
 
  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1758
 
  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
1759
 
    [long long llmax = (long long) -1;
1760
 
     return ll << i | ll >> i | llmax / ll | llmax % ll;],
1761
 
    ac_cv_type_long_long=yes,
1762
 
    ac_cv_type_long_long=no)])
1763
 
  if test $ac_cv_type_long_long = yes; then
1764
 
    AC_DEFINE(HAVE_LONG_LONG, 1,
1765
 
      [Define if you have the 'long long' type.])
1766
 
  fi
 
2803
  AC_LANG_PROGRAM(
 
2804
    [[/* For now, do not test the preprocessor; as of 2007 there are too many
 
2805
         implementations with broken preprocessors.  Perhaps this can
 
2806
         be revisited in 2012.  In the meantime, code should not expect
 
2807
         #if to work with literals wider than 32 bits.  */
 
2808
      /* Test literals.  */
 
2809
      long long int ll = 9223372036854775807ll;
 
2810
      long long int nll = -9223372036854775807LL;
 
2811
      unsigned long long int ull = 18446744073709551615ULL;
 
2812
      /* Test constant expressions.   */
 
2813
      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
 
2814
                     ? 1 : -1)];
 
2815
      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
 
2816
                     ? 1 : -1)];
 
2817
      int i = 63;]],
 
2818
    [[/* Test availability of runtime routines for shift and division.  */
 
2819
      long long int llmax = 9223372036854775807ll;
 
2820
      unsigned long long int ullmax = 18446744073709551615ull;
 
2821
      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
 
2822
              | (llmax / ll) | (llmax % ll)
 
2823
              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
 
2824
              | (ullmax / ull) | (ullmax % ull));]])
1767
2825
])
1768
 
# nls.m4 serial 1 (gettext-0.12)
1769
 
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1770
 
dnl This file is free software, distributed under the terms of the GNU
1771
 
dnl General Public License.  As a special exception to the GNU General
1772
 
dnl Public License, this file may be distributed as part of a program
1773
 
dnl that contains a configuration script generated by Autoconf, under
1774
 
dnl the same distribution terms as the rest of that program.
 
2826
 
 
2827
# nls.m4 serial 5 (gettext-0.18)
 
2828
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
 
2829
dnl Inc.
 
2830
dnl This file is free software; the Free Software Foundation
 
2831
dnl gives unlimited permission to copy and/or distribute it,
 
2832
dnl with or without modifications, as long as this notice is preserved.
1775
2833
dnl
1776
2834
dnl This file can can be used in projects which are not available under
1777
2835
dnl the GNU General Public License or the GNU Library General Public
1786
2844
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1787
2845
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1788
2846
 
 
2847
AC_PREREQ([2.50])
 
2848
 
1789
2849
AC_DEFUN([AM_NLS],
1790
2850
[
1791
2851
  AC_MSG_CHECKING([whether NLS is requested])
1792
2852
  dnl Default is enabled NLS
1793
 
  AC_ARG_ENABLE(nls,
 
2853
  AC_ARG_ENABLE([nls],
1794
2854
    [  --disable-nls           do not use Native Language Support],
1795
2855
    USE_NLS=$enableval, USE_NLS=yes)
1796
 
  AC_MSG_RESULT($USE_NLS)
1797
 
  AC_SUBST(USE_NLS)
1798
 
])
1799
 
 
1800
 
AC_DEFUN([AM_MKINSTALLDIRS],
1801
 
[
1802
 
  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1803
 
  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1804
 
  dnl Try to locate it.
1805
 
  MKINSTALLDIRS=
1806
 
  if test -n "$ac_aux_dir"; then
1807
 
    case "$ac_aux_dir" in
1808
 
      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1809
 
      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1810
 
    esac
1811
 
  fi
1812
 
  if test -z "$MKINSTALLDIRS"; then
1813
 
    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1814
 
  fi
1815
 
  AC_SUBST(MKINSTALLDIRS)
1816
 
])
1817
 
# po.m4 serial 3 (gettext-0.14)
1818
 
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1819
 
dnl This file is free software, distributed under the terms of the GNU
1820
 
dnl General Public License.  As a special exception to the GNU General
1821
 
dnl Public License, this file may be distributed as part of a program
1822
 
dnl that contains a configuration script generated by Autoconf, under
1823
 
dnl the same distribution terms as the rest of that program.
 
2856
  AC_MSG_RESULT([$USE_NLS])
 
2857
  AC_SUBST([USE_NLS])
 
2858
])
 
2859
 
 
2860
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
2861
# serial 1 (pkg-config-0.24)
 
2862
 
2863
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
2864
#
 
2865
# This program is free software; you can redistribute it and/or modify
 
2866
# it under the terms of the GNU General Public License as published by
 
2867
# the Free Software Foundation; either version 2 of the License, or
 
2868
# (at your option) any later version.
 
2869
#
 
2870
# This program is distributed in the hope that it will be useful, but
 
2871
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
2872
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
2873
# General Public License for more details.
 
2874
#
 
2875
# You should have received a copy of the GNU General Public License
 
2876
# along with this program; if not, write to the Free Software
 
2877
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
2878
#
 
2879
# As a special exception to the GNU General Public License, if you
 
2880
# distribute this file as part of a program that contains a
 
2881
# configuration script generated by Autoconf, you may include it under
 
2882
# the same distribution terms that you use for the rest of that program.
 
2883
 
 
2884
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
2885
# ----------------------------------
 
2886
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
2887
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
2888
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
 
2889
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 
2890
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
2891
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
2892
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
2893
 
 
2894
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
2895
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
2896
fi
 
2897
if test -n "$PKG_CONFIG"; then
 
2898
        _pkg_min_version=m4_default([$1], [0.9.0])
 
2899
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
2900
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
2901
                AC_MSG_RESULT([yes])
 
2902
        else
 
2903
                AC_MSG_RESULT([no])
 
2904
                PKG_CONFIG=""
 
2905
        fi
 
2906
fi[]dnl
 
2907
])# PKG_PROG_PKG_CONFIG
 
2908
 
 
2909
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
2910
#
 
2911
# Check to see whether a particular set of modules exists.  Similar
 
2912
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
2913
#
 
2914
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
2915
# only at the first occurence in configure.ac, so if the first place
 
2916
# it's called might be skipped (such as if it is within an "if", you
 
2917
# have to call PKG_CHECK_EXISTS manually
 
2918
# --------------------------------------------------------------
 
2919
AC_DEFUN([PKG_CHECK_EXISTS],
 
2920
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
2921
if test -n "$PKG_CONFIG" && \
 
2922
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
2923
  m4_default([$2], [:])
 
2924
m4_ifvaln([$3], [else
 
2925
  $3])dnl
 
2926
fi])
 
2927
 
 
2928
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
2929
# ---------------------------------------------
 
2930
m4_define([_PKG_CONFIG],
 
2931
[if test -n "$$1"; then
 
2932
    pkg_cv_[]$1="$$1"
 
2933
 elif test -n "$PKG_CONFIG"; then
 
2934
    PKG_CHECK_EXISTS([$3],
 
2935
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
 
2936
                      test "x$?" != "x0" && pkg_failed=yes ],
 
2937
                     [pkg_failed=yes])
 
2938
 else
 
2939
    pkg_failed=untried
 
2940
fi[]dnl
 
2941
])# _PKG_CONFIG
 
2942
 
 
2943
# _PKG_SHORT_ERRORS_SUPPORTED
 
2944
# -----------------------------
 
2945
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
2946
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
2947
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
2948
        _pkg_short_errors_supported=yes
 
2949
else
 
2950
        _pkg_short_errors_supported=no
 
2951
fi[]dnl
 
2952
])# _PKG_SHORT_ERRORS_SUPPORTED
 
2953
 
 
2954
 
 
2955
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
2956
# [ACTION-IF-NOT-FOUND])
 
2957
#
 
2958
#
 
2959
# Note that if there is a possibility the first call to
 
2960
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
2961
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
2962
#
 
2963
#
 
2964
# --------------------------------------------------------------
 
2965
AC_DEFUN([PKG_CHECK_MODULES],
 
2966
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
2967
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
2968
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
2969
 
 
2970
pkg_failed=no
 
2971
AC_MSG_CHECKING([for $1])
 
2972
 
 
2973
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
2974
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
2975
 
 
2976
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
2977
and $1[]_LIBS to avoid the need to call pkg-config.
 
2978
See the pkg-config man page for more details.])
 
2979
 
 
2980
if test $pkg_failed = yes; then
 
2981
        AC_MSG_RESULT([no])
 
2982
        _PKG_SHORT_ERRORS_SUPPORTED
 
2983
        if test $_pkg_short_errors_supported = yes; then
 
2984
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
 
2985
        else 
 
2986
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
 
2987
        fi
 
2988
        # Put the nasty error message in config.log where it belongs
 
2989
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
2990
 
 
2991
        m4_default([$4], [AC_MSG_ERROR(
 
2992
[Package requirements ($2) were not met:
 
2993
 
 
2994
$$1_PKG_ERRORS
 
2995
 
 
2996
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
2997
installed software in a non-standard prefix.
 
2998
 
 
2999
_PKG_TEXT])[]dnl
 
3000
        ])
 
3001
elif test $pkg_failed = untried; then
 
3002
        AC_MSG_RESULT([no])
 
3003
        m4_default([$4], [AC_MSG_FAILURE(
 
3004
[The pkg-config script could not be found or is too old.  Make sure it
 
3005
is in your PATH or set the PKG_CONFIG environment variable to the full
 
3006
path to pkg-config.
 
3007
 
 
3008
_PKG_TEXT
 
3009
 
 
3010
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
 
3011
        ])
 
3012
else
 
3013
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
3014
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
3015
        AC_MSG_RESULT([yes])
 
3016
        $3
 
3017
fi[]dnl
 
3018
])# PKG_CHECK_MODULES
 
3019
 
 
3020
 
 
3021
# PKG_INSTALLDIR(DIRECTORY)
 
3022
# -------------------------
 
3023
# Substitutes the variable pkgconfigdir as the location where a module
 
3024
# should install pkg-config .pc files. By default the directory is
 
3025
# $libdir/pkgconfig, but the default can be changed by passing
 
3026
# DIRECTORY. The user can override through the --with-pkgconfigdir
 
3027
# parameter.
 
3028
AC_DEFUN([PKG_INSTALLDIR],
 
3029
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
 
3030
m4_pushdef([pkg_description],
 
3031
    [pkg-config installation directory @<:@]pkg_default[@:>@])
 
3032
AC_ARG_WITH([pkgconfigdir],
 
3033
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
 
3034
    [with_pkgconfigdir=]pkg_default)
 
3035
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
 
3036
m4_popdef([pkg_default])
 
3037
m4_popdef([pkg_description])
 
3038
]) dnl PKG_INSTALLDIR
 
3039
 
 
3040
 
 
3041
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
 
3042
# -------------------------
 
3043
# Substitutes the variable noarch_pkgconfigdir as the location where a
 
3044
# module should install arch-independent pkg-config .pc files. By
 
3045
# default the directory is $datadir/pkgconfig, but the default can be
 
3046
# changed by passing DIRECTORY. The user can override through the
 
3047
# --with-noarch-pkgconfigdir parameter.
 
3048
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
 
3049
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
 
3050
m4_pushdef([pkg_description],
 
3051
    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
 
3052
AC_ARG_WITH([noarch-pkgconfigdir],
 
3053
    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
 
3054
    [with_noarch_pkgconfigdir=]pkg_default)
 
3055
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
 
3056
m4_popdef([pkg_default])
 
3057
m4_popdef([pkg_description])
 
3058
]) dnl PKG_NOARCH_INSTALLDIR
 
3059
 
 
3060
 
 
3061
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
 
3062
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
3063
# -------------------------------------------
 
3064
# Retrieves the value of the pkg-config variable for the given module.
 
3065
AC_DEFUN([PKG_CHECK_VAR],
 
3066
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
3067
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
 
3068
 
 
3069
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
 
3070
AS_VAR_COPY([$1], [pkg_cv_][$1])
 
3071
 
 
3072
AS_VAR_IF([$1], [""], [$5], [$4])dnl
 
3073
])# PKG_CHECK_VAR
 
3074
 
 
3075
# po.m4 serial 21 (gettext-0.18.3)
 
3076
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 
3077
dnl This file is free software; the Free Software Foundation
 
3078
dnl gives unlimited permission to copy and/or distribute it,
 
3079
dnl with or without modifications, as long as this notice is preserved.
1824
3080
dnl
1825
3081
dnl This file can can be used in projects which are not available under
1826
3082
dnl the GNU General Public License or the GNU Library General Public
1835
3091
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1836
3092
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1837
3093
 
 
3094
AC_PREREQ([2.60])
 
3095
 
1838
3096
dnl Checks for all prerequisites of the po subdirectory.
1839
3097
AC_DEFUN([AM_PO_SUBDIRS],
1840
3098
[
1841
3099
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1842
3100
  AC_REQUIRE([AC_PROG_INSTALL])dnl
1843
 
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
 
3101
  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 
3102
  AC_REQUIRE([AC_PROG_SED])dnl
1844
3103
  AC_REQUIRE([AM_NLS])dnl
1845
3104
 
 
3105
  dnl Release version of the gettext macros. This is used to ensure that
 
3106
  dnl the gettext macros and po/Makefile.in.in are in sync.
 
3107
  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
 
3108
 
1846
3109
  dnl Perform the following tests also if --disable-nls has been given,
1847
3110
  dnl because they are needed for "make dist" to work.
1848
3111
 
1850
3113
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1851
3114
  dnl The second test excludes FreeBSD msgfmt.
1852
3115
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1853
 
    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
 
3116
    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1854
3117
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1855
3118
    :)
1856
 
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
3119
  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
 
3120
 
 
3121
  dnl Test whether it is GNU msgfmt >= 0.15.
 
3122
changequote(,)dnl
 
3123
  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3124
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
 
3125
    *) MSGFMT_015=$MSGFMT ;;
 
3126
  esac
 
3127
changequote([,])dnl
 
3128
  AC_SUBST([MSGFMT_015])
 
3129
changequote(,)dnl
 
3130
  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3131
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
 
3132
    *) GMSGFMT_015=$GMSGFMT ;;
 
3133
  esac
 
3134
changequote([,])dnl
 
3135
  AC_SUBST([GMSGFMT_015])
1857
3136
 
1858
3137
  dnl Search for GNU xgettext 0.12 or newer in the PATH.
1859
3138
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1860
3139
  dnl The second test excludes FreeBSD xgettext.
1861
3140
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1862
 
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
 
3141
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1863
3142
     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1864
3143
    :)
1865
3144
  dnl Remove leftover from FreeBSD xgettext call.
1866
3145
  rm -f messages.po
1867
3146
 
 
3147
  dnl Test whether it is GNU xgettext >= 0.15.
 
3148
changequote(,)dnl
 
3149
  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3150
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
 
3151
    *) XGETTEXT_015=$XGETTEXT ;;
 
3152
  esac
 
3153
changequote([,])dnl
 
3154
  AC_SUBST([XGETTEXT_015])
 
3155
 
1868
3156
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1869
3157
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1870
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1871
 
 
1872
 
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1873
 
  dnl Test whether we really found GNU msgfmt.
1874
 
  if test "$GMSGFMT" != ":"; then
1875
 
    dnl If it is no GNU msgfmt we define it as : so that the
1876
 
    dnl Makefiles still can work.
1877
 
    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1878
 
       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1879
 
      : ;
1880
 
    else
1881
 
      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1882
 
      AC_MSG_RESULT(
1883
 
        [found $GMSGFMT program is not GNU msgfmt; ignore it])
1884
 
      GMSGFMT=":"
1885
 
    fi
1886
 
  fi
1887
 
 
1888
 
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1889
 
  dnl Test whether we really found GNU xgettext.
1890
 
  if test "$XGETTEXT" != ":"; then
1891
 
    dnl If it is no GNU xgettext we define it as : so that the
1892
 
    dnl Makefiles still can work.
1893
 
    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1894
 
       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1895
 
      : ;
1896
 
    else
1897
 
      AC_MSG_RESULT(
1898
 
        [found xgettext program is not GNU xgettext; ignore it])
1899
 
      XGETTEXT=":"
1900
 
    fi
1901
 
    dnl Remove leftover from FreeBSD xgettext call.
1902
 
    rm -f messages.po
1903
 
  fi
1904
 
 
1905
 
  AC_OUTPUT_COMMANDS([
 
3158
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
3159
 
 
3160
  dnl Installation directories.
 
3161
  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
 
3162
  dnl have to define it here, so that it can be used in po/Makefile.
 
3163
  test -n "$localedir" || localedir='${datadir}/locale'
 
3164
  AC_SUBST([localedir])
 
3165
 
 
3166
  dnl Support for AM_XGETTEXT_OPTION.
 
3167
  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
 
3168
  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
 
3169
 
 
3170
  AC_CONFIG_COMMANDS([po-directories], [[
1906
3171
    for ac_file in $CONFIG_FILES; do
1907
3172
      # Support "outfile[:infile[:infile...]]"
1908
3173
      case "$ac_file" in
1912
3177
      case "$ac_file" in */Makefile.in)
1913
3178
        # Adjust a relative srcdir.
1914
3179
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1915
 
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
3180
        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
1916
3181
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1917
3182
        # In autoconf-2.13 it is called $ac_given_srcdir.
1918
3183
        # In autoconf-2.50 it is called $srcdir.
1922
3187
          /*) top_srcdir="$ac_given_srcdir" ;;
1923
3188
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1924
3189
        esac
 
3190
        # Treat a directory as a PO directory if and only if it has a
 
3191
        # POTFILES.in file. This allows packages to have multiple PO
 
3192
        # directories under different names or in different locations.
1925
3193
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1926
3194
          rm -f "$ac_dir/POTFILES"
1927
3195
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1928
 
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
3196
          gt_tab=`printf '\t'`
 
3197
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1929
3198
          POMAKEFILEDEPS="POTFILES.in"
1930
3199
          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1931
3200
          # on $ac_dir but don't depend on user-specified configuration
1935
3204
            if test -n "$OBSOLETE_ALL_LINGUAS"; then
1936
3205
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1937
3206
            fi
1938
 
            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1939
 
            # Hide the ALL_LINGUAS assigment from automake.
 
3207
            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
3208
            # Hide the ALL_LINGUAS assignment from automake < 1.5.
1940
3209
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1941
3210
            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1942
3211
          else
1943
3212
            # The set of available languages was given in configure.in.
 
3213
            # Hide the ALL_LINGUAS assignment from automake < 1.5.
1944
3214
            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1945
3215
          fi
1946
3216
          # Compute POFILES
2010
3280
        fi
2011
3281
        ;;
2012
3282
      esac
2013
 
    done],
 
3283
    done]],
2014
3284
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2015
3285
    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2016
 
    # from automake.
 
3286
    # from automake < 1.5.
2017
3287
    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2018
3288
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
2019
3289
    LINGUAS="${LINGUAS-%UNSET%}"
2032
3302
changequote(,)dnl
2033
3303
  # Adjust a relative srcdir.
2034
3304
  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2035
 
  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
3305
  ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
2036
3306
  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2037
3307
  # In autoconf-2.13 it is called $ac_given_srcdir.
2038
3308
  # In autoconf-2.50 it is called $srcdir.
2060
3330
  fi
2061
3331
 
2062
3332
  # A sed script that extracts the value of VARIABLE from a Makefile.
 
3333
  tab=`printf '\t'`
2063
3334
  sed_x_variable='
2064
3335
# Test if the hold space is empty.
2065
3336
x
2067
3338
x
2068
3339
ta
2069
3340
# Yes it was empty. Look if we have the expected variable definition.
2070
 
/^[      ]*VARIABLE[     ]*=/{
 
3341
/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
2071
3342
  # Seen the first line of the variable definition.
2072
 
  s/^[   ]*VARIABLE[     ]*=//
 
3343
  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
2073
3344
  ba
2074
3345
}
2075
3346
bd
2099
3370
changequote([,])dnl
2100
3371
 
2101
3372
  # Set POTFILES to the value of the Makefile variable POTFILES.
2102
 
  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
 
3373
  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2103
3374
  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2104
3375
  # Compute POTFILES_DEPS as
2105
3376
  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2114
3385
  fi
2115
3386
  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2116
3387
    # The LINGUAS file contains the set of available languages.
2117
 
    ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
3388
    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2118
3389
    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2119
3390
  else
2120
3391
    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2121
 
    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
 
3392
    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2122
3393
    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2123
3394
  fi
2124
 
  # Hide the ALL_LINGUAS assigment from automake.
 
3395
  # Hide the ALL_LINGUAS assignment from automake < 1.5.
2125
3396
  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2126
3397
  # Compute POFILES
2127
3398
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2164
3435
    QMFILES="$QMFILES $srcdirpre$lang.qm"
2165
3436
    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2166
3437
    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2167
 
    frobbedlang=`echo $lang | sed -e 's/_/-/g'`
 
3438
    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2168
3439
    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2169
3440
  done
2170
3441
  # CATALOGS depends on both $ac_dir and the user's LINGUAS
2205
3476
      QTCATALOGS="$QTCATALOGS $lang.qm"
2206
3477
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2207
3478
      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2208
 
      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
 
3479
      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2209
3480
      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2210
3481
    done
2211
3482
  fi
2212
3483
 
2213
3484
  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
 
3485
  tab=`printf '\t'`
2214
3486
  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2215
3487
    # Add dependencies that cannot be formulated as a simple suffix rule.
2216
3488
    for lang in $ALL_LINGUAS; do
2217
3489
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2218
3490
      cat >> "$ac_file.tmp" <<EOF
2219
3491
$frobbedlang.msg: $lang.po
2220
 
        @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2221
 
        \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
3492
${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
 
3493
${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2222
3494
EOF
2223
3495
    done
2224
3496
  fi
2225
3497
  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2226
3498
    # Add dependencies that cannot be formulated as a simple suffix rule.
2227
3499
    for lang in $ALL_LINGUAS; do
2228
 
      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
 
3500
      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2229
3501
      cat >> "$ac_file.tmp" <<EOF
2230
3502
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2231
 
        @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2232
 
        \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
3503
${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
 
3504
${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2233
3505
EOF
2234
3506
    done
2235
3507
  fi
2240
3512
  fi
2241
3513
  mv "$ac_file.tmp" "$ac_file"
2242
3514
])
2243
 
# printf-posix.m4 serial 2 (gettext-0.13.1)
2244
 
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2245
 
dnl This file is free software, distributed under the terms of the GNU
2246
 
dnl General Public License.  As a special exception to the GNU General
2247
 
dnl Public License, this file may be distributed as part of a program
2248
 
dnl that contains a configuration script generated by Autoconf, under
2249
 
dnl the same distribution terms as the rest of that program.
 
3515
 
 
3516
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
 
3517
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
 
3518
[
 
3519
  XGETTEXT_EXTRA_OPTIONS=
 
3520
])
 
3521
 
 
3522
dnl Registers an option to be passed to xgettext in the po subdirectory.
 
3523
AC_DEFUN([AM_XGETTEXT_OPTION],
 
3524
[
 
3525
  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
 
3526
  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
 
3527
])
 
3528
 
 
3529
# printf-posix.m4 serial 6 (gettext-0.18.2)
 
3530
dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
 
3531
dnl This file is free software; the Free Software Foundation
 
3532
dnl gives unlimited permission to copy and/or distribute it,
 
3533
dnl with or without modifications, as long as this notice is preserved.
2250
3534
 
2251
3535
dnl From Bruno Haible.
2252
3536
dnl Test whether the printf() function supports POSIX/XSI format strings with
2258
3542
  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
2259
3543
    gt_cv_func_printf_posix,
2260
3544
    [
2261
 
      AC_TRY_RUN([
 
3545
      AC_RUN_IFELSE(
 
3546
        [AC_LANG_SOURCE([[
2262
3547
#include <stdio.h>
2263
3548
#include <string.h>
2264
3549
/* The string "%2$d %1$d", with dollar characters protected from the shell's
2269
3554
{
2270
3555
  sprintf (buf, format, 33, 55);
2271
3556
  return (strcmp (buf, "55 33") != 0);
2272
 
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
2273
 
      [
2274
 
        AC_EGREP_CPP(notposix, [
2275
 
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
 
3557
}]])],
 
3558
        [gt_cv_func_printf_posix=yes],
 
3559
        [gt_cv_func_printf_posix=no],
 
3560
        [
 
3561
          AC_EGREP_CPP([notposix], [
 
3562
#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
2276
3563
  notposix
2277
3564
#endif
2278
 
        ], gt_cv_func_printf_posix="guessing no",
2279
 
           gt_cv_func_printf_posix="guessing yes")
2280
 
      ])
 
3565
            ],
 
3566
            [gt_cv_func_printf_posix="guessing no"],
 
3567
            [gt_cv_func_printf_posix="guessing yes"])
 
3568
        ])
2281
3569
    ])
2282
3570
  case $gt_cv_func_printf_posix in
2283
3571
    *yes)
2284
 
      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
 
3572
      AC_DEFINE([HAVE_POSIX_PRINTF], [1],
2285
3573
        [Define if your printf() function supports format strings with positions.])
2286
3574
      ;;
2287
3575
  esac
2288
3576
])
2289
 
# progtest.m4 serial 3 (gettext-0.12)
2290
 
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2291
 
dnl This file is free software, distributed under the terms of the GNU
2292
 
dnl General Public License.  As a special exception to the GNU General
2293
 
dnl Public License, this file may be distributed as part of a program
2294
 
dnl that contains a configuration script generated by Autoconf, under
2295
 
dnl the same distribution terms as the rest of that program.
 
3577
 
 
3578
# progtest.m4 serial 7 (gettext-0.18.2)
 
3579
dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc.
 
3580
dnl This file is free software; the Free Software Foundation
 
3581
dnl gives unlimited permission to copy and/or distribute it,
 
3582
dnl with or without modifications, as long as this notice is preserved.
2296
3583
dnl
2297
3584
dnl This file can can be used in projects which are not available under
2298
3585
dnl the GNU General Public License or the GNU Library General Public
2306
3593
dnl Authors:
2307
3594
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2308
3595
 
 
3596
AC_PREREQ([2.50])
 
3597
 
2309
3598
# Search path for a program which passes the given test.
2310
3599
 
2311
3600
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2315
3604
# Prepare PATH_SEPARATOR.
2316
3605
# The user is always right.
2317
3606
if test "${PATH_SEPARATOR+set}" != set; then
2318
 
  echo "#! /bin/sh" >conf$$.sh
2319
 
  echo  "exit 0"   >>conf$$.sh
2320
 
  chmod +x conf$$.sh
2321
 
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2322
 
    PATH_SEPARATOR=';'
2323
 
  else
2324
 
    PATH_SEPARATOR=:
2325
 
  fi
2326
 
  rm -f conf$$.sh
 
3607
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
 
3608
  # contains only /bin. Note that ksh looks also at the FPATH variable,
 
3609
  # so we have to set that as well for the test.
 
3610
  PATH_SEPARATOR=:
 
3611
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
 
3612
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
 
3613
           || PATH_SEPARATOR=';'
 
3614
       }
2327
3615
fi
2328
3616
 
2329
3617
# Find out how to test for executable files. Don't use a zero-byte file,
2343
3631
# Extract the first word of "$2", so it can be a program name with args.
2344
3632
set dummy $2; ac_word=[$]2
2345
3633
AC_MSG_CHECKING([for $ac_word])
2346
 
AC_CACHE_VAL(ac_cv_path_$1,
 
3634
AC_CACHE_VAL([ac_cv_path_$1],
2347
3635
[case "[$]$1" in
2348
3636
  [[\\/]]* | ?:[[\\/]]*)
2349
3637
    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2355
3643
      test -z "$ac_dir" && ac_dir=.
2356
3644
      for ac_exec_ext in '' $ac_executable_extensions; do
2357
3645
        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
 
3646
          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2358
3647
          if [$3]; then
2359
3648
            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2360
3649
            break 2
2371
3660
esac])dnl
2372
3661
$1="$ac_cv_path_$1"
2373
3662
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2374
 
  AC_MSG_RESULT([$]$1)
 
3663
  AC_MSG_RESULT([$][$1])
2375
3664
else
2376
 
  AC_MSG_RESULT(no)
 
3665
  AC_MSG_RESULT([no])
2377
3666
fi
2378
 
AC_SUBST($1)dnl
2379
 
])
2380
 
# signed.m4 serial 1 (gettext-0.10.40)
2381
 
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2382
 
dnl This file is free software, distributed under the terms of the GNU
2383
 
dnl General Public License.  As a special exception to the GNU General
2384
 
dnl Public License, this file may be distributed as part of a program
2385
 
dnl that contains a configuration script generated by Autoconf, under
2386
 
dnl the same distribution terms as the rest of that program.
2387
 
 
2388
 
dnl From Bruno Haible.
2389
 
 
2390
 
AC_DEFUN([bh_C_SIGNED],
2391
 
[
2392
 
  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2393
 
   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2394
 
  if test $bh_cv_c_signed = no; then
2395
 
    AC_DEFINE(signed, ,
2396
 
              [Define to empty if the C compiler doesn't support this keyword.])
2397
 
  fi
2398
 
])
2399
 
# size_max.m4 serial 2
2400
 
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2401
 
dnl This file is free software, distributed under the terms of the GNU
2402
 
dnl General Public License.  As a special exception to the GNU General
2403
 
dnl Public License, this file may be distributed as part of a program
2404
 
dnl that contains a configuration script generated by Autoconf, under
2405
 
dnl the same distribution terms as the rest of that program.
 
3667
AC_SUBST([$1])dnl
 
3668
])
 
3669
 
 
3670
# size_max.m4 serial 10
 
3671
dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc.
 
3672
dnl This file is free software; the Free Software Foundation
 
3673
dnl gives unlimited permission to copy and/or distribute it,
 
3674
dnl with or without modifications, as long as this notice is preserved.
2406
3675
 
2407
3676
dnl From Bruno Haible.
2408
3677
 
2409
3678
AC_DEFUN([gl_SIZE_MAX],
2410
3679
[
2411
 
  AC_CHECK_HEADERS(stdint.h)
 
3680
  AC_CHECK_HEADERS([stdint.h])
2412
3681
  dnl First test whether the system already has SIZE_MAX.
2413
 
  AC_MSG_CHECKING([for SIZE_MAX])
2414
 
  result=
2415
 
  AC_EGREP_CPP([Found it], [
 
3682
  AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
 
3683
    gl_cv_size_max=
 
3684
    AC_EGREP_CPP([Found it], [
2416
3685
#include <limits.h>
2417
3686
#if HAVE_STDINT_H
2418
3687
#include <stdint.h>
2420
3689
#ifdef SIZE_MAX
2421
3690
Found it
2422
3691
#endif
2423
 
], result=yes)
2424
 
  if test -z "$result"; then
2425
 
    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2426
 
    dnl than the type 'unsigned long'.
2427
 
    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2428
 
    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2429
 
    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2430
 
      [#include <stddef.h>], result=?)
2431
 
    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2432
 
      [#include <stddef.h>], result=?)
2433
 
    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2434
 
      [#include <stddef.h>], result=?)
2435
 
    if test "$fits_in_uint" = 1; then
2436
 
      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2437
 
      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2438
 
      AC_TRY_COMPILE([#include <stddef.h>
2439
 
        extern size_t foo;
2440
 
        extern unsigned long foo;
2441
 
        ], [], fits_in_uint=0)
2442
 
    fi
2443
 
    if test -z "$result"; then
2444
 
      if test "$fits_in_uint" = 1; then
2445
 
        result="$res_hi$res_lo"U
 
3692
], [gl_cv_size_max=yes])
 
3693
    if test -z "$gl_cv_size_max"; then
 
3694
      dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
 
3695
      dnl than the type 'unsigned long'. Try hard to find a definition that can
 
3696
      dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
 
3697
      AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
 
3698
        [#include <stddef.h>
 
3699
#include <limits.h>], [size_t_bits_minus_1=])
 
3700
      AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
 
3701
        [#include <stddef.h>], [fits_in_uint=])
 
3702
      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
 
3703
        if test $fits_in_uint = 1; then
 
3704
          dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
 
3705
          dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
 
3706
          AC_COMPILE_IFELSE(
 
3707
            [AC_LANG_PROGRAM(
 
3708
               [[#include <stddef.h>
 
3709
                 extern size_t foo;
 
3710
                 extern unsigned long foo;
 
3711
               ]],
 
3712
               [[]])],
 
3713
            [fits_in_uint=0])
 
3714
        fi
 
3715
        dnl We cannot use 'expr' to simplify this expression, because 'expr'
 
3716
        dnl works only with 'long' integers in the host environment, while we
 
3717
        dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
 
3718
        if test $fits_in_uint = 1; then
 
3719
          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
 
3720
        else
 
3721
          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
 
3722
        fi
2446
3723
      else
2447
 
        result="$res_hi$res_lo"UL
 
3724
        dnl Shouldn't happen, but who knows...
 
3725
        gl_cv_size_max='((size_t)~(size_t)0)'
2448
3726
      fi
2449
 
    else
2450
 
      dnl Shouldn't happen, but who knows...
2451
 
      result='~(size_t)0'
2452
3727
    fi
2453
 
  fi
2454
 
  AC_MSG_RESULT([$result])
2455
 
  if test "$result" != yes; then
2456
 
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
 
3728
  ])
 
3729
  if test "$gl_cv_size_max" != yes; then
 
3730
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
2457
3731
      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
2458
3732
  fi
2459
 
])
2460
 
# stdint_h.m4 serial 3 (gettext-0.12)
2461
 
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2462
 
dnl This file is free software, distributed under the terms of the GNU
2463
 
dnl General Public License.  As a special exception to the GNU General
2464
 
dnl Public License, this file may be distributed as part of a program
2465
 
dnl that contains a configuration script generated by Autoconf, under
2466
 
dnl the same distribution terms as the rest of that program.
 
3733
  dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
 
3734
  dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
 
3735
  dnl #define by AC_DEFINE_UNQUOTED.
 
3736
  AH_VERBATIM([SIZE_MAX],
 
3737
[/* Define as the maximum value of type 'size_t', if the system doesn't define
 
3738
   it. */
 
3739
#ifndef SIZE_MAX
 
3740
# undef SIZE_MAX
 
3741
#endif])
 
3742
])
 
3743
 
 
3744
dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
 
3745
dnl Remove this when we can assume autoconf >= 2.61.
 
3746
m4_ifdef([AC_COMPUTE_INT], [], [
 
3747
  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
 
3748
])
 
3749
 
 
3750
# stdint_h.m4 serial 9
 
3751
dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
 
3752
dnl This file is free software; the Free Software Foundation
 
3753
dnl gives unlimited permission to copy and/or distribute it,
 
3754
dnl with or without modifications, as long as this notice is preserved.
2467
3755
 
2468
3756
dnl From Paul Eggert.
2469
3757
 
2470
3758
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2471
3759
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2472
3760
 
2473
 
AC_DEFUN([jm_AC_HEADER_STDINT_H],
 
3761
AC_DEFUN([gl_AC_HEADER_STDINT_H],
2474
3762
[
2475
 
  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2476
 
  [AC_TRY_COMPILE(
2477
 
    [#include <sys/types.h>
2478
 
#include <stdint.h>],
2479
 
    [uintmax_t i = (uintmax_t) -1;],
2480
 
    jm_ac_cv_header_stdint_h=yes,
2481
 
    jm_ac_cv_header_stdint_h=no)])
2482
 
  if test $jm_ac_cv_header_stdint_h = yes; then
2483
 
    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
 
3763
  AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
 
3764
    [AC_COMPILE_IFELSE(
 
3765
       [AC_LANG_PROGRAM(
 
3766
          [[#include <sys/types.h>
 
3767
            #include <stdint.h>]],
 
3768
          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
 
3769
       [gl_cv_header_stdint_h=yes],
 
3770
       [gl_cv_header_stdint_h=no])])
 
3771
  if test $gl_cv_header_stdint_h = yes; then
 
3772
    AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
2484
3773
      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2485
3774
       and declares uintmax_t. ])
2486
3775
  fi
2487
3776
])
2488
 
# uintmax_t.m4 serial 7 (gettext-0.12)
2489
 
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2490
 
dnl This file is free software, distributed under the terms of the GNU
2491
 
dnl General Public License.  As a special exception to the GNU General
2492
 
dnl Public License, this file may be distributed as part of a program
2493
 
dnl that contains a configuration script generated by Autoconf, under
2494
 
dnl the same distribution terms as the rest of that program.
 
3777
 
 
3778
# threadlib.m4 serial 10 (gettext-0.18.2)
 
3779
dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
 
3780
dnl This file is free software; the Free Software Foundation
 
3781
dnl gives unlimited permission to copy and/or distribute it,
 
3782
dnl with or without modifications, as long as this notice is preserved.
 
3783
 
 
3784
dnl From Bruno Haible.
 
3785
 
 
3786
dnl gl_THREADLIB
 
3787
dnl ------------
 
3788
dnl Tests for a multithreading library to be used.
 
3789
dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
 
3790
dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
 
3791
dnl default is 'no', otherwise it is system dependent. In both cases, the user
 
3792
dnl can change the choice through the options --enable-threads=choice or
 
3793
dnl --disable-threads.
 
3794
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
 
3795
dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
 
3796
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
 
3797
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
 
3798
dnl libtool).
 
3799
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
 
3800
dnl programs that really need multithread functionality. The difference
 
3801
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
 
3802
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
 
3803
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
 
3804
dnl multithread-safe programs.
 
3805
 
 
3806
AC_DEFUN([gl_THREADLIB_EARLY],
 
3807
[
 
3808
  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
 
3809
])
 
3810
 
 
3811
dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
 
3812
 
 
3813
AC_DEFUN([gl_THREADLIB_EARLY_BODY],
 
3814
[
 
3815
  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
 
3816
  dnl influences the result of the autoconf tests that test for *_unlocked
 
3817
  dnl declarations, on AIX 5 at least. Therefore it must come early.
 
3818
  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
 
3819
  AC_BEFORE([$0], [gl_ARGP])dnl
 
3820
 
 
3821
  AC_REQUIRE([AC_CANONICAL_HOST])
 
3822
  dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
 
3823
  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
 
3824
  dnl AC_GNU_SOURCE.
 
3825
  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
 
3826
    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
 
3827
    [AC_REQUIRE([AC_GNU_SOURCE])])
 
3828
  dnl Check for multithreading.
 
3829
  m4_ifdef([gl_THREADLIB_DEFAULT_NO],
 
3830
    [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
 
3831
    [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
 
3832
  AC_ARG_ENABLE([threads],
 
3833
AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
 
3834
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
 
3835
    [gl_use_threads=$enableval],
 
3836
    [if test -n "$gl_use_threads_default"; then
 
3837
       gl_use_threads="$gl_use_threads_default"
 
3838
     else
 
3839
changequote(,)dnl
 
3840
       case "$host_os" in
 
3841
         dnl Disable multithreading by default on OSF/1, because it interferes
 
3842
         dnl with fork()/exec(): When msgexec is linked with -lpthread, its
 
3843
         dnl child process gets an endless segmentation fault inside execvp().
 
3844
         dnl Disable multithreading by default on Cygwin 1.5.x, because it has
 
3845
         dnl bugs that lead to endless loops or crashes. See
 
3846
         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
 
3847
         osf*) gl_use_threads=no ;;
 
3848
         cygwin*)
 
3849
               case `uname -r` in
 
3850
                 1.[0-5].*) gl_use_threads=no ;;
 
3851
                 *)         gl_use_threads=yes ;;
 
3852
               esac
 
3853
               ;;
 
3854
         *)    gl_use_threads=yes ;;
 
3855
       esac
 
3856
changequote([,])dnl
 
3857
     fi
 
3858
    ])
 
3859
  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
 
3860
    # For using <pthread.h>:
 
3861
    case "$host_os" in
 
3862
      osf*)
 
3863
        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
 
3864
        # groks <pthread.h>. cc also understands the flag -pthread, but
 
3865
        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
 
3866
        # 2. putting a flag into CPPFLAGS that has an effect on the linker
 
3867
        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
 
3868
        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
 
3869
        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
3870
        ;;
 
3871
    esac
 
3872
    # Some systems optimize for single-threaded programs by default, and
 
3873
    # need special flags to disable these optimizations. For example, the
 
3874
    # definition of 'errno' in <errno.h>.
 
3875
    case "$host_os" in
 
3876
      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
 
3877
      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
 
3878
    esac
 
3879
  fi
 
3880
])
 
3881
 
 
3882
dnl The guts of gl_THREADLIB. Needs to be expanded only once.
 
3883
 
 
3884
AC_DEFUN([gl_THREADLIB_BODY],
 
3885
[
 
3886
  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
 
3887
  gl_threads_api=none
 
3888
  LIBTHREAD=
 
3889
  LTLIBTHREAD=
 
3890
  LIBMULTITHREAD=
 
3891
  LTLIBMULTITHREAD=
 
3892
  if test "$gl_use_threads" != no; then
 
3893
    dnl Check whether the compiler and linker support weak declarations.
 
3894
    AC_CACHE_CHECK([whether imported symbols can be declared weak],
 
3895
      [gl_cv_have_weak],
 
3896
      [gl_cv_have_weak=no
 
3897
       dnl First, test whether the compiler accepts it syntactically.
 
3898
       AC_LINK_IFELSE(
 
3899
         [AC_LANG_PROGRAM(
 
3900
            [[extern void xyzzy ();
 
3901
#pragma weak xyzzy]],
 
3902
            [[xyzzy();]])],
 
3903
         [gl_cv_have_weak=maybe])
 
3904
       if test $gl_cv_have_weak = maybe; then
 
3905
         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
 
3906
         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
 
3907
         AC_RUN_IFELSE(
 
3908
           [AC_LANG_SOURCE([[
 
3909
#include <stdio.h>
 
3910
#pragma weak fputs
 
3911
int main ()
 
3912
{
 
3913
  return (fputs == NULL);
 
3914
}]])],
 
3915
           [gl_cv_have_weak=yes],
 
3916
           [gl_cv_have_weak=no],
 
3917
           [dnl When cross-compiling, assume that only ELF platforms support
 
3918
            dnl weak symbols.
 
3919
            AC_EGREP_CPP([Extensible Linking Format],
 
3920
              [#ifdef __ELF__
 
3921
               Extensible Linking Format
 
3922
               #endif
 
3923
              ],
 
3924
              [gl_cv_have_weak="guessing yes"],
 
3925
              [gl_cv_have_weak="guessing no"])
 
3926
           ])
 
3927
       fi
 
3928
      ])
 
3929
    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
 
3930
      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
 
3931
      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
 
3932
      AC_CHECK_HEADER([pthread.h],
 
3933
        [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
 
3934
      if test "$gl_have_pthread_h" = yes; then
 
3935
        # Other possible tests:
 
3936
        #   -lpthreads (FSU threads, PCthreads)
 
3937
        #   -lgthreads
 
3938
        gl_have_pthread=
 
3939
        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
 
3940
        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
 
3941
        # the second one only in libpthread, and lock.c needs it.
 
3942
        AC_LINK_IFELSE(
 
3943
          [AC_LANG_PROGRAM(
 
3944
             [[#include <pthread.h>]],
 
3945
             [[pthread_mutex_lock((pthread_mutex_t*)0);
 
3946
               pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
 
3947
          [gl_have_pthread=yes])
 
3948
        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
 
3949
        # since it is defined as a macro on OSF/1.)
 
3950
        if test -n "$gl_have_pthread"; then
 
3951
          # The program links fine without libpthread. But it may actually
 
3952
          # need to link with libpthread in order to create multiple threads.
 
3953
          AC_CHECK_LIB([pthread], [pthread_kill],
 
3954
            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
 
3955
             # On Solaris and HP-UX, most pthread functions exist also in libc.
 
3956
             # Therefore pthread_in_use() needs to actually try to create a
 
3957
             # thread: pthread_create from libc will fail, whereas
 
3958
             # pthread_create will actually create a thread.
 
3959
             case "$host_os" in
 
3960
               solaris* | hpux*)
 
3961
                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
 
3962
                   [Define if the pthread_in_use() detection is hard.])
 
3963
             esac
 
3964
            ])
 
3965
        else
 
3966
          # Some library is needed. Try libpthread and libc_r.
 
3967
          AC_CHECK_LIB([pthread], [pthread_kill],
 
3968
            [gl_have_pthread=yes
 
3969
             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
 
3970
             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
 
3971
          if test -z "$gl_have_pthread"; then
 
3972
            # For FreeBSD 4.
 
3973
            AC_CHECK_LIB([c_r], [pthread_kill],
 
3974
              [gl_have_pthread=yes
 
3975
               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
 
3976
               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
 
3977
          fi
 
3978
        fi
 
3979
        if test -n "$gl_have_pthread"; then
 
3980
          gl_threads_api=posix
 
3981
          AC_DEFINE([USE_POSIX_THREADS], [1],
 
3982
            [Define if the POSIX multithreading library can be used.])
 
3983
          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
 
3984
            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
3985
              AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
 
3986
                [Define if references to the POSIX multithreading library should be made weak.])
 
3987
              LIBTHREAD=
 
3988
              LTLIBTHREAD=
 
3989
            fi
 
3990
          fi
 
3991
        fi
 
3992
      fi
 
3993
    fi
 
3994
    if test -z "$gl_have_pthread"; then
 
3995
      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
 
3996
        gl_have_solaristhread=
 
3997
        gl_save_LIBS="$LIBS"
 
3998
        LIBS="$LIBS -lthread"
 
3999
        AC_LINK_IFELSE(
 
4000
          [AC_LANG_PROGRAM(
 
4001
             [[
 
4002
#include <thread.h>
 
4003
#include <synch.h>
 
4004
             ]],
 
4005
             [[thr_self();]])],
 
4006
          [gl_have_solaristhread=yes])
 
4007
        LIBS="$gl_save_LIBS"
 
4008
        if test -n "$gl_have_solaristhread"; then
 
4009
          gl_threads_api=solaris
 
4010
          LIBTHREAD=-lthread
 
4011
          LTLIBTHREAD=-lthread
 
4012
          LIBMULTITHREAD="$LIBTHREAD"
 
4013
          LTLIBMULTITHREAD="$LTLIBTHREAD"
 
4014
          AC_DEFINE([USE_SOLARIS_THREADS], [1],
 
4015
            [Define if the old Solaris multithreading library can be used.])
 
4016
          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
4017
            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
 
4018
              [Define if references to the old Solaris multithreading library should be made weak.])
 
4019
            LIBTHREAD=
 
4020
            LTLIBTHREAD=
 
4021
          fi
 
4022
        fi
 
4023
      fi
 
4024
    fi
 
4025
    if test "$gl_use_threads" = pth; then
 
4026
      gl_save_CPPFLAGS="$CPPFLAGS"
 
4027
      AC_LIB_LINKFLAGS([pth])
 
4028
      gl_have_pth=
 
4029
      gl_save_LIBS="$LIBS"
 
4030
      LIBS="$LIBS $LIBPTH"
 
4031
      AC_LINK_IFELSE(
 
4032
        [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
 
4033
        [gl_have_pth=yes])
 
4034
      LIBS="$gl_save_LIBS"
 
4035
      if test -n "$gl_have_pth"; then
 
4036
        gl_threads_api=pth
 
4037
        LIBTHREAD="$LIBPTH"
 
4038
        LTLIBTHREAD="$LTLIBPTH"
 
4039
        LIBMULTITHREAD="$LIBTHREAD"
 
4040
        LTLIBMULTITHREAD="$LTLIBTHREAD"
 
4041
        AC_DEFINE([USE_PTH_THREADS], [1],
 
4042
          [Define if the GNU Pth multithreading library can be used.])
 
4043
        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
 
4044
          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
4045
            AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
 
4046
              [Define if references to the GNU Pth multithreading library should be made weak.])
 
4047
            LIBTHREAD=
 
4048
            LTLIBTHREAD=
 
4049
          fi
 
4050
        fi
 
4051
      else
 
4052
        CPPFLAGS="$gl_save_CPPFLAGS"
 
4053
      fi
 
4054
    fi
 
4055
    if test -z "$gl_have_pthread"; then
 
4056
      case "$gl_use_threads" in
 
4057
        yes | windows | win32) # The 'win32' is for backward compatibility.
 
4058
          if { case "$host_os" in
 
4059
                 mingw*) true;;
 
4060
                 *) false;;
 
4061
               esac
 
4062
             }; then
 
4063
            gl_threads_api=windows
 
4064
            AC_DEFINE([USE_WINDOWS_THREADS], [1],
 
4065
              [Define if the native Windows multithreading API can be used.])
 
4066
          fi
 
4067
          ;;
 
4068
      esac
 
4069
    fi
 
4070
  fi
 
4071
  AC_MSG_CHECKING([for multithread API to use])
 
4072
  AC_MSG_RESULT([$gl_threads_api])
 
4073
  AC_SUBST([LIBTHREAD])
 
4074
  AC_SUBST([LTLIBTHREAD])
 
4075
  AC_SUBST([LIBMULTITHREAD])
 
4076
  AC_SUBST([LTLIBMULTITHREAD])
 
4077
])
 
4078
 
 
4079
AC_DEFUN([gl_THREADLIB],
 
4080
[
 
4081
  AC_REQUIRE([gl_THREADLIB_EARLY])
 
4082
  AC_REQUIRE([gl_THREADLIB_BODY])
 
4083
])
 
4084
 
 
4085
 
 
4086
dnl gl_DISABLE_THREADS
 
4087
dnl ------------------
 
4088
dnl Sets the gl_THREADLIB default so that threads are not used by default.
 
4089
dnl The user can still override it at installation time, by using the
 
4090
dnl configure option '--enable-threads'.
 
4091
 
 
4092
AC_DEFUN([gl_DISABLE_THREADS], [
 
4093
  m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
 
4094
])
 
4095
 
 
4096
 
 
4097
dnl Survey of platforms:
 
4098
dnl
 
4099
dnl Platform           Available  Compiler    Supports   test-lock
 
4100
dnl                    flavours   option      weak       result
 
4101
dnl ---------------    ---------  ---------   --------   ---------
 
4102
dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
 
4103
dnl
 
4104
dnl GNU Hurd/glibc     posix
 
4105
dnl
 
4106
dnl FreeBSD 5.3        posix      -lc_r           Y
 
4107
dnl                    posix      -lkse ?         Y
 
4108
dnl                    posix      -lpthread ?     Y
 
4109
dnl                    posix      -lthr           Y
 
4110
dnl
 
4111
dnl FreeBSD 5.2        posix      -lc_r           Y
 
4112
dnl                    posix      -lkse           Y
 
4113
dnl                    posix      -lthr           Y
 
4114
dnl
 
4115
dnl FreeBSD 4.0,4.10   posix      -lc_r           Y      OK
 
4116
dnl
 
4117
dnl NetBSD 1.6         --
 
4118
dnl
 
4119
dnl OpenBSD 3.4        posix      -lpthread       Y      OK
 
4120
dnl
 
4121
dnl Mac OS X 10.[123]  posix      -lpthread       Y      OK
 
4122
dnl
 
4123
dnl Solaris 7,8,9      posix      -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
 
4124
dnl                    solaris    -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
 
4125
dnl
 
4126
dnl HP-UX 11           posix      -lpthread       N (cc) OK
 
4127
dnl                                               Y (gcc)
 
4128
dnl
 
4129
dnl IRIX 6.5           posix      -lpthread       Y      0.5
 
4130
dnl
 
4131
dnl AIX 4.3,5.1        posix      -lpthread       N      AIX 4: 0.5; AIX 5: OK
 
4132
dnl
 
4133
dnl OSF/1 4.0,5.1      posix      -pthread (cc)   N      OK
 
4134
dnl                               -lpthread (gcc) Y
 
4135
dnl
 
4136
dnl Cygwin             posix      -lpthread       Y      OK
 
4137
dnl
 
4138
dnl Any of the above   pth        -lpth                  0.0
 
4139
dnl
 
4140
dnl Mingw              windows                    N      OK
 
4141
dnl
 
4142
dnl BeOS 5             --
 
4143
dnl
 
4144
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
 
4145
dnl turned off:
 
4146
dnl   OK if all three tests terminate OK,
 
4147
dnl   0.5 if the first test terminates OK but the second one loops endlessly,
 
4148
dnl   0.0 if the first test already loops endlessly.
 
4149
 
 
4150
# uintmax_t.m4 serial 12
 
4151
dnl Copyright (C) 1997-2004, 2007-2013 Free Software Foundation, Inc.
 
4152
dnl This file is free software; the Free Software Foundation
 
4153
dnl gives unlimited permission to copy and/or distribute it,
 
4154
dnl with or without modifications, as long as this notice is preserved.
2495
4155
 
2496
4156
dnl From Paul Eggert.
2497
4157
 
2498
 
AC_PREREQ(2.13)
 
4158
AC_PREREQ([2.13])
2499
4159
 
2500
4160
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
2501
4161
# if it is not already defined in <stdint.h> or <inttypes.h>.
2502
4162
 
2503
 
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
 
4163
AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
2504
4164
[
2505
 
  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2506
 
  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2507
 
  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2508
 
    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2509
 
    test $ac_cv_type_unsigned_long_long = yes \
 
4165
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
4166
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
4167
  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
 
4168
    AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
 
4169
    test $ac_cv_type_unsigned_long_long_int = yes \
2510
4170
      && ac_type='unsigned long long' \
2511
4171
      || ac_type='unsigned long'
2512
 
    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
 
4172
    AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
2513
4173
      [Define to unsigned long or unsigned long long
2514
4174
       if <stdint.h> and <inttypes.h> don't define.])
2515
4175
  else
2516
 
    AC_DEFINE(HAVE_UINTMAX_T, 1,
 
4176
    AC_DEFINE([HAVE_UINTMAX_T], [1],
2517
4177
      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2518
4178
  fi
2519
4179
])
2520
 
# ulonglong.m4 serial 3
2521
 
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2522
 
dnl This file is free software, distributed under the terms of the GNU
2523
 
dnl General Public License.  As a special exception to the GNU General
2524
 
dnl Public License, this file may be distributed as part of a program
2525
 
dnl that contains a configuration script generated by Autoconf, under
2526
 
dnl the same distribution terms as the rest of that program.
2527
 
 
2528
 
dnl From Paul Eggert.
2529
 
 
2530
 
# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2531
 
 
2532
 
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
 
4180
 
 
4181
# visibility.m4 serial 5 (gettext-0.18.2)
 
4182
dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
 
4183
dnl This file is free software; the Free Software Foundation
 
4184
dnl gives unlimited permission to copy and/or distribute it,
 
4185
dnl with or without modifications, as long as this notice is preserved.
 
4186
 
 
4187
dnl From Bruno Haible.
 
4188
 
 
4189
dnl Tests whether the compiler supports the command-line option
 
4190
dnl -fvisibility=hidden and the function and variable attributes
 
4191
dnl __attribute__((__visibility__("hidden"))) and
 
4192
dnl __attribute__((__visibility__("default"))).
 
4193
dnl Does *not* test for __visibility__("protected") - which has tricky
 
4194
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
 
4195
dnl Mac OS X.
 
4196
dnl Does *not* test for __visibility__("internal") - which has processor
 
4197
dnl dependent semantics.
 
4198
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
 
4199
dnl "really only recommended for legacy code".
 
4200
dnl Set the variable CFLAG_VISIBILITY.
 
4201
dnl Defines and sets the variable HAVE_VISIBILITY.
 
4202
 
 
4203
AC_DEFUN([gl_VISIBILITY],
2533
4204
[
2534
 
  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2535
 
  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2536
 
    [unsigned long long ullmax = (unsigned long long) -1;
2537
 
     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2538
 
    ac_cv_type_unsigned_long_long=yes,
2539
 
    ac_cv_type_unsigned_long_long=no)])
2540
 
  if test $ac_cv_type_unsigned_long_long = yes; then
2541
 
    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2542
 
      [Define if you have the 'unsigned long long' type.])
 
4205
  AC_REQUIRE([AC_PROG_CC])
 
4206
  CFLAG_VISIBILITY=
 
4207
  HAVE_VISIBILITY=0
 
4208
  if test -n "$GCC"; then
 
4209
    dnl First, check whether -Werror can be added to the command line, or
 
4210
    dnl whether it leads to an error because of some other option that the
 
4211
    dnl user has put into $CC $CFLAGS $CPPFLAGS.
 
4212
    AC_MSG_CHECKING([whether the -Werror option is usable])
 
4213
    AC_CACHE_VAL([gl_cv_cc_vis_werror], [
 
4214
      gl_save_CFLAGS="$CFLAGS"
 
4215
      CFLAGS="$CFLAGS -Werror"
 
4216
      AC_COMPILE_IFELSE(
 
4217
        [AC_LANG_PROGRAM([[]], [[]])],
 
4218
        [gl_cv_cc_vis_werror=yes],
 
4219
        [gl_cv_cc_vis_werror=no])
 
4220
      CFLAGS="$gl_save_CFLAGS"])
 
4221
    AC_MSG_RESULT([$gl_cv_cc_vis_werror])
 
4222
    dnl Now check whether visibility declarations are supported.
 
4223
    AC_MSG_CHECKING([for simple visibility declarations])
 
4224
    AC_CACHE_VAL([gl_cv_cc_visibility], [
 
4225
      gl_save_CFLAGS="$CFLAGS"
 
4226
      CFLAGS="$CFLAGS -fvisibility=hidden"
 
4227
      dnl We use the option -Werror and a function dummyfunc, because on some
 
4228
      dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
 
4229
      dnl "visibility attribute not supported in this configuration; ignored"
 
4230
      dnl at the first function definition in every compilation unit, and we
 
4231
      dnl don't want to use the option in this case.
 
4232
      if test $gl_cv_cc_vis_werror = yes; then
 
4233
        CFLAGS="$CFLAGS -Werror"
 
4234
      fi
 
4235
      AC_COMPILE_IFELSE(
 
4236
        [AC_LANG_PROGRAM(
 
4237
           [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
 
4238
             extern __attribute__((__visibility__("default"))) int exportedvar;
 
4239
             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
 
4240
             extern __attribute__((__visibility__("default"))) int exportedfunc (void);
 
4241
             void dummyfunc (void) {}
 
4242
           ]],
 
4243
           [[]])],
 
4244
        [gl_cv_cc_visibility=yes],
 
4245
        [gl_cv_cc_visibility=no])
 
4246
      CFLAGS="$gl_save_CFLAGS"])
 
4247
    AC_MSG_RESULT([$gl_cv_cc_visibility])
 
4248
    if test $gl_cv_cc_visibility = yes; then
 
4249
      CFLAG_VISIBILITY="-fvisibility=hidden"
 
4250
      HAVE_VISIBILITY=1
 
4251
    fi
2543
4252
  fi
 
4253
  AC_SUBST([CFLAG_VISIBILITY])
 
4254
  AC_SUBST([HAVE_VISIBILITY])
 
4255
  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
 
4256
    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
2544
4257
])
2545
 
# wchar_t.m4 serial 1 (gettext-0.12)
2546
 
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2547
 
dnl This file is free software, distributed under the terms of the GNU
2548
 
dnl General Public License.  As a special exception to the GNU General
2549
 
dnl Public License, this file may be distributed as part of a program
2550
 
dnl that contains a configuration script generated by Autoconf, under
2551
 
dnl the same distribution terms as the rest of that program.
 
4258
 
 
4259
# wchar_t.m4 serial 4 (gettext-0.18.2)
 
4260
dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
 
4261
dnl This file is free software; the Free Software Foundation
 
4262
dnl gives unlimited permission to copy and/or distribute it,
 
4263
dnl with or without modifications, as long as this notice is preserved.
2552
4264
 
2553
4265
dnl From Bruno Haible.
2554
4266
dnl Test whether <stddef.h> has the 'wchar_t' type.
2556
4268
 
2557
4269
AC_DEFUN([gt_TYPE_WCHAR_T],
2558
4270
[
2559
 
  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2560
 
    [AC_TRY_COMPILE([#include <stddef.h>
2561
 
       wchar_t foo = (wchar_t)'\0';], ,
2562
 
       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
 
4271
  AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
 
4272
    [AC_COMPILE_IFELSE(
 
4273
       [AC_LANG_PROGRAM(
 
4274
          [[#include <stddef.h>
 
4275
            wchar_t foo = (wchar_t)'\0';]],
 
4276
          [[]])],
 
4277
       [gt_cv_c_wchar_t=yes],
 
4278
       [gt_cv_c_wchar_t=no])])
2563
4279
  if test $gt_cv_c_wchar_t = yes; then
2564
 
    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
 
4280
    AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
2565
4281
  fi
2566
4282
])
2567
 
# wint_t.m4 serial 1 (gettext-0.12)
2568
 
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2569
 
dnl This file is free software, distributed under the terms of the GNU
2570
 
dnl General Public License.  As a special exception to the GNU General
2571
 
dnl Public License, this file may be distributed as part of a program
2572
 
dnl that contains a configuration script generated by Autoconf, under
2573
 
dnl the same distribution terms as the rest of that program.
 
4283
 
 
4284
# wint_t.m4 serial 5 (gettext-0.18.2)
 
4285
dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
 
4286
dnl This file is free software; the Free Software Foundation
 
4287
dnl gives unlimited permission to copy and/or distribute it,
 
4288
dnl with or without modifications, as long as this notice is preserved.
2574
4289
 
2575
4290
dnl From Bruno Haible.
2576
4291
dnl Test whether <wchar.h> has the 'wint_t' type.
2578
4293
 
2579
4294
AC_DEFUN([gt_TYPE_WINT_T],
2580
4295
[
2581
 
  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2582
 
    [AC_TRY_COMPILE([#include <wchar.h>
2583
 
       wint_t foo = (wchar_t)'\0';], ,
2584
 
       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
 
4296
  AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
 
4297
    [AC_COMPILE_IFELSE(
 
4298
       [AC_LANG_PROGRAM(
 
4299
          [[
 
4300
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
 
4301
   <wchar.h>.
 
4302
   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
 
4303
   before <wchar.h>.  */
 
4304
#include <stddef.h>
 
4305
#include <stdio.h>
 
4306
#include <time.h>
 
4307
#include <wchar.h>
 
4308
            wint_t foo = (wchar_t)'\0';]],
 
4309
          [[]])],
 
4310
       [gt_cv_c_wint_t=yes],
 
4311
       [gt_cv_c_wint_t=no])])
2585
4312
  if test $gt_cv_c_wint_t = yes; then
2586
 
    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
 
4313
    AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
2587
4314
  fi
2588
4315
])
2589
 
# xsize.m4 serial 2
2590
 
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2591
 
dnl This file is free software, distributed under the terms of the GNU
2592
 
dnl General Public License.  As a special exception to the GNU General
2593
 
dnl Public License, this file may be distributed as part of a program
2594
 
dnl that contains a configuration script generated by Autoconf, under
2595
 
dnl the same distribution terms as the rest of that program.
 
4316
 
 
4317
# xsize.m4 serial 5
 
4318
dnl Copyright (C) 2003-2004, 2008-2013 Free Software Foundation, Inc.
 
4319
dnl This file is free software; the Free Software Foundation
 
4320
dnl gives unlimited permission to copy and/or distribute it,
 
4321
dnl with or without modifications, as long as this notice is preserved.
2596
4322
 
2597
4323
AC_DEFUN([gl_XSIZE],
2598
4324
[
2599
4325
  dnl Prerequisites of lib/xsize.h.
2600
4326
  AC_REQUIRE([gl_SIZE_MAX])
2601
 
  AC_CHECK_HEADERS(stdint.h)
2602
 
])
2603
 
 
2604
 
# from http://autoconf-archive.cryp.to/ax_tls.html
2605
 
#
2606
 
# This was licensed under the GPL with the following exception:
2607
 
#
2608
 
# As a special exception, the respective Autoconf Macro's copyright
2609
 
# owner gives unlimited permission to copy, distribute and modify the
2610
 
# configure scripts that are the output of Autoconf when processing
2611
 
# the Macro. You need not follow the terms of the GNU General Public
2612
 
# License when using or distributing such scripts, even though
2613
 
# portions of the text of the Macro appear in them. The GNU General
2614
 
# Public License (GPL) does govern all other use of the material that
2615
 
# constitutes the Autoconf Macro.
2616
 
#
2617
 
# This special exception to the GPL applies to versions of the
2618
 
# Autoconf Macro released by the Autoconf Macro Archive. When you make
2619
 
# and distribute a modified version of the Autoconf Macro, you may
2620
 
# extend this special exception to the GPL to apply to your modified
2621
 
# version as well.
2622
 
#
2623
 
AC_DEFUN([AX_TLS], [
2624
 
  AC_MSG_CHECKING(for thread local storage (TLS) class)
2625
 
  AC_CACHE_VAL(ac_cv_tls, [
2626
 
    ax_tls_keywords="__thread __declspec(thread) none"
2627
 
    for ax_tls_keyword in $ax_tls_keywords; do
2628
 
       case $ax_tls_keyword in
2629
 
          none) ac_cv_tls=none ; break ;;
2630
 
          *)
2631
 
             AC_TRY_COMPILE(
2632
 
                [#include <stdlib.h>
2633
 
                 static void
2634
 
                 foo(void) {
2635
 
                 static ] $ax_tls_keyword [ int bar;
2636
 
                 exit(1);
2637
 
                 }],
2638
 
                 [],
2639
 
                 [ac_cv_tls=$ax_tls_keyword ; break],
2640
 
                 ac_cv_tls=none
2641
 
             )
2642
 
          esac
2643
 
    done
2644
 
])
2645
 
 
2646
 
  if test "$ac_cv_tls" != "none"; then
2647
 
    dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
2648
 
    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
2649
 
  fi
2650
 
  AC_MSG_RESULT($ac_cv_tls)
2651
 
])
2652
 
 
2653
 
# Excerpted from pkg.m4 - Macros to locate and utilise pkg-config
2654
 
#
2655
 
# Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
2656
 
#
2657
 
# This program is free software; you can redistribute it and/or modify
2658
 
# it under the terms of the GNU General Public License as published by
2659
 
# the Free Software Foundation; either version 2 of the License, or
2660
 
# (at your option) any later version.
2661
 
#
2662
 
# This program is distributed in the hope that it will be useful, but
2663
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
2664
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2665
 
# General Public License for more details.
2666
 
#
2667
 
# You should have received a copy of the GNU General Public License
2668
 
# along with this program; if not, write to the Free Software
2669
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2670
 
#
2671
 
# As a special exception to the GNU General Public License, if you
2672
 
# distribute this file as part of a program that contains a
2673
 
# configuration script generated by Autoconf, you may include it under
2674
 
# the same distribution terms that you use for the rest of that program.
2675
 
 
2676
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2677
 
# ----------------------------------
2678
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
2679
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2680
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2681
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2682
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2683
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2684
 
fi
2685
 
if test -n "$PKG_CONFIG"; then
2686
 
        _pkg_min_version=m4_default([$1], [0.9.0])
2687
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2688
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2689
 
                AC_MSG_RESULT([yes])
2690
 
        else
2691
 
                AC_MSG_RESULT([no])
2692
 
                PKG_CONFIG=""
2693
 
        fi
2694
 
               
2695
 
fi[]dnl
2696
 
])# PKG_PROG_PKG_CONFIG
2697
 
# ===========================================================================
2698
 
#         http://www.nongnu.org/autoconf-archive/check_gnu_make.html
2699
 
# ===========================================================================
2700
 
#
2701
 
# SYNOPSIS
2702
 
#
2703
 
#   CHECK_GNU_MAKE()
2704
 
#
2705
 
# DESCRIPTION
2706
 
#
2707
 
#   This macro searches for a GNU version of make. If a match is found, the
2708
 
#   makefile variable `ifGNUmake' is set to the empty string, otherwise it
2709
 
#   is set to "#". This is useful for including a special features in a
2710
 
#   Makefile, which cannot be handled by other versions of make. The
2711
 
#   variable _cv_gnu_make_command is set to the command to invoke GNU make
2712
 
#   if it exists, the empty string otherwise.
2713
 
#
2714
 
#   Here is an example of its use:
2715
 
#
2716
 
#   Makefile.in might contain:
2717
 
#
2718
 
#       # A failsafe way of putting a dependency rule into a makefile
2719
 
#       $(DEPEND):
2720
 
#               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
2721
 
#
2722
 
#       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
2723
 
#       @ifGNUmake@ include $(DEPEND)
2724
 
#       @ifGNUmake@ endif
2725
 
#
2726
 
#   Then configure.in would normally contain:
2727
 
#
2728
 
#       CHECK_GNU_MAKE()
2729
 
#       AC_OUTPUT(Makefile)
2730
 
#
2731
 
#   Then perhaps to cause gnu make to override any other make, we could do
2732
 
#   something like this (note that GNU make always looks for GNUmakefile
2733
 
#   first):
2734
 
#
2735
 
#       if  ! test x$_cv_gnu_make_command = x ; then
2736
 
#               mv Makefile GNUmakefile
2737
 
#               echo .DEFAULT: > Makefile ;
2738
 
#               echo \  $_cv_gnu_make_command \$@ >> Makefile;
2739
 
#       fi
2740
 
#
2741
 
#   Then, if any (well almost any) other make is called, and GNU make also
2742
 
#   exists, then the other make wraps the GNU make.
2743
 
#
2744
 
# LICENSE
2745
 
#
2746
 
#   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
2747
 
#
2748
 
#   Copying and distribution of this file, with or without modification, are
2749
 
#   permitted in any medium without royalty provided the copyright notice
2750
 
#   and this notice are preserved.
2751
 
#
2752
 
# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
2753
 
 
2754
 
AC_DEFUN(
2755
 
        [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
2756
 
                _cv_gnu_make_command='' ;
2757
 
dnl Search all the common names for GNU make
2758
 
                for a in "$MAKE" make gmake gnumake ; do
2759
 
                        if test -z "$a" ; then continue ; fi ;
2760
 
                        if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
2761
 
                                _cv_gnu_make_command=$a ;
2762
 
                                break;
2763
 
                        fi
2764
 
                done ;
2765
 
        ) ;
2766
 
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
2767
 
        if test  "x$_cv_gnu_make_command" != "x"  ; then
2768
 
                ifGNUmake='' ;
2769
 
                ifNotGNUmake='#' ;
2770
 
        else
2771
 
                ifGNUmake='#' ;
2772
 
                ifNotGNUmake='' ;
2773
 
                AC_MSG_RESULT("Not found");
2774
 
        fi
2775
 
        AC_SUBST(ifGNUmake)
2776
 
        AC_SUBST(ifNotGNUmake)
2777
 
] )
 
4327
  AC_CHECK_HEADERS([stdint.h])
 
4328
])
 
4329
 
 
4330
m4_include([acinclude.m4])