~ubuntu-branches/ubuntu/natty/smc/natty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Muammar El Khatib
  • Date: 2008-10-20 00:31:35 UTC
  • mfrom: (1.1.4 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081020003135-5ac8cpecomfohvv5
Tags: 1.6-1
* New upstream release. (Closes:#479415)
* Bumped standards version to 3.8.0.
* debian/control: dpatch build dependency has been removed temporarily.
* debian/control: smc-data does not depend on smc anymore. This change will
  avoid a circular dependency. (Closes: #478712)
* smc does not segfault. (Closes: #500039, #491590) 
* Icon is not missed in Gnome Menu. Thanks to Saïvann for providing a 
  solution. (Closes: #491885)
* debian/control: smc-data's and smc-music's descriptions have been improved.
  (Closes: #493630)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
1
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
2
2
 
3
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005  Free Software Foundation, Inc.
 
4
# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5
5
# This file is free software; the Free Software Foundation
6
6
# gives unlimited permission to copy and/or distribute it,
7
7
# with or without modifications, as long as this notice is preserved.
11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
13
13
 
 
14
m4_ifndef([AC_AUTOCONF_VERSION],
 
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 
16
m4_if(AC_AUTOCONF_VERSION, [2.63],,
 
17
[m4_warning([this file was generated for autoconf 2.63.
 
18
You have another version of autoconf.  It may work, but is not guaranteed to.
 
19
If you have problems, you may need to regenerate the build system entirely.
 
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
21
 
 
22
# gettext.m4 serial 60 (gettext-0.17)
 
23
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
 
24
dnl This file is free software; the Free Software Foundation
 
25
dnl gives unlimited permission to copy and/or distribute it,
 
26
dnl with or without modifications, as long as this notice is preserved.
 
27
dnl
 
28
dnl This file can can be used in projects which are not available under
 
29
dnl the GNU General Public License or the GNU Library General Public
 
30
dnl License but which still want to provide support for the GNU gettext
 
31
dnl functionality.
 
32
dnl Please note that the actual code of the GNU gettext library is covered
 
33
dnl by the GNU Library General Public License, and the rest of the GNU
 
34
dnl gettext package package is covered by the GNU General Public License.
 
35
dnl They are *not* in the public domain.
 
36
 
 
37
dnl Authors:
 
38
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
39
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
 
40
 
 
41
dnl Macro to add for using GNU gettext.
 
42
 
 
43
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
 
44
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
 
45
dnl    default (if it is not specified or empty) is 'no-libtool'.
 
46
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
 
47
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
 
48
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 
49
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 
50
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
 
51
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
 
52
dnl    $(top_builddir)/intl/libintl.a will be created.
 
53
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 
54
dnl    implementations (in libc or libintl) without the ngettext() function
 
55
dnl    will be ignored.  If NEEDSYMBOL is specified and is
 
56
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 
57
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 
58
dnl INTLDIR is used to find the intl libraries.  If empty,
 
59
dnl    the value `$(top_builddir)/intl/' is used.
 
60
dnl
 
61
dnl The result of the configuration is one of three cases:
 
62
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
 
63
dnl    and used.
 
64
dnl    Catalog format: GNU --> install in $(datadir)
 
65
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
66
dnl 2) GNU gettext has been found in the system's C library.
 
67
dnl    Catalog format: GNU --> install in $(datadir)
 
68
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
69
dnl 3) No internationalization, always use English msgid.
 
70
dnl    Catalog format: none
 
71
dnl    Catalog extension: none
 
72
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
 
73
dnl The use of .gmo is historical (it was needed to avoid overwriting the
 
74
dnl GNU format catalogs when building on a platform with an X/Open gettext),
 
75
dnl but we keep it in order not to force irrelevant filename changes on the
 
76
dnl maintainers.
 
77
dnl
 
78
AC_DEFUN([AM_GNU_GETTEXT],
 
79
[
 
80
  dnl Argument checking.
 
81
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
 
82
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 
83
])])])])])
 
84
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
 
85
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 
86
])])])])
 
87
  define([gt_included_intl],
 
88
    ifelse([$1], [external],
 
89
      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
 
90
      [yes]))
 
91
  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
92
  gt_NEEDS_INIT
 
93
  AM_GNU_GETTEXT_NEED([$2])
 
94
 
 
95
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
 
96
  ifelse(gt_included_intl, yes, [
 
97
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
 
98
  ])
 
99
 
 
100
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
101
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
102
  AC_REQUIRE([AC_LIB_RPATH])
 
103
 
 
104
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
105
  dnl Ideally we would do this search only after the
 
106
  dnl      if test "$USE_NLS" = "yes"; then
 
107
  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
 
108
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
 
109
  dnl the configure script would need to contain the same shell code
 
110
  dnl again, outside any 'if'. There are two solutions:
 
111
  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
 
112
  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
 
113
  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
 
114
  dnl documented, we avoid it.
 
115
  ifelse(gt_included_intl, yes, , [
 
116
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
117
  ])
 
118
 
 
119
  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
 
120
  gt_INTL_MACOSX
 
121
 
 
122
  dnl Set USE_NLS.
 
123
  AC_REQUIRE([AM_NLS])
 
124
 
 
125
  ifelse(gt_included_intl, yes, [
 
126
    BUILD_INCLUDED_LIBINTL=no
 
127
    USE_INCLUDED_LIBINTL=no
 
128
  ])
 
129
  LIBINTL=
 
130
  LTLIBINTL=
 
131
  POSUB=
 
132
 
 
133
  dnl Add a version number to the cache macros.
 
134
  case " $gt_needs " in
 
135
    *" need-formatstring-macros "*) gt_api_version=3 ;;
 
136
    *" need-ngettext "*) gt_api_version=2 ;;
 
137
    *) gt_api_version=1 ;;
 
138
  esac
 
139
  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
 
140
  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
 
141
 
 
142
  dnl If we use NLS figure out what method
 
143
  if test "$USE_NLS" = "yes"; then
 
144
    gt_use_preinstalled_gnugettext=no
 
145
    ifelse(gt_included_intl, yes, [
 
146
      AC_MSG_CHECKING([whether included gettext is requested])
 
147
      AC_ARG_WITH(included-gettext,
 
148
        [  --with-included-gettext use the GNU gettext library included here],
 
149
        nls_cv_force_use_gnu_gettext=$withval,
 
150
        nls_cv_force_use_gnu_gettext=no)
 
151
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
152
 
 
153
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 
154
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
155
    ])
 
156
        dnl User does not insist on using GNU NLS library.  Figure out what
 
157
        dnl to use.  If GNU gettext is available we use this.  Else we have
 
158
        dnl to fall back to GNU NLS library.
 
159
 
 
160
        if test $gt_api_version -ge 3; then
 
161
          gt_revision_test_code='
 
162
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
163
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
164
#endif
 
165
changequote(,)dnl
 
166
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
167
changequote([,])dnl
 
168
'
 
169
        else
 
170
          gt_revision_test_code=
 
171
        fi
 
172
        if test $gt_api_version -ge 2; then
 
173
          gt_expression_test_code=' + * ngettext ("", "", 0)'
 
174
        else
 
175
          gt_expression_test_code=
 
176
        fi
 
177
 
 
178
        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
 
179
         [AC_TRY_LINK([#include <libintl.h>
 
180
$gt_revision_test_code
 
181
extern int _nl_msg_cat_cntr;
 
182
extern int *_nl_domain_bindings;],
 
183
            [bindtextdomain ("", "");
 
184
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
 
185
            [eval "$gt_func_gnugettext_libc=yes"],
 
186
            [eval "$gt_func_gnugettext_libc=no"])])
 
187
 
 
188
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
 
189
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
190
          ifelse(gt_included_intl, yes, , [
 
191
            AM_ICONV_LINK
 
192
          ])
 
193
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
 
194
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
 
195
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
 
196
          dnl even if libiconv doesn't exist.
 
197
          AC_LIB_LINKFLAGS_BODY([intl])
 
198
          AC_CACHE_CHECK([for GNU gettext in libintl],
 
199
            [$gt_func_gnugettext_libintl],
 
200
           [gt_save_CPPFLAGS="$CPPFLAGS"
 
201
            CPPFLAGS="$CPPFLAGS $INCINTL"
 
202
            gt_save_LIBS="$LIBS"
 
203
            LIBS="$LIBS $LIBINTL"
 
204
            dnl Now see whether libintl exists and does not depend on libiconv.
 
205
            AC_TRY_LINK([#include <libintl.h>
 
206
$gt_revision_test_code
 
207
extern int _nl_msg_cat_cntr;
 
208
extern
 
209
#ifdef __cplusplus
 
210
"C"
 
211
#endif
 
212
const char *_nl_expand_alias (const char *);],
 
213
              [bindtextdomain ("", "");
 
214
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
215
              [eval "$gt_func_gnugettext_libintl=yes"],
 
216
              [eval "$gt_func_gnugettext_libintl=no"])
 
217
            dnl Now see whether libintl exists and depends on libiconv.
 
218
            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
 
219
              LIBS="$LIBS $LIBICONV"
 
220
              AC_TRY_LINK([#include <libintl.h>
 
221
$gt_revision_test_code
 
222
extern int _nl_msg_cat_cntr;
 
223
extern
 
224
#ifdef __cplusplus
 
225
"C"
 
226
#endif
 
227
const char *_nl_expand_alias (const char *);],
 
228
                [bindtextdomain ("", "");
 
229
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
230
               [LIBINTL="$LIBINTL $LIBICONV"
 
231
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
 
232
                eval "$gt_func_gnugettext_libintl=yes"
 
233
               ])
 
234
            fi
 
235
            CPPFLAGS="$gt_save_CPPFLAGS"
 
236
            LIBS="$gt_save_LIBS"])
 
237
        fi
 
238
 
 
239
        dnl If an already present or preinstalled GNU gettext() is found,
 
240
        dnl use it.  But if this macro is used in GNU gettext, and GNU
 
241
        dnl gettext is already preinstalled in libintl, we update this
 
242
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
 
243
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
 
244
           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
 
245
                && test "$PACKAGE" != gettext-runtime \
 
246
                && test "$PACKAGE" != gettext-tools; }; then
 
247
          gt_use_preinstalled_gnugettext=yes
 
248
        else
 
249
          dnl Reset the values set by searching for libintl.
 
250
          LIBINTL=
 
251
          LTLIBINTL=
 
252
          INCINTL=
 
253
        fi
 
254
 
 
255
    ifelse(gt_included_intl, yes, [
 
256
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
 
257
          dnl GNU gettext is not found in the C library.
 
258
          dnl Fall back on included GNU gettext library.
 
259
          nls_cv_use_gnu_gettext=yes
 
260
        fi
 
261
      fi
 
262
 
 
263
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 
264
        dnl Mark actions used to generate GNU NLS library.
 
265
        BUILD_INCLUDED_LIBINTL=yes
 
266
        USE_INCLUDED_LIBINTL=yes
 
267
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
 
268
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
 
269
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
 
270
      fi
 
271
 
 
272
      CATOBJEXT=
 
273
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
274
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
275
        dnl Mark actions to use GNU gettext tools.
 
276
        CATOBJEXT=.gmo
 
277
      fi
 
278
    ])
 
279
 
 
280
    if test -n "$INTL_MACOSX_LIBS"; then
 
281
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
282
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
283
        dnl Some extra flags are needed during linking.
 
284
        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
 
285
        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
 
286
      fi
 
287
    fi
 
288
 
 
289
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
290
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
291
      AC_DEFINE(ENABLE_NLS, 1,
 
292
        [Define to 1 if translation of program messages to the user's native language
 
293
   is requested.])
 
294
    else
 
295
      USE_NLS=no
 
296
    fi
 
297
  fi
 
298
 
 
299
  AC_MSG_CHECKING([whether to use NLS])
 
300
  AC_MSG_RESULT([$USE_NLS])
 
301
  if test "$USE_NLS" = "yes"; then
 
302
    AC_MSG_CHECKING([where the gettext function comes from])
 
303
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
304
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
 
305
        gt_source="external libintl"
 
306
      else
 
307
        gt_source="libc"
 
308
      fi
 
309
    else
 
310
      gt_source="included intl directory"
 
311
    fi
 
312
    AC_MSG_RESULT([$gt_source])
 
313
  fi
 
314
 
 
315
  if test "$USE_NLS" = "yes"; then
 
316
 
 
317
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
318
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
 
319
        AC_MSG_CHECKING([how to link with libintl])
 
320
        AC_MSG_RESULT([$LIBINTL])
 
321
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
 
322
      fi
 
323
 
 
324
      dnl For backward compatibility. Some packages may be using this.
 
325
      AC_DEFINE(HAVE_GETTEXT, 1,
 
326
       [Define if the GNU gettext() function is already present or preinstalled.])
 
327
      AC_DEFINE(HAVE_DCGETTEXT, 1,
 
328
       [Define if the GNU dcgettext() function is already present or preinstalled.])
 
329
    fi
 
330
 
 
331
    dnl We need to process the po/ directory.
 
332
    POSUB=po
 
333
  fi
 
334
 
 
335
  ifelse(gt_included_intl, yes, [
 
336
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
 
337
    dnl to 'yes' because some of the testsuite requires it.
 
338
    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
 
339
      BUILD_INCLUDED_LIBINTL=yes
 
340
    fi
 
341
 
 
342
    dnl Make all variables we use known to autoconf.
 
343
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
344
    AC_SUBST(USE_INCLUDED_LIBINTL)
 
345
    AC_SUBST(CATOBJEXT)
 
346
 
 
347
    dnl For backward compatibility. Some configure.ins may be using this.
 
348
    nls_cv_header_intl=
 
349
    nls_cv_header_libgt=
 
350
 
 
351
    dnl For backward compatibility. Some Makefiles may be using this.
 
352
    DATADIRNAME=share
 
353
    AC_SUBST(DATADIRNAME)
 
354
 
 
355
    dnl For backward compatibility. Some Makefiles may be using this.
 
356
    INSTOBJEXT=.mo
 
357
    AC_SUBST(INSTOBJEXT)
 
358
 
 
359
    dnl For backward compatibility. Some Makefiles may be using this.
 
360
    GENCAT=gencat
 
361
    AC_SUBST(GENCAT)
 
362
 
 
363
    dnl For backward compatibility. Some Makefiles may be using this.
 
364
    INTLOBJS=
 
365
    if test "$USE_INCLUDED_LIBINTL" = yes; then
 
366
      INTLOBJS="\$(GETTOBJS)"
 
367
    fi
 
368
    AC_SUBST(INTLOBJS)
 
369
 
 
370
    dnl Enable libtool support if the surrounding package wishes it.
 
371
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
 
372
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
 
373
  ])
 
374
 
 
375
  dnl For backward compatibility. Some Makefiles may be using this.
 
376
  INTLLIBS="$LIBINTL"
 
377
  AC_SUBST(INTLLIBS)
 
378
 
 
379
  dnl Make all documented variables known to autoconf.
 
380
  AC_SUBST(LIBINTL)
 
381
  AC_SUBST(LTLIBINTL)
 
382
  AC_SUBST(POSUB)
 
383
])
 
384
 
 
385
 
 
386
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
 
387
m4_define([gt_NEEDS_INIT],
 
388
[
 
389
  m4_divert_text([DEFAULTS], [gt_needs=])
 
390
  m4_define([gt_NEEDS_INIT], [])
 
391
])
 
392
 
 
393
 
 
394
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
 
395
AC_DEFUN([AM_GNU_GETTEXT_NEED],
 
396
[
 
397
  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
 
398
])
 
399
 
 
400
 
 
401
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 
402
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
 
403
 
 
404
# iconv.m4 serial AM6 (gettext-0.17)
 
405
dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
 
406
dnl This file is free software; the Free Software Foundation
 
407
dnl gives unlimited permission to copy and/or distribute it,
 
408
dnl with or without modifications, as long as this notice is preserved.
 
409
 
 
410
dnl From Bruno Haible.
 
411
 
 
412
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 
413
[
 
414
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
415
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
416
  AC_REQUIRE([AC_LIB_RPATH])
 
417
 
 
418
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
419
  dnl accordingly.
 
420
  AC_LIB_LINKFLAGS_BODY([iconv])
 
421
])
 
422
 
 
423
AC_DEFUN([AM_ICONV_LINK],
 
424
[
 
425
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
426
  dnl those with the standalone portable GNU libiconv installed).
 
427
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
428
 
 
429
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
430
  dnl accordingly.
 
431
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
432
 
 
433
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
434
  dnl because if the user has installed libiconv and not disabled its use
 
435
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
436
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
437
  am_save_CPPFLAGS="$CPPFLAGS"
 
438
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
439
 
 
440
  AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
 
441
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
442
    am_cv_lib_iconv=no
 
443
    AC_TRY_LINK([#include <stdlib.h>
 
444
#include <iconv.h>],
 
445
      [iconv_t cd = iconv_open("","");
 
446
       iconv(cd,NULL,NULL,NULL,NULL);
 
447
       iconv_close(cd);],
 
448
      am_cv_func_iconv=yes)
 
449
    if test "$am_cv_func_iconv" != yes; then
 
450
      am_save_LIBS="$LIBS"
 
451
      LIBS="$LIBS $LIBICONV"
 
452
      AC_TRY_LINK([#include <stdlib.h>
 
453
#include <iconv.h>],
 
454
        [iconv_t cd = iconv_open("","");
 
455
         iconv(cd,NULL,NULL,NULL,NULL);
 
456
         iconv_close(cd);],
 
457
        am_cv_lib_iconv=yes
 
458
        am_cv_func_iconv=yes)
 
459
      LIBS="$am_save_LIBS"
 
460
    fi
 
461
  ])
 
462
  if test "$am_cv_func_iconv" = yes; then
 
463
    AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
 
464
      dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
 
465
      am_save_LIBS="$LIBS"
 
466
      if test $am_cv_lib_iconv = yes; then
 
467
        LIBS="$LIBS $LIBICONV"
 
468
      fi
 
469
      AC_TRY_RUN([
 
470
#include <iconv.h>
 
471
#include <string.h>
 
472
int main ()
 
473
{
 
474
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
 
475
     returns.  */
 
476
  {
 
477
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
 
478
    if (cd_utf8_to_88591 != (iconv_t)(-1))
 
479
      {
 
480
        static const char input[] = "\342\202\254"; /* EURO SIGN */
 
481
        char buf[10];
 
482
        const char *inptr = input;
 
483
        size_t inbytesleft = strlen (input);
 
484
        char *outptr = buf;
 
485
        size_t outbytesleft = sizeof (buf);
 
486
        size_t res = iconv (cd_utf8_to_88591,
 
487
                            (char **) &inptr, &inbytesleft,
 
488
                            &outptr, &outbytesleft);
 
489
        if (res == 0)
 
490
          return 1;
 
491
      }
 
492
  }
 
493
#if 0 /* This bug could be worked around by the caller.  */
 
494
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
 
495
  {
 
496
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
 
497
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
498
      {
 
499
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
 
500
        char buf[50];
 
501
        const char *inptr = input;
 
502
        size_t inbytesleft = strlen (input);
 
503
        char *outptr = buf;
 
504
        size_t outbytesleft = sizeof (buf);
 
505
        size_t res = iconv (cd_88591_to_utf8,
 
506
                            (char **) &inptr, &inbytesleft,
 
507
                            &outptr, &outbytesleft);
 
508
        if ((int)res > 0)
 
509
          return 1;
 
510
      }
 
511
  }
 
512
#endif
 
513
  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
 
514
     provided.  */
 
515
  if (/* Try standardized names.  */
 
516
      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
 
517
      /* Try IRIX, OSF/1 names.  */
 
518
      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
 
519
      /* Try AIX names.  */
 
520
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
 
521
      /* Try HP-UX names.  */
 
522
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
 
523
    return 1;
 
524
  return 0;
 
525
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
 
526
        [case "$host_os" in
 
527
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
 
528
           *)            am_cv_func_iconv_works="guessing yes" ;;
 
529
         esac])
 
530
      LIBS="$am_save_LIBS"
 
531
    ])
 
532
    case "$am_cv_func_iconv_works" in
 
533
      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
 
534
      *)   am_func_iconv=yes ;;
 
535
    esac
 
536
  else
 
537
    am_func_iconv=no am_cv_lib_iconv=no
 
538
  fi
 
539
  if test "$am_func_iconv" = yes; then
 
540
    AC_DEFINE(HAVE_ICONV, 1,
 
541
      [Define if you have the iconv() function and it works.])
 
542
  fi
 
543
  if test "$am_cv_lib_iconv" = yes; then
 
544
    AC_MSG_CHECKING([how to link with libiconv])
 
545
    AC_MSG_RESULT([$LIBICONV])
 
546
  else
 
547
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
548
    dnl either.
 
549
    CPPFLAGS="$am_save_CPPFLAGS"
 
550
    LIBICONV=
 
551
    LTLIBICONV=
 
552
  fi
 
553
  AC_SUBST(LIBICONV)
 
554
  AC_SUBST(LTLIBICONV)
 
555
])
 
556
 
 
557
AC_DEFUN([AM_ICONV],
 
558
[
 
559
  AM_ICONV_LINK
 
560
  if test "$am_cv_func_iconv" = yes; then
 
561
    AC_MSG_CHECKING([for iconv declaration])
 
562
    AC_CACHE_VAL(am_cv_proto_iconv, [
 
563
      AC_TRY_COMPILE([
 
564
#include <stdlib.h>
 
565
#include <iconv.h>
 
566
extern
 
567
#ifdef __cplusplus
 
568
"C"
 
569
#endif
 
570
#if defined(__STDC__) || defined(__cplusplus)
 
571
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
572
#else
 
573
size_t iconv();
 
574
#endif
 
575
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
 
576
      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);"])
 
577
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
578
    AC_MSG_RESULT([$]{ac_t:-
 
579
         }[$]am_cv_proto_iconv)
 
580
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
581
      [Define as const if the declaration of iconv() needs const.])
 
582
  fi
 
583
])
 
584
 
 
585
# intlmacosx.m4 serial 1 (gettext-0.17)
 
586
dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
 
587
dnl This file is free software; the Free Software Foundation
 
588
dnl gives unlimited permission to copy and/or distribute it,
 
589
dnl with or without modifications, as long as this notice is preserved.
 
590
dnl
 
591
dnl This file can can be used in projects which are not available under
 
592
dnl the GNU General Public License or the GNU Library General Public
 
593
dnl License but which still want to provide support for the GNU gettext
 
594
dnl functionality.
 
595
dnl Please note that the actual code of the GNU gettext library is covered
 
596
dnl by the GNU Library General Public License, and the rest of the GNU
 
597
dnl gettext package package is covered by the GNU General Public License.
 
598
dnl They are *not* in the public domain.
 
599
 
 
600
dnl Checks for special options needed on MacOS X.
 
601
dnl Defines INTL_MACOSX_LIBS.
 
602
AC_DEFUN([gt_INTL_MACOSX],
 
603
[
 
604
  dnl Check for API introduced in MacOS X 10.2.
 
605
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
 
606
    gt_cv_func_CFPreferencesCopyAppValue,
 
607
    [gt_save_LIBS="$LIBS"
 
608
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
609
     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
 
610
       [CFPreferencesCopyAppValue(NULL, NULL)],
 
611
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
 
612
       [gt_cv_func_CFPreferencesCopyAppValue=no])
 
613
     LIBS="$gt_save_LIBS"])
 
614
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
615
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
 
616
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
 
617
  fi
 
618
  dnl Check for API introduced in MacOS X 10.3.
 
619
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
 
620
    [gt_save_LIBS="$LIBS"
 
621
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
622
     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
 
623
       [gt_cv_func_CFLocaleCopyCurrent=yes],
 
624
       [gt_cv_func_CFLocaleCopyCurrent=no])
 
625
     LIBS="$gt_save_LIBS"])
 
626
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
627
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
 
628
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
 
629
  fi
 
630
  INTL_MACOSX_LIBS=
 
631
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
632
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
 
633
  fi
 
634
  AC_SUBST([INTL_MACOSX_LIBS])
 
635
])
 
636
 
 
637
# lib-ld.m4 serial 3 (gettext-0.13)
 
638
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
 
639
dnl This file is free software; the Free Software Foundation
 
640
dnl gives unlimited permission to copy and/or distribute it,
 
641
dnl with or without modifications, as long as this notice is preserved.
 
642
 
 
643
dnl Subroutines of libtool.m4,
 
644
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
645
dnl with libtool.m4.
 
646
 
 
647
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
648
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
649
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 
650
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
651
case `$LD -v 2>&1 </dev/null` in
 
652
*GNU* | *'with BFD'*)
 
653
  acl_cv_prog_gnu_ld=yes ;;
 
654
*)
 
655
  acl_cv_prog_gnu_ld=no ;;
 
656
esac])
 
657
with_gnu_ld=$acl_cv_prog_gnu_ld
 
658
])
 
659
 
 
660
dnl From libtool-1.4. Sets the variable LD.
 
661
AC_DEFUN([AC_LIB_PROG_LD],
 
662
[AC_ARG_WITH(gnu-ld,
 
663
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
664
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
665
AC_REQUIRE([AC_PROG_CC])dnl
 
666
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
667
# Prepare PATH_SEPARATOR.
 
668
# The user is always right.
 
669
if test "${PATH_SEPARATOR+set}" != set; then
 
670
  echo "#! /bin/sh" >conf$$.sh
 
671
  echo  "exit 0"   >>conf$$.sh
 
672
  chmod +x conf$$.sh
 
673
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
674
    PATH_SEPARATOR=';'
 
675
  else
 
676
    PATH_SEPARATOR=:
 
677
  fi
 
678
  rm -f conf$$.sh
 
679
fi
 
680
ac_prog=ld
 
681
if test "$GCC" = yes; then
 
682
  # Check if gcc -print-prog-name=ld gives a path.
 
683
  AC_MSG_CHECKING([for ld used by GCC])
 
684
  case $host in
 
685
  *-*-mingw*)
 
686
    # gcc leaves a trailing carriage return which upsets mingw
 
687
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
688
  *)
 
689
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
690
  esac
 
691
  case $ac_prog in
 
692
    # Accept absolute paths.
 
693
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
694
      [re_direlt='/[^/][^/]*/\.\./']
 
695
      # Canonicalize the path of ld
 
696
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
697
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
698
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
699
      done
 
700
      test -z "$LD" && LD="$ac_prog"
 
701
      ;;
 
702
  "")
 
703
    # If it fails, then pretend we aren't using GCC.
 
704
    ac_prog=ld
 
705
    ;;
 
706
  *)
 
707
    # If it is relative, then search for the first ld in PATH.
 
708
    with_gnu_ld=unknown
 
709
    ;;
 
710
  esac
 
711
elif test "$with_gnu_ld" = yes; then
 
712
  AC_MSG_CHECKING([for GNU ld])
 
713
else
 
714
  AC_MSG_CHECKING([for non-GNU ld])
 
715
fi
 
716
AC_CACHE_VAL(acl_cv_path_LD,
 
717
[if test -z "$LD"; then
 
718
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
719
  for ac_dir in $PATH; do
 
720
    test -z "$ac_dir" && ac_dir=.
 
721
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
722
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
723
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
724
      # but apparently some GNU ld's only accept -v.
 
725
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
726
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
727
      *GNU* | *'with BFD'*)
 
728
        test "$with_gnu_ld" != no && break ;;
 
729
      *)
 
730
        test "$with_gnu_ld" != yes && break ;;
 
731
      esac
 
732
    fi
 
733
  done
 
734
  IFS="$ac_save_ifs"
 
735
else
 
736
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
737
fi])
 
738
LD="$acl_cv_path_LD"
 
739
if test -n "$LD"; then
 
740
  AC_MSG_RESULT($LD)
 
741
else
 
742
  AC_MSG_RESULT(no)
 
743
fi
 
744
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
745
AC_LIB_PROG_LD_GNU
 
746
])
 
747
 
 
748
# lib-link.m4 serial 13 (gettext-0.17)
 
749
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 
750
dnl This file is free software; the Free Software Foundation
 
751
dnl gives unlimited permission to copy and/or distribute it,
 
752
dnl with or without modifications, as long as this notice is preserved.
 
753
 
 
754
dnl From Bruno Haible.
 
755
 
 
756
AC_PREREQ(2.54)
 
757
 
 
758
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 
759
dnl the libraries corresponding to explicit and implicit dependencies.
 
760
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 
761
dnl augments the CPPFLAGS variable.
 
762
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
763
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
764
AC_DEFUN([AC_LIB_LINKFLAGS],
 
765
[
 
766
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
767
  AC_REQUIRE([AC_LIB_RPATH])
 
768
  define([Name],[translit([$1],[./-], [___])])
 
769
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
770
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
771
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
 
772
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
773
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
 
774
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
 
775
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
776
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
 
777
  ])
 
778
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
 
779
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
 
780
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
781
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
 
782
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
783
  AC_SUBST([LIB]NAME)
 
784
  AC_SUBST([LTLIB]NAME)
 
785
  AC_SUBST([LIB]NAME[_PREFIX])
 
786
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
 
787
  dnl results of this search when this library appears as a dependency.
 
788
  HAVE_LIB[]NAME=yes
 
789
  undefine([Name])
 
790
  undefine([NAME])
 
791
])
 
792
 
 
793
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
794
dnl searches for libname and the libraries corresponding to explicit and
 
795
dnl implicit dependencies, together with the specified include files and
 
796
dnl the ability to compile and link the specified testcode. If found, it
 
797
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 
798
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
799
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 
800
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
801
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
802
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
803
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
804
[
 
805
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
806
  AC_REQUIRE([AC_LIB_RPATH])
 
807
  define([Name],[translit([$1],[./-], [___])])
 
808
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
809
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
810
 
 
811
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
 
812
  dnl accordingly.
 
813
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
814
 
 
815
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
 
816
  dnl because if the user has installed lib[]Name and not disabled its use
 
817
  dnl via --without-lib[]Name-prefix, he wants to use it.
 
818
  ac_save_CPPFLAGS="$CPPFLAGS"
 
819
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
820
 
 
821
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
 
822
    ac_save_LIBS="$LIBS"
 
823
    LIBS="$LIBS $LIB[]NAME"
 
824
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
 
825
    LIBS="$ac_save_LIBS"
 
826
  ])
 
827
  if test "$ac_cv_lib[]Name" = yes; then
 
828
    HAVE_LIB[]NAME=yes
 
829
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
 
830
    AC_MSG_CHECKING([how to link with lib[]$1])
 
831
    AC_MSG_RESULT([$LIB[]NAME])
 
832
  else
 
833
    HAVE_LIB[]NAME=no
 
834
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
 
835
    dnl $INC[]NAME either.
 
836
    CPPFLAGS="$ac_save_CPPFLAGS"
 
837
    LIB[]NAME=
 
838
    LTLIB[]NAME=
 
839
    LIB[]NAME[]_PREFIX=
 
840
  fi
 
841
  AC_SUBST([HAVE_LIB]NAME)
 
842
  AC_SUBST([LIB]NAME)
 
843
  AC_SUBST([LTLIB]NAME)
 
844
  AC_SUBST([LIB]NAME[_PREFIX])
 
845
  undefine([Name])
 
846
  undefine([NAME])
 
847
])
 
848
 
 
849
dnl Determine the platform dependent parameters needed to use rpath:
 
850
dnl   acl_libext,
 
851
dnl   acl_shlibext,
 
852
dnl   acl_hardcode_libdir_flag_spec,
 
853
dnl   acl_hardcode_libdir_separator,
 
854
dnl   acl_hardcode_direct,
 
855
dnl   acl_hardcode_minus_L.
 
856
AC_DEFUN([AC_LIB_RPATH],
 
857
[
 
858
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
859
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
 
860
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
 
861
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
 
862
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
 
863
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
 
864
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
 
865
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
 
866
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
 
867
    . ./conftest.sh
 
868
    rm -f ./conftest.sh
 
869
    acl_cv_rpath=done
 
870
  ])
 
871
  wl="$acl_cv_wl"
 
872
  acl_libext="$acl_cv_libext"
 
873
  acl_shlibext="$acl_cv_shlibext"
 
874
  acl_libname_spec="$acl_cv_libname_spec"
 
875
  acl_library_names_spec="$acl_cv_library_names_spec"
 
876
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
877
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
878
  acl_hardcode_direct="$acl_cv_hardcode_direct"
 
879
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
880
  dnl Determine whether the user wants rpath handling at all.
 
881
  AC_ARG_ENABLE(rpath,
 
882
    [  --disable-rpath         do not hardcode runtime library paths],
 
883
    :, enable_rpath=yes)
 
884
])
 
885
 
 
886
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 
887
dnl the libraries corresponding to explicit and implicit dependencies.
 
888
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
889
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
 
890
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
891
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 
892
[
 
893
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
894
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
895
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
896
  dnl Autoconf >= 2.61 supports dots in --with options.
 
897
  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
 
898
  dnl By default, look in $includedir and $libdir.
 
899
  use_additional=yes
 
900
  AC_LIB_WITH_FINAL_PREFIX([
 
901
    eval additional_includedir=\"$includedir\"
 
902
    eval additional_libdir=\"$libdir\"
 
903
  ])
 
904
  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
 
905
[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
906
  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
 
907
[
 
908
    if test "X$withval" = "Xno"; then
 
909
      use_additional=no
 
910
    else
 
911
      if test "X$withval" = "X"; then
 
912
        AC_LIB_WITH_FINAL_PREFIX([
 
913
          eval additional_includedir=\"$includedir\"
 
914
          eval additional_libdir=\"$libdir\"
 
915
        ])
 
916
      else
 
917
        additional_includedir="$withval/include"
 
918
        additional_libdir="$withval/$acl_libdirstem"
 
919
      fi
 
920
    fi
 
921
])
 
922
  dnl Search the library and its dependencies in $additional_libdir and
 
923
  dnl $LDFLAGS. Using breadth-first-seach.
 
924
  LIB[]NAME=
 
925
  LTLIB[]NAME=
 
926
  INC[]NAME=
 
927
  LIB[]NAME[]_PREFIX=
 
928
  rpathdirs=
 
929
  ltrpathdirs=
 
930
  names_already_handled=
 
931
  names_next_round='$1 $2'
 
932
  while test -n "$names_next_round"; do
 
933
    names_this_round="$names_next_round"
 
934
    names_next_round=
 
935
    for name in $names_this_round; do
 
936
      already_handled=
 
937
      for n in $names_already_handled; do
 
938
        if test "$n" = "$name"; then
 
939
          already_handled=yes
 
940
          break
 
941
        fi
 
942
      done
 
943
      if test -z "$already_handled"; then
 
944
        names_already_handled="$names_already_handled $name"
 
945
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
 
946
        dnl or AC_LIB_HAVE_LINKFLAGS call.
 
947
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
948
        eval value=\"\$HAVE_LIB$uppername\"
 
949
        if test -n "$value"; then
 
950
          if test "$value" = yes; then
 
951
            eval value=\"\$LIB$uppername\"
 
952
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
 
953
            eval value=\"\$LTLIB$uppername\"
 
954
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
 
955
          else
 
956
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
 
957
            dnl that this library doesn't exist. So just drop it.
 
958
            :
 
959
          fi
 
960
        else
 
961
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
 
962
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
 
963
          found_dir=
 
964
          found_la=
 
965
          found_so=
 
966
          found_a=
 
967
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
 
968
          if test -n "$acl_shlibext"; then
 
969
            shrext=".$acl_shlibext"             # typically: shrext=.so
 
970
          else
 
971
            shrext=
 
972
          fi
 
973
          if test $use_additional = yes; then
 
974
            dir="$additional_libdir"
 
975
            dnl The same code as in the loop below:
 
976
            dnl First look for a shared library.
 
977
            if test -n "$acl_shlibext"; then
 
978
              if test -f "$dir/$libname$shrext"; then
 
979
                found_dir="$dir"
 
980
                found_so="$dir/$libname$shrext"
 
981
              else
 
982
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
983
                  ver=`(cd "$dir" && \
 
984
                        for f in "$libname$shrext".*; do echo "$f"; done \
 
985
                        | sed -e "s,^$libname$shrext\\\\.,," \
 
986
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
987
                        | sed 1q ) 2>/dev/null`
 
988
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
989
                    found_dir="$dir"
 
990
                    found_so="$dir/$libname$shrext.$ver"
 
991
                  fi
 
992
                else
 
993
                  eval library_names=\"$acl_library_names_spec\"
 
994
                  for f in $library_names; do
 
995
                    if test -f "$dir/$f"; then
 
996
                      found_dir="$dir"
 
997
                      found_so="$dir/$f"
 
998
                      break
 
999
                    fi
 
1000
                  done
 
1001
                fi
 
1002
              fi
 
1003
            fi
 
1004
            dnl Then look for a static library.
 
1005
            if test "X$found_dir" = "X"; then
 
1006
              if test -f "$dir/$libname.$acl_libext"; then
 
1007
                found_dir="$dir"
 
1008
                found_a="$dir/$libname.$acl_libext"
 
1009
              fi
 
1010
            fi
 
1011
            if test "X$found_dir" != "X"; then
 
1012
              if test -f "$dir/$libname.la"; then
 
1013
                found_la="$dir/$libname.la"
 
1014
              fi
 
1015
            fi
 
1016
          fi
 
1017
          if test "X$found_dir" = "X"; then
 
1018
            for x in $LDFLAGS $LTLIB[]NAME; do
 
1019
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1020
              case "$x" in
 
1021
                -L*)
 
1022
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
 
1023
                  dnl First look for a shared library.
 
1024
                  if test -n "$acl_shlibext"; then
 
1025
                    if test -f "$dir/$libname$shrext"; then
 
1026
                      found_dir="$dir"
 
1027
                      found_so="$dir/$libname$shrext"
 
1028
                    else
 
1029
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
1030
                        ver=`(cd "$dir" && \
 
1031
                              for f in "$libname$shrext".*; do echo "$f"; done \
 
1032
                              | sed -e "s,^$libname$shrext\\\\.,," \
 
1033
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
1034
                              | sed 1q ) 2>/dev/null`
 
1035
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
1036
                          found_dir="$dir"
 
1037
                          found_so="$dir/$libname$shrext.$ver"
 
1038
                        fi
 
1039
                      else
 
1040
                        eval library_names=\"$acl_library_names_spec\"
 
1041
                        for f in $library_names; do
 
1042
                          if test -f "$dir/$f"; then
 
1043
                            found_dir="$dir"
 
1044
                            found_so="$dir/$f"
 
1045
                            break
 
1046
                          fi
 
1047
                        done
 
1048
                      fi
 
1049
                    fi
 
1050
                  fi
 
1051
                  dnl Then look for a static library.
 
1052
                  if test "X$found_dir" = "X"; then
 
1053
                    if test -f "$dir/$libname.$acl_libext"; then
 
1054
                      found_dir="$dir"
 
1055
                      found_a="$dir/$libname.$acl_libext"
 
1056
                    fi
 
1057
                  fi
 
1058
                  if test "X$found_dir" != "X"; then
 
1059
                    if test -f "$dir/$libname.la"; then
 
1060
                      found_la="$dir/$libname.la"
 
1061
                    fi
 
1062
                  fi
 
1063
                  ;;
 
1064
              esac
 
1065
              if test "X$found_dir" != "X"; then
 
1066
                break
 
1067
              fi
 
1068
            done
 
1069
          fi
 
1070
          if test "X$found_dir" != "X"; then
 
1071
            dnl Found the library.
 
1072
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
 
1073
            if test "X$found_so" != "X"; then
 
1074
              dnl Linking with a shared library. We attempt to hardcode its
 
1075
              dnl directory into the executable's runpath, unless it's the
 
1076
              dnl standard /usr/lib.
 
1077
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
 
1078
                dnl No hardcoding is needed.
 
1079
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1080
              else
 
1081
                dnl Use an explicit option to hardcode DIR into the resulting
 
1082
                dnl binary.
 
1083
                dnl Potentially add DIR to ltrpathdirs.
 
1084
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
1085
                haveit=
 
1086
                for x in $ltrpathdirs; do
 
1087
                  if test "X$x" = "X$found_dir"; then
 
1088
                    haveit=yes
 
1089
                    break
 
1090
                  fi
 
1091
                done
 
1092
                if test -z "$haveit"; then
 
1093
                  ltrpathdirs="$ltrpathdirs $found_dir"
 
1094
                fi
 
1095
                dnl The hardcoding into $LIBNAME is system dependent.
 
1096
                if test "$acl_hardcode_direct" = yes; then
 
1097
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
 
1098
                  dnl resulting binary.
 
1099
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1100
                else
 
1101
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
1102
                    dnl Use an explicit option to hardcode DIR into the resulting
 
1103
                    dnl binary.
 
1104
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1105
                    dnl Potentially add DIR to rpathdirs.
 
1106
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
1107
                    haveit=
 
1108
                    for x in $rpathdirs; do
 
1109
                      if test "X$x" = "X$found_dir"; then
 
1110
                        haveit=yes
 
1111
                        break
 
1112
                      fi
 
1113
                    done
 
1114
                    if test -z "$haveit"; then
 
1115
                      rpathdirs="$rpathdirs $found_dir"
 
1116
                    fi
 
1117
                  else
 
1118
                    dnl Rely on "-L$found_dir".
 
1119
                    dnl But don't add it if it's already contained in the LDFLAGS
 
1120
                    dnl or the already constructed $LIBNAME
 
1121
                    haveit=
 
1122
                    for x in $LDFLAGS $LIB[]NAME; do
 
1123
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1124
                      if test "X$x" = "X-L$found_dir"; then
 
1125
                        haveit=yes
 
1126
                        break
 
1127
                      fi
 
1128
                    done
 
1129
                    if test -z "$haveit"; then
 
1130
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
 
1131
                    fi
 
1132
                    if test "$acl_hardcode_minus_L" != no; then
 
1133
                      dnl FIXME: Not sure whether we should use
 
1134
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
1135
                      dnl here.
 
1136
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1137
                    else
 
1138
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
 
1139
                      dnl here, because this doesn't fit in flags passed to the
 
1140
                      dnl compiler. So give up. No hardcoding. This affects only
 
1141
                      dnl very old systems.
 
1142
                      dnl FIXME: Not sure whether we should use
 
1143
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
1144
                      dnl here.
 
1145
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
1146
                    fi
 
1147
                  fi
 
1148
                fi
 
1149
              fi
 
1150
            else
 
1151
              if test "X$found_a" != "X"; then
 
1152
                dnl Linking with a static library.
 
1153
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
 
1154
              else
 
1155
                dnl We shouldn't come here, but anyway it's good to have a
 
1156
                dnl fallback.
 
1157
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
 
1158
              fi
 
1159
            fi
 
1160
            dnl Assume the include files are nearby.
 
1161
            additional_includedir=
 
1162
            case "$found_dir" in
 
1163
              */$acl_libdirstem | */$acl_libdirstem/)
 
1164
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
 
1165
                LIB[]NAME[]_PREFIX="$basedir"
 
1166
                additional_includedir="$basedir/include"
 
1167
                ;;
 
1168
            esac
 
1169
            if test "X$additional_includedir" != "X"; then
 
1170
              dnl Potentially add $additional_includedir to $INCNAME.
 
1171
              dnl But don't add it
 
1172
              dnl   1. if it's the standard /usr/include,
 
1173
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
 
1174
              dnl   3. if it's already present in $CPPFLAGS or the already
 
1175
              dnl      constructed $INCNAME,
 
1176
              dnl   4. if it doesn't exist as a directory.
 
1177
              if test "X$additional_includedir" != "X/usr/include"; then
 
1178
                haveit=
 
1179
                if test "X$additional_includedir" = "X/usr/local/include"; then
 
1180
                  if test -n "$GCC"; then
 
1181
                    case $host_os in
 
1182
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1183
                    esac
 
1184
                  fi
 
1185
                fi
 
1186
                if test -z "$haveit"; then
 
1187
                  for x in $CPPFLAGS $INC[]NAME; do
 
1188
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1189
                    if test "X$x" = "X-I$additional_includedir"; then
 
1190
                      haveit=yes
 
1191
                      break
 
1192
                    fi
 
1193
                  done
 
1194
                  if test -z "$haveit"; then
 
1195
                    if test -d "$additional_includedir"; then
 
1196
                      dnl Really add $additional_includedir to $INCNAME.
 
1197
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
1198
                    fi
 
1199
                  fi
 
1200
                fi
 
1201
              fi
 
1202
            fi
 
1203
            dnl Look for dependencies.
 
1204
            if test -n "$found_la"; then
 
1205
              dnl Read the .la file. It defines the variables
 
1206
              dnl dlname, library_names, old_library, dependency_libs, current,
 
1207
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
 
1208
              save_libdir="$libdir"
 
1209
              case "$found_la" in
 
1210
                */* | *\\*) . "$found_la" ;;
 
1211
                *) . "./$found_la" ;;
 
1212
              esac
 
1213
              libdir="$save_libdir"
 
1214
              dnl We use only dependency_libs.
 
1215
              for dep in $dependency_libs; do
 
1216
                case "$dep" in
 
1217
                  -L*)
 
1218
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
 
1219
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
 
1220
                    dnl But don't add it
 
1221
                    dnl   1. if it's the standard /usr/lib,
 
1222
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
 
1223
                    dnl   3. if it's already present in $LDFLAGS or the already
 
1224
                    dnl      constructed $LIBNAME,
 
1225
                    dnl   4. if it doesn't exist as a directory.
 
1226
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
 
1227
                      haveit=
 
1228
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
 
1229
                        if test -n "$GCC"; then
 
1230
                          case $host_os in
 
1231
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1232
                          esac
 
1233
                        fi
 
1234
                      fi
 
1235
                      if test -z "$haveit"; then
 
1236
                        haveit=
 
1237
                        for x in $LDFLAGS $LIB[]NAME; do
 
1238
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1239
                          if test "X$x" = "X-L$additional_libdir"; then
 
1240
                            haveit=yes
 
1241
                            break
 
1242
                          fi
 
1243
                        done
 
1244
                        if test -z "$haveit"; then
 
1245
                          if test -d "$additional_libdir"; then
 
1246
                            dnl Really add $additional_libdir to $LIBNAME.
 
1247
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
 
1248
                          fi
 
1249
                        fi
 
1250
                        haveit=
 
1251
                        for x in $LDFLAGS $LTLIB[]NAME; do
 
1252
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1253
                          if test "X$x" = "X-L$additional_libdir"; then
 
1254
                            haveit=yes
 
1255
                            break
 
1256
                          fi
 
1257
                        done
 
1258
                        if test -z "$haveit"; then
 
1259
                          if test -d "$additional_libdir"; then
 
1260
                            dnl Really add $additional_libdir to $LTLIBNAME.
 
1261
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
 
1262
                          fi
 
1263
                        fi
 
1264
                      fi
 
1265
                    fi
 
1266
                    ;;
 
1267
                  -R*)
 
1268
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
 
1269
                    if test "$enable_rpath" != no; then
 
1270
                      dnl Potentially add DIR to rpathdirs.
 
1271
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
 
1272
                      haveit=
 
1273
                      for x in $rpathdirs; do
 
1274
                        if test "X$x" = "X$dir"; then
 
1275
                          haveit=yes
 
1276
                          break
 
1277
                        fi
 
1278
                      done
 
1279
                      if test -z "$haveit"; then
 
1280
                        rpathdirs="$rpathdirs $dir"
 
1281
                      fi
 
1282
                      dnl Potentially add DIR to ltrpathdirs.
 
1283
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
1284
                      haveit=
 
1285
                      for x in $ltrpathdirs; do
 
1286
                        if test "X$x" = "X$dir"; then
 
1287
                          haveit=yes
 
1288
                          break
 
1289
                        fi
 
1290
                      done
 
1291
                      if test -z "$haveit"; then
 
1292
                        ltrpathdirs="$ltrpathdirs $dir"
 
1293
                      fi
 
1294
                    fi
 
1295
                    ;;
 
1296
                  -l*)
 
1297
                    dnl Handle this in the next round.
 
1298
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
 
1299
                    ;;
 
1300
                  *.la)
 
1301
                    dnl Handle this in the next round. Throw away the .la's
 
1302
                    dnl directory; it is already contained in a preceding -L
 
1303
                    dnl option.
 
1304
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
 
1305
                    ;;
 
1306
                  *)
 
1307
                    dnl Most likely an immediate library name.
 
1308
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
 
1309
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
 
1310
                    ;;
 
1311
                esac
 
1312
              done
 
1313
            fi
 
1314
          else
 
1315
            dnl Didn't find the library; assume it is in the system directories
 
1316
            dnl known to the linker and runtime loader. (All the system
 
1317
            dnl directories known to the linker should also be known to the
 
1318
            dnl runtime loader, otherwise the system is severely misconfigured.)
 
1319
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
1320
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
 
1321
          fi
 
1322
        fi
 
1323
      fi
 
1324
    done
 
1325
  done
 
1326
  if test "X$rpathdirs" != "X"; then
 
1327
    if test -n "$acl_hardcode_libdir_separator"; then
 
1328
      dnl Weird platform: only the last -rpath option counts, the user must
 
1329
      dnl pass all path elements in one option. We can arrange that for a
 
1330
      dnl single library, but not when more than one $LIBNAMEs are used.
 
1331
      alldirs=
 
1332
      for found_dir in $rpathdirs; do
 
1333
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
 
1334
      done
 
1335
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
 
1336
      acl_save_libdir="$libdir"
 
1337
      libdir="$alldirs"
 
1338
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1339
      libdir="$acl_save_libdir"
 
1340
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
1341
    else
 
1342
      dnl The -rpath options are cumulative.
 
1343
      for found_dir in $rpathdirs; do
 
1344
        acl_save_libdir="$libdir"
 
1345
        libdir="$found_dir"
 
1346
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1347
        libdir="$acl_save_libdir"
 
1348
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
1349
      done
 
1350
    fi
 
1351
  fi
 
1352
  if test "X$ltrpathdirs" != "X"; then
 
1353
    dnl When using libtool, the option that works for both libraries and
 
1354
    dnl executables is -R. The -R options are cumulative.
 
1355
    for found_dir in $ltrpathdirs; do
 
1356
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
 
1357
    done
 
1358
  fi
 
1359
])
 
1360
 
 
1361
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
 
1362
dnl unless already present in VAR.
 
1363
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
 
1364
dnl contains two or three consecutive elements that belong together.
 
1365
AC_DEFUN([AC_LIB_APPENDTOVAR],
 
1366
[
 
1367
  for element in [$2]; do
 
1368
    haveit=
 
1369
    for x in $[$1]; do
 
1370
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1371
      if test "X$x" = "X$element"; then
 
1372
        haveit=yes
 
1373
        break
 
1374
      fi
 
1375
    done
 
1376
    if test -z "$haveit"; then
 
1377
      [$1]="${[$1]}${[$1]:+ }$element"
 
1378
    fi
 
1379
  done
 
1380
])
 
1381
 
 
1382
dnl For those cases where a variable contains several -L and -l options
 
1383
dnl referring to unknown libraries and directories, this macro determines the
 
1384
dnl necessary additional linker options for the runtime path.
 
1385
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
 
1386
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
 
1387
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
 
1388
dnl otherwise linking without libtool is assumed.
 
1389
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 
1390
[
 
1391
  AC_REQUIRE([AC_LIB_RPATH])
 
1392
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1393
  $1=
 
1394
  if test "$enable_rpath" != no; then
 
1395
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
1396
      dnl Use an explicit option to hardcode directories into the resulting
 
1397
      dnl binary.
 
1398
      rpathdirs=
 
1399
      next=
 
1400
      for opt in $2; do
 
1401
        if test -n "$next"; then
 
1402
          dir="$next"
 
1403
          dnl No need to hardcode the standard /usr/lib.
 
1404
          if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
1405
            rpathdirs="$rpathdirs $dir"
 
1406
          fi
 
1407
          next=
 
1408
        else
 
1409
          case $opt in
 
1410
            -L) next=yes ;;
 
1411
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
 
1412
                 dnl No need to hardcode the standard /usr/lib.
 
1413
                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
1414
                   rpathdirs="$rpathdirs $dir"
 
1415
                 fi
 
1416
                 next= ;;
 
1417
            *) next= ;;
 
1418
          esac
 
1419
        fi
 
1420
      done
 
1421
      if test "X$rpathdirs" != "X"; then
 
1422
        if test -n ""$3""; then
 
1423
          dnl libtool is used for linking. Use -R options.
 
1424
          for dir in $rpathdirs; do
 
1425
            $1="${$1}${$1:+ }-R$dir"
 
1426
          done
 
1427
        else
 
1428
          dnl The linker is used for linking directly.
 
1429
          if test -n "$acl_hardcode_libdir_separator"; then
 
1430
            dnl Weird platform: only the last -rpath option counts, the user
 
1431
            dnl must pass all path elements in one option.
 
1432
            alldirs=
 
1433
            for dir in $rpathdirs; do
 
1434
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
 
1435
            done
 
1436
            acl_save_libdir="$libdir"
 
1437
            libdir="$alldirs"
 
1438
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1439
            libdir="$acl_save_libdir"
 
1440
            $1="$flag"
 
1441
          else
 
1442
            dnl The -rpath options are cumulative.
 
1443
            for dir in $rpathdirs; do
 
1444
              acl_save_libdir="$libdir"
 
1445
              libdir="$dir"
 
1446
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1447
              libdir="$acl_save_libdir"
 
1448
              $1="${$1}${$1:+ }$flag"
 
1449
            done
 
1450
          fi
 
1451
        fi
 
1452
      fi
 
1453
    fi
 
1454
  fi
 
1455
  AC_SUBST([$1])
 
1456
])
 
1457
 
 
1458
# lib-prefix.m4 serial 5 (gettext-0.15)
 
1459
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
 
1460
dnl This file is free software; the Free Software Foundation
 
1461
dnl gives unlimited permission to copy and/or distribute it,
 
1462
dnl with or without modifications, as long as this notice is preserved.
 
1463
 
 
1464
dnl From Bruno Haible.
 
1465
 
 
1466
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
 
1467
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
 
1468
dnl require excessive bracketing.
 
1469
ifdef([AC_HELP_STRING],
 
1470
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
 
1471
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
1472
 
 
1473
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
1474
dnl to access previously installed libraries. The basic assumption is that
 
1475
dnl a user will want packages to use other packages he previously installed
 
1476
dnl with the same --prefix option.
 
1477
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
1478
dnl libraries, but is otherwise very convenient.
 
1479
AC_DEFUN([AC_LIB_PREFIX],
 
1480
[
 
1481
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
1482
  AC_REQUIRE([AC_PROG_CC])
 
1483
  AC_REQUIRE([AC_CANONICAL_HOST])
 
1484
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1485
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1486
  dnl By default, look in $includedir and $libdir.
 
1487
  use_additional=yes
 
1488
  AC_LIB_WITH_FINAL_PREFIX([
 
1489
    eval additional_includedir=\"$includedir\"
 
1490
    eval additional_libdir=\"$libdir\"
 
1491
  ])
 
1492
  AC_LIB_ARG_WITH([lib-prefix],
 
1493
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
1494
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
1495
[
 
1496
    if test "X$withval" = "Xno"; then
 
1497
      use_additional=no
 
1498
    else
 
1499
      if test "X$withval" = "X"; then
 
1500
        AC_LIB_WITH_FINAL_PREFIX([
 
1501
          eval additional_includedir=\"$includedir\"
 
1502
          eval additional_libdir=\"$libdir\"
 
1503
        ])
 
1504
      else
 
1505
        additional_includedir="$withval/include"
 
1506
        additional_libdir="$withval/$acl_libdirstem"
 
1507
      fi
 
1508
    fi
 
1509
])
 
1510
  if test $use_additional = yes; then
 
1511
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
1512
    dnl But don't add it
 
1513
    dnl   1. if it's the standard /usr/include,
 
1514
    dnl   2. if it's already present in $CPPFLAGS,
 
1515
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
1516
    dnl   4. if it doesn't exist as a directory.
 
1517
    if test "X$additional_includedir" != "X/usr/include"; then
 
1518
      haveit=
 
1519
      for x in $CPPFLAGS; do
 
1520
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1521
        if test "X$x" = "X-I$additional_includedir"; then
 
1522
          haveit=yes
 
1523
          break
 
1524
        fi
 
1525
      done
 
1526
      if test -z "$haveit"; then
 
1527
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
1528
          if test -n "$GCC"; then
 
1529
            case $host_os in
 
1530
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1531
            esac
 
1532
          fi
 
1533
        fi
 
1534
        if test -z "$haveit"; then
 
1535
          if test -d "$additional_includedir"; then
 
1536
            dnl Really add $additional_includedir to $CPPFLAGS.
 
1537
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
1538
          fi
 
1539
        fi
 
1540
      fi
 
1541
    fi
 
1542
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
1543
    dnl But don't add it
 
1544
    dnl   1. if it's the standard /usr/lib,
 
1545
    dnl   2. if it's already present in $LDFLAGS,
 
1546
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
1547
    dnl   4. if it doesn't exist as a directory.
 
1548
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
 
1549
      haveit=
 
1550
      for x in $LDFLAGS; do
 
1551
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1552
        if test "X$x" = "X-L$additional_libdir"; then
 
1553
          haveit=yes
 
1554
          break
 
1555
        fi
 
1556
      done
 
1557
      if test -z "$haveit"; then
 
1558
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
 
1559
          if test -n "$GCC"; then
 
1560
            case $host_os in
 
1561
              linux*) haveit=yes;;
 
1562
            esac
 
1563
          fi
 
1564
        fi
 
1565
        if test -z "$haveit"; then
 
1566
          if test -d "$additional_libdir"; then
 
1567
            dnl Really add $additional_libdir to $LDFLAGS.
 
1568
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
1569
          fi
 
1570
        fi
 
1571
      fi
 
1572
    fi
 
1573
  fi
 
1574
])
 
1575
 
 
1576
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
1577
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
1578
dnl $exec_prefix will expand at the end of the configure script.
 
1579
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
1580
[
 
1581
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
1582
  dnl at the end of configure.
 
1583
  if test "X$prefix" = "XNONE"; then
 
1584
    acl_final_prefix="$ac_default_prefix"
 
1585
  else
 
1586
    acl_final_prefix="$prefix"
 
1587
  fi
 
1588
  if test "X$exec_prefix" = "XNONE"; then
 
1589
    acl_final_exec_prefix='${prefix}'
 
1590
  else
 
1591
    acl_final_exec_prefix="$exec_prefix"
 
1592
  fi
 
1593
  acl_save_prefix="$prefix"
 
1594
  prefix="$acl_final_prefix"
 
1595
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
1596
  prefix="$acl_save_prefix"
 
1597
])
 
1598
 
 
1599
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
1600
dnl variables prefix and exec_prefix bound to the values they will have
 
1601
dnl at the end of the configure script.
 
1602
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
1603
[
 
1604
  acl_save_prefix="$prefix"
 
1605
  prefix="$acl_final_prefix"
 
1606
  acl_save_exec_prefix="$exec_prefix"
 
1607
  exec_prefix="$acl_final_exec_prefix"
 
1608
  $1
 
1609
  exec_prefix="$acl_save_exec_prefix"
 
1610
  prefix="$acl_save_prefix"
 
1611
])
 
1612
 
 
1613
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
 
1614
dnl the basename of the libdir, either "lib" or "lib64".
 
1615
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 
1616
[
 
1617
  dnl There is no formal standard regarding lib and lib64. The current
 
1618
  dnl practice is that on a system supporting 32-bit and 64-bit instruction
 
1619
  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
 
1620
  dnl libraries go under $prefix/lib. We determine the compiler's default
 
1621
  dnl mode by looking at the compiler's library search path. If at least
 
1622
  dnl of its elements ends in /lib64 or points to a directory whose absolute
 
1623
  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
 
1624
  dnl default, namely "lib".
 
1625
  acl_libdirstem=lib
 
1626
  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
 
1627
  if test -n "$searchpath"; then
 
1628
    acl_save_IFS="${IFS=        }"; IFS=":"
 
1629
    for searchdir in $searchpath; do
 
1630
      if test -d "$searchdir"; then
 
1631
        case "$searchdir" in
 
1632
          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
 
1633
          *) searchdir=`cd "$searchdir" && pwd`
 
1634
             case "$searchdir" in
 
1635
               */lib64 ) acl_libdirstem=lib64 ;;
 
1636
             esac ;;
 
1637
        esac
 
1638
      fi
 
1639
    done
 
1640
    IFS="$acl_save_IFS"
 
1641
  fi
 
1642
])
 
1643
 
 
1644
# nls.m4 serial 3 (gettext-0.15)
 
1645
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
 
1646
dnl This file is free software; the Free Software Foundation
 
1647
dnl gives unlimited permission to copy and/or distribute it,
 
1648
dnl with or without modifications, as long as this notice is preserved.
 
1649
dnl
 
1650
dnl This file can can be used in projects which are not available under
 
1651
dnl the GNU General Public License or the GNU Library General Public
 
1652
dnl License but which still want to provide support for the GNU gettext
 
1653
dnl functionality.
 
1654
dnl Please note that the actual code of the GNU gettext library is covered
 
1655
dnl by the GNU Library General Public License, and the rest of the GNU
 
1656
dnl gettext package package is covered by the GNU General Public License.
 
1657
dnl They are *not* in the public domain.
 
1658
 
 
1659
dnl Authors:
 
1660
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1661
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
1662
 
 
1663
AC_PREREQ(2.50)
 
1664
 
 
1665
AC_DEFUN([AM_NLS],
 
1666
[
 
1667
  AC_MSG_CHECKING([whether NLS is requested])
 
1668
  dnl Default is enabled NLS
 
1669
  AC_ARG_ENABLE(nls,
 
1670
    [  --disable-nls           do not use Native Language Support],
 
1671
    USE_NLS=$enableval, USE_NLS=yes)
 
1672
  AC_MSG_RESULT($USE_NLS)
 
1673
  AC_SUBST(USE_NLS)
 
1674
])
 
1675
 
14
1676
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
15
1677
16
1678
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
79
1741
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80
1742
# ---------------------------------------------
81
1743
m4_define([_PKG_CONFIG],
82
 
[if test -n "$PKG_CONFIG"; then
83
 
    if test -n "$$1"; then
84
 
        pkg_cv_[]$1="$$1"
85
 
    else
86
 
        PKG_CHECK_EXISTS([$3],
87
 
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
88
 
                         [pkg_failed=yes])
89
 
    fi
90
 
else
91
 
        pkg_failed=untried
 
1744
[if test -n "$$1"; then
 
1745
    pkg_cv_[]$1="$$1"
 
1746
 elif test -n "$PKG_CONFIG"; then
 
1747
    PKG_CHECK_EXISTS([$3],
 
1748
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
1749
                     [pkg_failed=yes])
 
1750
 else
 
1751
    pkg_failed=untried
92
1752
fi[]dnl
93
1753
])# _PKG_CONFIG
94
1754
 
132
1792
if test $pkg_failed = yes; then
133
1793
        _PKG_SHORT_ERRORS_SUPPORTED
134
1794
        if test $_pkg_short_errors_supported = yes; then
135
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
 
1795
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
136
1796
        else 
137
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
1797
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
138
1798
        fi
139
1799
        # Put the nasty error message in config.log where it belongs
140
1800
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
169
1829
fi[]dnl
170
1830
])# PKG_CHECK_MODULES
171
1831
 
 
1832
# po.m4 serial 15 (gettext-0.17)
 
1833
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
 
1834
dnl This file is free software; the Free Software Foundation
 
1835
dnl gives unlimited permission to copy and/or distribute it,
 
1836
dnl with or without modifications, as long as this notice is preserved.
 
1837
dnl
 
1838
dnl This file can can be used in projects which are not available under
 
1839
dnl the GNU General Public License or the GNU Library General Public
 
1840
dnl License but which still want to provide support for the GNU gettext
 
1841
dnl functionality.
 
1842
dnl Please note that the actual code of the GNU gettext library is covered
 
1843
dnl by the GNU Library General Public License, and the rest of the GNU
 
1844
dnl gettext package package is covered by the GNU General Public License.
 
1845
dnl They are *not* in the public domain.
 
1846
 
 
1847
dnl Authors:
 
1848
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1849
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
1850
 
 
1851
AC_PREREQ(2.50)
 
1852
 
 
1853
dnl Checks for all prerequisites of the po subdirectory.
 
1854
AC_DEFUN([AM_PO_SUBDIRS],
 
1855
[
 
1856
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
1857
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1858
  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
 
1859
  AC_REQUIRE([AM_NLS])dnl
 
1860
 
 
1861
  dnl Release version of the gettext macros. This is used to ensure that
 
1862
  dnl the gettext macros and po/Makefile.in.in are in sync.
 
1863
  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
 
1864
 
 
1865
  dnl Perform the following tests also if --disable-nls has been given,
 
1866
  dnl because they are needed for "make dist" to work.
 
1867
 
 
1868
  dnl Search for GNU msgfmt in the PATH.
 
1869
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
 
1870
  dnl The second test excludes FreeBSD msgfmt.
 
1871
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1872
    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
1873
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
1874
    :)
 
1875
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1876
 
 
1877
  dnl Test whether it is GNU msgfmt >= 0.15.
 
1878
changequote(,)dnl
 
1879
  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
1880
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
 
1881
    *) MSGFMT_015=$MSGFMT ;;
 
1882
  esac
 
1883
changequote([,])dnl
 
1884
  AC_SUBST([MSGFMT_015])
 
1885
changequote(,)dnl
 
1886
  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
1887
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
 
1888
    *) GMSGFMT_015=$GMSGFMT ;;
 
1889
  esac
 
1890
changequote([,])dnl
 
1891
  AC_SUBST([GMSGFMT_015])
 
1892
 
 
1893
  dnl Search for GNU xgettext 0.12 or newer in the PATH.
 
1894
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
 
1895
  dnl The second test excludes FreeBSD xgettext.
 
1896
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1897
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
1898
     (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)],
 
1899
    :)
 
1900
  dnl Remove leftover from FreeBSD xgettext call.
 
1901
  rm -f messages.po
 
1902
 
 
1903
  dnl Test whether it is GNU xgettext >= 0.15.
 
1904
changequote(,)dnl
 
1905
  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
1906
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
 
1907
    *) XGETTEXT_015=$XGETTEXT ;;
 
1908
  esac
 
1909
changequote([,])dnl
 
1910
  AC_SUBST([XGETTEXT_015])
 
1911
 
 
1912
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
 
1913
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
 
1914
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
1915
 
 
1916
  dnl Installation directories.
 
1917
  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
 
1918
  dnl have to define it here, so that it can be used in po/Makefile.
 
1919
  test -n "$localedir" || localedir='${datadir}/locale'
 
1920
  AC_SUBST([localedir])
 
1921
 
 
1922
  dnl Support for AM_XGETTEXT_OPTION.
 
1923
  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
 
1924
  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
 
1925
 
 
1926
  AC_CONFIG_COMMANDS([po-directories], [[
 
1927
    for ac_file in $CONFIG_FILES; do
 
1928
      # Support "outfile[:infile[:infile...]]"
 
1929
      case "$ac_file" in
 
1930
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
1931
      esac
 
1932
      # PO directories have a Makefile.in generated from Makefile.in.in.
 
1933
      case "$ac_file" in */Makefile.in)
 
1934
        # Adjust a relative srcdir.
 
1935
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
1936
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
1937
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
1938
        # In autoconf-2.13 it is called $ac_given_srcdir.
 
1939
        # In autoconf-2.50 it is called $srcdir.
 
1940
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
1941
        case "$ac_given_srcdir" in
 
1942
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
1943
          /*) top_srcdir="$ac_given_srcdir" ;;
 
1944
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
1945
        esac
 
1946
        # Treat a directory as a PO directory if and only if it has a
 
1947
        # POTFILES.in file. This allows packages to have multiple PO
 
1948
        # directories under different names or in different locations.
 
1949
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
1950
          rm -f "$ac_dir/POTFILES"
 
1951
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
1952
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
1953
          POMAKEFILEDEPS="POTFILES.in"
 
1954
          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
 
1955
          # on $ac_dir but don't depend on user-specified configuration
 
1956
          # parameters.
 
1957
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
1958
            # The LINGUAS file contains the set of available languages.
 
1959
            if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
1960
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
1961
            fi
 
1962
            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
1963
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
1964
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
1965
            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
1966
          else
 
1967
            # The set of available languages was given in configure.in.
 
1968
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
1969
            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
 
1970
          fi
 
1971
          # Compute POFILES
 
1972
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
1973
          # Compute UPDATEPOFILES
 
1974
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
1975
          # Compute DUMMYPOFILES
 
1976
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
1977
          # Compute GMOFILES
 
1978
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
1979
          case "$ac_given_srcdir" in
 
1980
            .) srcdirpre= ;;
 
1981
            *) srcdirpre='$(srcdir)/' ;;
 
1982
          esac
 
1983
          POFILES=
 
1984
          UPDATEPOFILES=
 
1985
          DUMMYPOFILES=
 
1986
          GMOFILES=
 
1987
          for lang in $ALL_LINGUAS; do
 
1988
            POFILES="$POFILES $srcdirpre$lang.po"
 
1989
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
1990
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
1991
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
1992
          done
 
1993
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
1994
          # environment variable.
 
1995
          INST_LINGUAS=
 
1996
          if test -n "$ALL_LINGUAS"; then
 
1997
            for presentlang in $ALL_LINGUAS; do
 
1998
              useit=no
 
1999
              if test "%UNSET%" != "$LINGUAS"; then
 
2000
                desiredlanguages="$LINGUAS"
 
2001
              else
 
2002
                desiredlanguages="$ALL_LINGUAS"
 
2003
              fi
 
2004
              for desiredlang in $desiredlanguages; do
 
2005
                # Use the presentlang catalog if desiredlang is
 
2006
                #   a. equal to presentlang, or
 
2007
                #   b. a variant of presentlang (because in this case,
 
2008
                #      presentlang can be used as a fallback for messages
 
2009
                #      which are not translated in the desiredlang catalog).
 
2010
                case "$desiredlang" in
 
2011
                  "$presentlang"*) useit=yes;;
 
2012
                esac
 
2013
              done
 
2014
              if test $useit = yes; then
 
2015
                INST_LINGUAS="$INST_LINGUAS $presentlang"
 
2016
              fi
 
2017
            done
 
2018
          fi
 
2019
          CATALOGS=
 
2020
          if test -n "$INST_LINGUAS"; then
 
2021
            for lang in $INST_LINGUAS; do
 
2022
              CATALOGS="$CATALOGS $lang.gmo"
 
2023
            done
 
2024
          fi
 
2025
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
2026
          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
 
2027
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
 
2028
            if test -f "$f"; then
 
2029
              case "$f" in
 
2030
                *.orig | *.bak | *~) ;;
 
2031
                *) cat "$f" >> "$ac_dir/Makefile" ;;
 
2032
              esac
 
2033
            fi
 
2034
          done
 
2035
        fi
 
2036
        ;;
 
2037
      esac
 
2038
    done]],
 
2039
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
 
2040
    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
 
2041
    # from automake < 1.5.
 
2042
    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
 
2043
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
 
2044
    LINGUAS="${LINGUAS-%UNSET%}"
 
2045
   ])
 
2046
])
 
2047
 
 
2048
dnl Postprocesses a Makefile in a directory containing PO files.
 
2049
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
 
2050
[
 
2051
  # When this code is run, in config.status, two variables have already been
 
2052
  # set:
 
2053
  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
 
2054
  # - LINGUAS is the value of the environment variable LINGUAS at configure
 
2055
  #   time.
 
2056
 
 
2057
changequote(,)dnl
 
2058
  # Adjust a relative srcdir.
 
2059
  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
2060
  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
2061
  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
2062
  # In autoconf-2.13 it is called $ac_given_srcdir.
 
2063
  # In autoconf-2.50 it is called $srcdir.
 
2064
  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
2065
  case "$ac_given_srcdir" in
 
2066
    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
2067
    /*) top_srcdir="$ac_given_srcdir" ;;
 
2068
    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
2069
  esac
 
2070
 
 
2071
  # Find a way to echo strings without interpreting backslash.
 
2072
  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
 
2073
    gt_echo='echo'
 
2074
  else
 
2075
    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
 
2076
      gt_echo='printf %s\n'
 
2077
    else
 
2078
      echo_func () {
 
2079
        cat <<EOT
 
2080
$*
 
2081
EOT
 
2082
      }
 
2083
      gt_echo='echo_func'
 
2084
    fi
 
2085
  fi
 
2086
 
 
2087
  # A sed script that extracts the value of VARIABLE from a Makefile.
 
2088
  sed_x_variable='
 
2089
# Test if the hold space is empty.
 
2090
x
 
2091
s/P/P/
 
2092
x
 
2093
ta
 
2094
# Yes it was empty. Look if we have the expected variable definition.
 
2095
/^[      ]*VARIABLE[     ]*=/{
 
2096
  # Seen the first line of the variable definition.
 
2097
  s/^[   ]*VARIABLE[     ]*=//
 
2098
  ba
 
2099
}
 
2100
bd
 
2101
:a
 
2102
# Here we are processing a line from the variable definition.
 
2103
# Remove comment, more precisely replace it with a space.
 
2104
s/#.*$/ /
 
2105
# See if the line ends in a backslash.
 
2106
tb
 
2107
:b
 
2108
s/\\$//
 
2109
# Print the line, without the trailing backslash.
 
2110
p
 
2111
tc
 
2112
# There was no trailing backslash. The end of the variable definition is
 
2113
# reached. Clear the hold space.
 
2114
s/^.*$//
 
2115
x
 
2116
bd
 
2117
:c
 
2118
# A trailing backslash means that the variable definition continues in the
 
2119
# next line. Put a nonempty string into the hold space to indicate this.
 
2120
s/^.*$/P/
 
2121
x
 
2122
:d
 
2123
'
 
2124
changequote([,])dnl
 
2125
 
 
2126
  # Set POTFILES to the value of the Makefile variable POTFILES.
 
2127
  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
 
2128
  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
 
2129
  # Compute POTFILES_DEPS as
 
2130
  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
2131
  POTFILES_DEPS=
 
2132
  for file in $POTFILES; do
 
2133
    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
 
2134
  done
 
2135
  POMAKEFILEDEPS=""
 
2136
 
 
2137
  if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
2138
    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
2139
  fi
 
2140
  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
2141
    # The LINGUAS file contains the set of available languages.
 
2142
    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
2143
    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
2144
  else
 
2145
    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
 
2146
    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
 
2147
    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
 
2148
  fi
 
2149
  # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
2150
  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
2151
  # Compute POFILES
 
2152
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
2153
  # Compute UPDATEPOFILES
 
2154
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
2155
  # Compute DUMMYPOFILES
 
2156
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
2157
  # Compute GMOFILES
 
2158
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
2159
  # Compute PROPERTIESFILES
 
2160
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
 
2161
  # Compute CLASSFILES
 
2162
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
 
2163
  # Compute QMFILES
 
2164
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
 
2165
  # Compute MSGFILES
 
2166
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
 
2167
  # Compute RESOURCESDLLFILES
 
2168
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
 
2169
  case "$ac_given_srcdir" in
 
2170
    .) srcdirpre= ;;
 
2171
    *) srcdirpre='$(srcdir)/' ;;
 
2172
  esac
 
2173
  POFILES=
 
2174
  UPDATEPOFILES=
 
2175
  DUMMYPOFILES=
 
2176
  GMOFILES=
 
2177
  PROPERTIESFILES=
 
2178
  CLASSFILES=
 
2179
  QMFILES=
 
2180
  MSGFILES=
 
2181
  RESOURCESDLLFILES=
 
2182
  for lang in $ALL_LINGUAS; do
 
2183
    POFILES="$POFILES $srcdirpre$lang.po"
 
2184
    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
2185
    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
2186
    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
2187
    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
 
2188
    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
 
2189
    QMFILES="$QMFILES $srcdirpre$lang.qm"
 
2190
    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2191
    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
 
2192
    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/'`
 
2193
    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
 
2194
  done
 
2195
  # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
2196
  # environment variable.
 
2197
  INST_LINGUAS=
 
2198
  if test -n "$ALL_LINGUAS"; then
 
2199
    for presentlang in $ALL_LINGUAS; do
 
2200
      useit=no
 
2201
      if test "%UNSET%" != "$LINGUAS"; then
 
2202
        desiredlanguages="$LINGUAS"
 
2203
      else
 
2204
        desiredlanguages="$ALL_LINGUAS"
 
2205
      fi
 
2206
      for desiredlang in $desiredlanguages; do
 
2207
        # Use the presentlang catalog if desiredlang is
 
2208
        #   a. equal to presentlang, or
 
2209
        #   b. a variant of presentlang (because in this case,
 
2210
        #      presentlang can be used as a fallback for messages
 
2211
        #      which are not translated in the desiredlang catalog).
 
2212
        case "$desiredlang" in
 
2213
          "$presentlang"*) useit=yes;;
 
2214
        esac
 
2215
      done
 
2216
      if test $useit = yes; then
 
2217
        INST_LINGUAS="$INST_LINGUAS $presentlang"
 
2218
      fi
 
2219
    done
 
2220
  fi
 
2221
  CATALOGS=
 
2222
  JAVACATALOGS=
 
2223
  QTCATALOGS=
 
2224
  TCLCATALOGS=
 
2225
  CSHARPCATALOGS=
 
2226
  if test -n "$INST_LINGUAS"; then
 
2227
    for lang in $INST_LINGUAS; do
 
2228
      CATALOGS="$CATALOGS $lang.gmo"
 
2229
      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
 
2230
      QTCATALOGS="$QTCATALOGS $lang.qm"
 
2231
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2232
      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
 
2233
      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/'`
 
2234
      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
 
2235
    done
 
2236
  fi
 
2237
 
 
2238
  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"
 
2239
  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
 
2240
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
2241
    for lang in $ALL_LINGUAS; do
 
2242
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2243
      cat >> "$ac_file.tmp" <<EOF
 
2244
$frobbedlang.msg: $lang.po
 
2245
        @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
 
2246
        \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
2247
EOF
 
2248
    done
 
2249
  fi
 
2250
  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
 
2251
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
2252
    for lang in $ALL_LINGUAS; do
 
2253
      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/'`
 
2254
      cat >> "$ac_file.tmp" <<EOF
 
2255
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
 
2256
        @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
 
2257
        \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
2258
EOF
 
2259
    done
 
2260
  fi
 
2261
  if test -n "$POMAKEFILEDEPS"; then
 
2262
    cat >> "$ac_file.tmp" <<EOF
 
2263
Makefile: $POMAKEFILEDEPS
 
2264
EOF
 
2265
  fi
 
2266
  mv "$ac_file.tmp" "$ac_file"
 
2267
])
 
2268
 
 
2269
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
 
2270
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
 
2271
[
 
2272
  XGETTEXT_EXTRA_OPTIONS=
 
2273
])
 
2274
 
 
2275
dnl Registers an option to be passed to xgettext in the po subdirectory.
 
2276
AC_DEFUN([AM_XGETTEXT_OPTION],
 
2277
[
 
2278
  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
 
2279
  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
 
2280
])
 
2281
 
 
2282
# progtest.m4 serial 4 (gettext-0.14.2)
 
2283
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
 
2284
dnl This file is free software; the Free Software Foundation
 
2285
dnl gives unlimited permission to copy and/or distribute it,
 
2286
dnl with or without modifications, as long as this notice is preserved.
 
2287
dnl
 
2288
dnl This file can can be used in projects which are not available under
 
2289
dnl the GNU General Public License or the GNU Library General Public
 
2290
dnl License but which still want to provide support for the GNU gettext
 
2291
dnl functionality.
 
2292
dnl Please note that the actual code of the GNU gettext library is covered
 
2293
dnl by the GNU Library General Public License, and the rest of the GNU
 
2294
dnl gettext package package is covered by the GNU General Public License.
 
2295
dnl They are *not* in the public domain.
 
2296
 
 
2297
dnl Authors:
 
2298
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
 
2299
 
 
2300
AC_PREREQ(2.50)
 
2301
 
 
2302
# Search path for a program which passes the given test.
 
2303
 
 
2304
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
2305
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
2306
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 
2307
[
 
2308
# Prepare PATH_SEPARATOR.
 
2309
# The user is always right.
 
2310
if test "${PATH_SEPARATOR+set}" != set; then
 
2311
  echo "#! /bin/sh" >conf$$.sh
 
2312
  echo  "exit 0"   >>conf$$.sh
 
2313
  chmod +x conf$$.sh
 
2314
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
2315
    PATH_SEPARATOR=';'
 
2316
  else
 
2317
    PATH_SEPARATOR=:
 
2318
  fi
 
2319
  rm -f conf$$.sh
 
2320
fi
 
2321
 
 
2322
# Find out how to test for executable files. Don't use a zero-byte file,
 
2323
# as systems may use methods other than mode bits to determine executability.
 
2324
cat >conf$$.file <<_ASEOF
 
2325
#! /bin/sh
 
2326
exit 0
 
2327
_ASEOF
 
2328
chmod +x conf$$.file
 
2329
if test -x conf$$.file >/dev/null 2>&1; then
 
2330
  ac_executable_p="test -x"
 
2331
else
 
2332
  ac_executable_p="test -f"
 
2333
fi
 
2334
rm -f conf$$.file
 
2335
 
 
2336
# Extract the first word of "$2", so it can be a program name with args.
 
2337
set dummy $2; ac_word=[$]2
 
2338
AC_MSG_CHECKING([for $ac_word])
 
2339
AC_CACHE_VAL(ac_cv_path_$1,
 
2340
[case "[$]$1" in
 
2341
  [[\\/]]* | ?:[[\\/]]*)
 
2342
    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
2343
    ;;
 
2344
  *)
 
2345
    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
 
2346
    for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
2347
      IFS="$ac_save_IFS"
 
2348
      test -z "$ac_dir" && ac_dir=.
 
2349
      for ac_exec_ext in '' $ac_executable_extensions; do
 
2350
        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
 
2351
          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
 
2352
          if [$3]; then
 
2353
            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
 
2354
            break 2
 
2355
          fi
 
2356
        fi
 
2357
      done
 
2358
    done
 
2359
    IFS="$ac_save_IFS"
 
2360
dnl If no 4th arg is given, leave the cache variable unset,
 
2361
dnl so AC_PATH_PROGS will keep looking.
 
2362
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
2363
])dnl
 
2364
    ;;
 
2365
esac])dnl
 
2366
$1="$ac_cv_path_$1"
 
2367
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
2368
  AC_MSG_RESULT([$]$1)
 
2369
else
 
2370
  AC_MSG_RESULT(no)
 
2371
fi
 
2372
AC_SUBST($1)dnl
 
2373
])
 
2374
 
172
2375
# Configure paths for SDL
173
2376
# Sam Lantinga 9/21/99
174
2377
# stolen from Manish Singh
191
2394
                    , enable_sdltest=yes)
192
2395
 
193
2396
  if test x$sdl_exec_prefix != x ; then
194
 
    sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
 
2397
    sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
195
2398
    if test x${SDL_CONFIG+set} != xset ; then
196
2399
      SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
197
2400
    fi
198
2401
  fi
199
2402
  if test x$sdl_prefix != x ; then
200
 
    sdl_args="$sdl_args --prefix=$sdl_prefix"
 
2403
    sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
201
2404
    if test x${SDL_CONFIG+set} != xset ; then
202
2405
      SDL_CONFIG=$sdl_prefix/bin/sdl-config
203
2406
    fi
213
2416
  if test "$SDL_CONFIG" = "no" ; then
214
2417
    no_sdl=yes
215
2418
  else
216
 
    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
217
 
    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
 
2419
    SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
 
2420
    SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
218
2421
 
219
 
    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
 
2422
    sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
220
2423
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
221
 
    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
 
2424
    sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
222
2425
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223
2426
    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
224
2427
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
351
2554
  rm -f conf.sdltest
352
2555
])
353
2556
 
354
 
# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
 
2557
# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
355
2558
#
356
2559
# This file is free software; the Free Software Foundation
357
2560
# gives unlimited permission to copy and/or distribute it,
361
2564
# ----------------------------
362
2565
# Automake X.Y traces this macro to ensure aclocal.m4 has been
363
2566
# generated from the m4 files accompanying Automake X.Y.
364
 
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
 
2567
# (This private macro should not be called outside this file.)
 
2568
AC_DEFUN([AM_AUTOMAKE_VERSION],
 
2569
[am__api_version='1.10'
 
2570
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 
2571
dnl require some minimum version.  Point them to the right macro.
 
2572
m4_if([$1], [1.10.1], [],
 
2573
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 
2574
])
 
2575
 
 
2576
# _AM_AUTOCONF_VERSION(VERSION)
 
2577
# -----------------------------
 
2578
# aclocal traces this macro to find the Autoconf version.
 
2579
# This is a private macro too.  Using m4_define simplifies
 
2580
# the logic in aclocal, which can simply ignore this definition.
 
2581
m4_define([_AM_AUTOCONF_VERSION], [])
365
2582
 
366
2583
# AM_SET_CURRENT_AUTOMAKE_VERSION
367
2584
# -------------------------------
368
 
# Call AM_AUTOMAKE_VERSION so it can be traced.
 
2585
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
369
2586
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
370
2587
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
371
 
         [AM_AUTOMAKE_VERSION([1.9.6])])
 
2588
[AM_AUTOMAKE_VERSION([1.10.1])dnl
 
2589
m4_ifndef([AC_AUTOCONF_VERSION],
 
2590
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 
2591
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
372
2592
 
373
2593
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
374
2594
 
425
2645
 
426
2646
# AM_CONDITIONAL                                            -*- Autoconf -*-
427
2647
 
428
 
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
 
2648
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
429
2649
# Free Software Foundation, Inc.
430
2650
#
431
2651
# This file is free software; the Free Software Foundation
432
2652
# gives unlimited permission to copy and/or distribute it,
433
2653
# with or without modifications, as long as this notice is preserved.
434
2654
 
435
 
# serial 7
 
2655
# serial 8
436
2656
 
437
2657
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
438
2658
# -------------------------------------
441
2661
[AC_PREREQ(2.52)dnl
442
2662
 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
443
2663
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
444
 
AC_SUBST([$1_TRUE])
445
 
AC_SUBST([$1_FALSE])
 
2664
AC_SUBST([$1_TRUE])dnl
 
2665
AC_SUBST([$1_FALSE])dnl
 
2666
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
 
2667
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
446
2668
if $2; then
447
2669
  $1_TRUE=
448
2670
  $1_FALSE='#'
456
2678
Usually this means the macro was only invoked conditionally.]])
457
2679
fi])])
458
2680
 
459
 
 
460
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
2681
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
461
2682
# Free Software Foundation, Inc.
462
2683
#
463
2684
# This file is free software; the Free Software Foundation
464
2685
# gives unlimited permission to copy and/or distribute it,
465
2686
# with or without modifications, as long as this notice is preserved.
466
2687
 
467
 
# serial 8
 
2688
# serial 9
468
2689
 
469
2690
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
470
2691
# written in clear, in which case automake, when reading aclocal.m4,
492
2713
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
493
2714
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
494
2715
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
 
2716
       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
495
2717
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
496
2718
                   [depcc="$$1"   am_compiler_list=])
497
2719
 
557
2779
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
558
2780
       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
559
2781
         >/dev/null 2>conftest.err &&
 
2782
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
560
2783
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
561
2784
       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
562
2785
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
609
2832
  AMDEPBACKSLASH='\'
610
2833
fi
611
2834
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
612
 
AC_SUBST([AMDEPBACKSLASH])
 
2835
AC_SUBST([AMDEPBACKSLASH])dnl
 
2836
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
613
2837
])
614
2838
 
615
2839
# Generate code to set up dependency tracking.              -*- Autoconf -*-
634
2858
  # some people rename them; so instead we look at the file content.
635
2859
  # Grep'ing the first line is not enough: some people post-process
636
2860
  # each Makefile.in and add a new line on top of each file to say so.
637
 
  # So let's grep whole file.
638
 
  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
 
2861
  # Grep'ing the whole file is not good either: AIX grep has a line
 
2862
  # limit of 2048, but all sed's we know have understand at least 4000.
 
2863
  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
639
2864
    dirpart=`AS_DIRNAME("$mf")`
640
2865
  else
641
2866
    continue
682
2907
 
683
2908
# Do all the work for Automake.                             -*- Autoconf -*-
684
2909
 
685
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
686
 
# Free Software Foundation, Inc.
 
2910
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 
2911
# 2005, 2006, 2008 Free Software Foundation, Inc.
687
2912
#
688
2913
# This file is free software; the Free Software Foundation
689
2914
# gives unlimited permission to copy and/or distribute it,
690
2915
# with or without modifications, as long as this notice is preserved.
691
2916
 
692
 
# serial 12
 
2917
# serial 13
693
2918
 
694
2919
# This macro actually does too much.  Some checks are only needed if
695
2920
# your package does certain things.  But this isn't really a big deal.
706
2931
# arguments mandatory, and then we can depend on a new Autoconf
707
2932
# release and drop the old call support.
708
2933
AC_DEFUN([AM_INIT_AUTOMAKE],
709
 
[AC_PREREQ([2.58])dnl
 
2934
[AC_PREREQ([2.60])dnl
710
2935
dnl Autoconf wants to disallow AM_ names.  We explicitly allow
711
2936
dnl the ones we care about.
712
2937
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
713
2938
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
714
2939
AC_REQUIRE([AC_PROG_INSTALL])dnl
715
 
# test to see if srcdir already configured
716
 
if test "`cd $srcdir && pwd`" != "`pwd`" &&
717
 
   test -f $srcdir/config.status; then
718
 
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
2940
if test "`cd $srcdir && pwd`" != "`pwd`"; then
 
2941
  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
 
2942
  # is not polluted with repeated "-I."
 
2943
  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
 
2944
  # test to see if srcdir already configured
 
2945
  if test -f $srcdir/config.status; then
 
2946
    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
2947
  fi
719
2948
fi
720
2949
 
721
2950
# test whether we have cygpath
735
2964
 AC_SUBST([PACKAGE], [$1])dnl
736
2965
 AC_SUBST([VERSION], [$2])],
737
2966
[_AM_SET_OPTIONS([$1])dnl
 
2967
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
 
2968
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
 
2969
  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
738
2970
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
739
2971
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
740
2972
 
770
3002
                  [_AM_DEPENDENCIES(CXX)],
771
3003
                  [define([AC_PROG_CXX],
772
3004
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
3005
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
 
3006
                  [_AM_DEPENDENCIES(OBJC)],
 
3007
                  [define([AC_PROG_OBJC],
 
3008
                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
773
3009
])
774
3010
])
775
3011
 
783
3019
# our stamp files there.
784
3020
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
785
3021
[# Compute $1's index in $config_headers.
 
3022
_am_arg=$1
786
3023
_am_stamp_count=1
787
3024
for _am_header in $config_headers :; do
788
3025
  case $_am_header in
789
 
    $1 | $1:* )
 
3026
    $_am_arg | $_am_arg:* )
790
3027
      break ;;
791
3028
    * )
792
3029
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
793
3030
  esac
794
3031
done
795
 
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
3032
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
796
3033
 
797
3034
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
798
3035
#
805
3042
# Define $install_sh.
806
3043
AC_DEFUN([AM_PROG_INSTALL_SH],
807
3044
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
808
 
install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
3045
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
809
3046
AC_SUBST(install_sh)])
810
3047
 
811
3048
# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
883
3120
 
884
3121
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
885
3122
 
886
 
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
 
3123
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
887
3124
# Free Software Foundation, Inc.
888
3125
#
889
3126
# This file is free software; the Free Software Foundation
890
3127
# gives unlimited permission to copy and/or distribute it,
891
3128
# with or without modifications, as long as this notice is preserved.
892
3129
 
893
 
# serial 4
 
3130
# serial 5
894
3131
 
895
3132
# AM_MISSING_PROG(NAME, PROGRAM)
896
3133
# ------------------------------
906
3143
# If it does, set am_missing_run to use it, otherwise, to nothing.
907
3144
AC_DEFUN([AM_MISSING_HAS_RUN],
908
3145
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
3146
AC_REQUIRE_AUX_FILE([missing])dnl
909
3147
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
910
3148
# Use eval to expand $SHELL
911
3149
if eval "$MISSING --run true"; then
916
3154
fi
917
3155
])
918
3156
 
919
 
# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
 
3157
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
920
3158
#
921
3159
# This file is free software; the Free Software Foundation
922
3160
# gives unlimited permission to copy and/or distribute it,
924
3162
 
925
3163
# AM_PROG_MKDIR_P
926
3164
# ---------------
927
 
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
928
 
#
929
 
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
930
 
# created by `make install' are always world readable, even if the
931
 
# installer happens to have an overly restrictive umask (e.g. 077).
932
 
# This was a mistake.  There are at least two reasons why we must not
933
 
# use `-m 0755':
934
 
#   - it causes special bits like SGID to be ignored,
935
 
#   - it may be too restrictive (some setups expect 775 directories).
936
 
#
937
 
# Do not use -m 0755 and let people choose whatever they expect by
938
 
# setting umask.
939
 
#
940
 
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
941
 
# Some implementations (such as Solaris 8's) are not thread-safe: if a
942
 
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
943
 
# concurrently, both version can detect that a/ is missing, but only
944
 
# one can create it and the other will error out.  Consequently we
945
 
# restrict ourselves to GNU make (using the --version option ensures
946
 
# this.)
 
3165
# Check for `mkdir -p'.
947
3166
AC_DEFUN([AM_PROG_MKDIR_P],
948
 
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
949
 
  # We used to keeping the `.' as first argument, in order to
950
 
  # allow $(mkdir_p) to be used without argument.  As in
951
 
  #   $(mkdir_p) $(somedir)
952
 
  # where $(somedir) is conditionally defined.  However this is wrong
953
 
  # for two reasons:
954
 
  #  1. if the package is installed by a user who cannot write `.'
955
 
  #     make install will fail,
956
 
  #  2. the above comment should most certainly read
957
 
  #     $(mkdir_p) $(DESTDIR)$(somedir)
958
 
  #     so it does not work when $(somedir) is undefined and
959
 
  #     $(DESTDIR) is not.
960
 
  #  To support the latter case, we have to write
961
 
  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
962
 
  #  so the `.' trick is pointless.
963
 
  mkdir_p='mkdir -p --'
964
 
else
965
 
  # On NextStep and OpenStep, the `mkdir' command does not
966
 
  # recognize any option.  It will interpret all options as
967
 
  # directories to create, and then abort because `.' already
968
 
  # exists.
969
 
  for d in ./-p ./--version;
970
 
  do
971
 
    test -d $d && rmdir $d
972
 
  done
973
 
  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
974
 
  if test -f "$ac_aux_dir/mkinstalldirs"; then
975
 
    mkdir_p='$(mkinstalldirs)'
976
 
  else
977
 
    mkdir_p='$(install_sh) -d'
978
 
  fi
979
 
fi
980
 
AC_SUBST([mkdir_p])])
 
3167
[AC_PREREQ([2.60])dnl
 
3168
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 
3169
dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
 
3170
dnl while keeping a definition of mkdir_p for backward compatibility.
 
3171
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
 
3172
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
 
3173
dnl Makefile.ins that do not define MKDIR_P, so we do our own
 
3174
dnl adjustment using top_builddir (which is defined more often than
 
3175
dnl MKDIR_P).
 
3176
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
 
3177
case $mkdir_p in
 
3178
  [[\\/$]]* | ?:[[\\/]]*) ;;
 
3179
  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
 
3180
esac
 
3181
])
981
3182
 
982
3183
# Helper functions for option handling.                     -*- Autoconf -*-
983
3184
 
1089
3290
if test "$cross_compiling" != no; then
1090
3291
  AC_CHECK_TOOL([STRIP], [strip], :)
1091
3292
fi
1092
 
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
3293
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1093
3294
AC_SUBST([INSTALL_STRIP_PROGRAM])])
1094
3295
 
 
3296
# Copyright (C) 2006  Free Software Foundation, Inc.
 
3297
#
 
3298
# This file is free software; the Free Software Foundation
 
3299
# gives unlimited permission to copy and/or distribute it,
 
3300
# with or without modifications, as long as this notice is preserved.
 
3301
 
 
3302
# _AM_SUBST_NOTMAKE(VARIABLE)
 
3303
# ---------------------------
 
3304
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 
3305
# This macro is traced by Automake.
 
3306
AC_DEFUN([_AM_SUBST_NOTMAKE])
 
3307
 
1095
3308
# Check how to create a tarball.                            -*- Autoconf -*-
1096
3309
 
1097
3310
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.