~darkmoon/+junk/darkstat-pkg

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayorga
  • Date: 2008-10-06 21:49:52 UTC
  • mfrom: (4.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081006214952-rkg8moyd6izn7q5y
Tags: 3.0.708-2
* fix workaround to --import/--export at init script
  this prevent darkstat.db being replaced. Closes: #500070
* remove debconf note about the init script inclussion
* remove checks for 2.5-1 versions
* debian/copyright
  + Add 2-clause BSD license for tree.h and host_sort.c
    and remove the note for /usr/share/common-licenses/BSD
  + add conv.c, actc.c err.c, err.h, str.c and str.h copyright stanza
* debian/init.d
  + Set Conf variables to empty string before sourcing init.cfg
* debian/postint
  + only remove DB when version is lt 3.0.707-1
* debian/templates remove upgrade-note
* debian/rules
  + made build-stamp depends on configure-stamp not configure
  + made install-stamp depends on build-stamp not build
  + use DESTDIR instead prefix at install-stamp target
* debian/README.Debian - point to the correct section on the 
  reference to the manpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.7.5 -*- Autoconf -*-
2
 
 
3
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4
 
# Free Software Foundation, Inc.
5
 
# This file is free software; the Free Software Foundation
6
 
# gives unlimited permission to copy and/or distribute it,
7
 
# with or without modifications, as long as this notice is preserved.
8
 
 
9
 
# This program is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
 
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
 
# PARTICULAR PURPOSE.
13
 
 
14
 
# Do all the work for Automake.                            -*- Autoconf -*-
15
 
 
16
 
# This macro actually does too much some checks are only needed if
17
 
# your package does certain things.  But this isn't really a big deal.
18
 
 
19
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20
 
# Free Software Foundation, Inc.
21
 
 
22
 
# This program is free software; you can redistribute it and/or modify
23
 
# it under the terms of the GNU General Public License as published by
24
 
# the Free Software Foundation; either version 2, or (at your option)
25
 
# any later version.
26
 
 
27
 
# This program is distributed in the hope that it will be useful,
28
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 
# GNU General Public License for more details.
31
 
 
32
 
# You should have received a copy of the GNU General Public License
33
 
# along with this program; if not, write to the Free Software
34
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35
 
# 02111-1307, USA.
36
 
 
37
 
# serial 10
38
 
 
39
 
AC_PREREQ([2.54])
40
 
 
41
 
# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
42
 
# the ones we care about.
43
 
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44
 
 
45
 
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46
 
# AM_INIT_AUTOMAKE([OPTIONS])
47
 
# -----------------------------------------------
48
 
# The call with PACKAGE and VERSION arguments is the old style
49
 
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
50
 
# and VERSION should now be passed to AC_INIT and removed from
51
 
# the call to AM_INIT_AUTOMAKE.
52
 
# We support both call styles for the transition.  After
53
 
# the next Automake release, Autoconf can make the AC_INIT
54
 
# arguments mandatory, and then we can depend on a new Autoconf
55
 
# release and drop the old call support.
56
 
AC_DEFUN([AM_INIT_AUTOMAKE],
57
 
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58
 
 AC_REQUIRE([AC_PROG_INSTALL])dnl
59
 
# test to see if srcdir already configured
60
 
if test "`cd $srcdir && pwd`" != "`pwd`" &&
61
 
   test -f $srcdir/config.status; then
62
 
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
63
 
fi
64
 
 
65
 
# test whether we have cygpath
66
 
if test -z "$CYGPATH_W"; then
67
 
  if (cygpath --version) >/dev/null 2>/dev/null; then
68
 
    CYGPATH_W='cygpath -w'
69
 
  else
70
 
    CYGPATH_W=echo
71
 
  fi
72
 
fi
73
 
AC_SUBST([CYGPATH_W])
74
 
 
75
 
# Define the identity of the package.
76
 
dnl Distinguish between old-style and new-style calls.
77
 
m4_ifval([$2],
78
 
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79
 
 AC_SUBST([PACKAGE], [$1])dnl
80
 
 AC_SUBST([VERSION], [$2])],
81
 
[_AM_SET_OPTIONS([$1])dnl
82
 
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83
 
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
84
 
 
85
 
_AM_IF_OPTION([no-define],,
86
 
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87
 
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
88
 
 
89
 
# Some tools Automake needs.
90
 
AC_REQUIRE([AM_SANITY_CHECK])dnl
91
 
AC_REQUIRE([AC_ARG_PROGRAM])dnl
92
 
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93
 
AM_MISSING_PROG(AUTOCONF, autoconf)
94
 
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95
 
AM_MISSING_PROG(AUTOHEADER, autoheader)
96
 
AM_MISSING_PROG(MAKEINFO, makeinfo)
97
 
AM_MISSING_PROG(AMTAR, tar)
98
 
AM_PROG_INSTALL_SH
99
 
AM_PROG_INSTALL_STRIP
100
 
# We need awk for the "check" target.  The system "awk" is bad on
101
 
# some platforms.
102
 
AC_REQUIRE([AC_PROG_AWK])dnl
103
 
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104
 
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
105
 
 
106
 
_AM_IF_OPTION([no-dependencies],,
107
 
[AC_PROVIDE_IFELSE([AC_PROG_CC],
108
 
                  [_AM_DEPENDENCIES(CC)],
109
 
                  [define([AC_PROG_CC],
110
 
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111
 
AC_PROVIDE_IFELSE([AC_PROG_CXX],
112
 
                  [_AM_DEPENDENCIES(CXX)],
113
 
                  [define([AC_PROG_CXX],
114
 
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
115
 
])
116
 
])
117
 
 
118
 
 
119
 
# When config.status generates a header, we must update the stamp-h file.
120
 
# This file resides in the same directory as the config header
121
 
# that is generated.  The stamp files are numbered to have different names.
122
 
 
123
 
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124
 
# loop where config.status creates the headers, so we can generate
125
 
# our stamp files there.
126
 
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127
 
[# Compute $1's index in $config_headers.
128
 
_am_stamp_count=1
129
 
for _am_header in $config_headers :; do
130
 
  case $_am_header in
131
 
    $1 | $1:* )
132
 
      break ;;
133
 
    * )
134
 
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
135
 
  esac
136
 
done
137
 
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
138
 
 
139
 
# Copyright 2002  Free Software Foundation, Inc.
140
 
 
141
 
# This program is free software; you can redistribute it and/or modify
142
 
# it under the terms of the GNU General Public License as published by
143
 
# the Free Software Foundation; either version 2, or (at your option)
144
 
# any later version.
145
 
 
146
 
# This program is distributed in the hope that it will be useful,
147
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
148
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
149
 
# GNU General Public License for more details.
150
 
 
151
 
# You should have received a copy of the GNU General Public License
152
 
# along with this program; if not, write to the Free Software
153
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
154
 
 
155
 
# AM_AUTOMAKE_VERSION(VERSION)
156
 
# ----------------------------
157
 
# Automake X.Y traces this macro to ensure aclocal.m4 has been
158
 
# generated from the m4 files accompanying Automake X.Y.
159
 
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
160
 
 
161
 
# AM_SET_CURRENT_AUTOMAKE_VERSION
162
 
# -------------------------------
163
 
# Call AM_AUTOMAKE_VERSION so it can be traced.
164
 
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165
 
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166
 
         [AM_AUTOMAKE_VERSION([1.7.5])])
167
 
 
168
 
# Helper functions for option handling.                    -*- Autoconf -*-
169
 
 
170
 
# Copyright 2001, 2002  Free Software Foundation, Inc.
171
 
 
172
 
# This program is free software; you can redistribute it and/or modify
173
 
# it under the terms of the GNU General Public License as published by
174
 
# the Free Software Foundation; either version 2, or (at your option)
175
 
# any later version.
176
 
 
177
 
# This program is distributed in the hope that it will be useful,
178
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
179
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
180
 
# GNU General Public License for more details.
181
 
 
182
 
# You should have received a copy of the GNU General Public License
183
 
# along with this program; if not, write to the Free Software
184
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
185
 
# 02111-1307, USA.
186
 
 
187
 
# serial 2
188
 
 
189
 
# _AM_MANGLE_OPTION(NAME)
190
 
# -----------------------
191
 
AC_DEFUN([_AM_MANGLE_OPTION],
192
 
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
193
 
 
194
 
# _AM_SET_OPTION(NAME)
195
 
# ------------------------------
196
 
# Set option NAME.  Presently that only means defining a flag for this option.
197
 
AC_DEFUN([_AM_SET_OPTION],
198
 
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
199
 
 
200
 
# _AM_SET_OPTIONS(OPTIONS)
201
 
# ----------------------------------
202
 
# OPTIONS is a space-separated list of Automake options.
203
 
AC_DEFUN([_AM_SET_OPTIONS],
204
 
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
205
 
 
206
 
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207
 
# -------------------------------------------
208
 
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209
 
AC_DEFUN([_AM_IF_OPTION],
210
 
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
211
 
 
212
 
#
213
 
# Check to make sure that the build environment is sane.
214
 
#
215
 
 
216
 
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
217
 
 
218
 
# This program is free software; you can redistribute it and/or modify
219
 
# it under the terms of the GNU General Public License as published by
220
 
# the Free Software Foundation; either version 2, or (at your option)
221
 
# any later version.
222
 
 
223
 
# This program is distributed in the hope that it will be useful,
224
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
225
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
226
 
# GNU General Public License for more details.
227
 
 
228
 
# You should have received a copy of the GNU General Public License
229
 
# along with this program; if not, write to the Free Software
230
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
231
 
# 02111-1307, USA.
232
 
 
233
 
# serial 3
234
 
 
235
 
# AM_SANITY_CHECK
236
 
# ---------------
237
 
AC_DEFUN([AM_SANITY_CHECK],
238
 
[AC_MSG_CHECKING([whether build environment is sane])
239
 
# Just in case
240
 
sleep 1
241
 
echo timestamp > conftest.file
242
 
# Do `set' in a subshell so we don't clobber the current shell's
243
 
# arguments.  Must try -L first in case configure is actually a
244
 
# symlink; some systems play weird games with the mod time of symlinks
245
 
# (eg FreeBSD returns the mod time of the symlink's containing
246
 
# directory).
247
 
if (
248
 
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249
 
   if test "$[*]" = "X"; then
250
 
      # -L didn't work.
251
 
      set X `ls -t $srcdir/configure conftest.file`
252
 
   fi
253
 
   rm -f conftest.file
254
 
   if test "$[*]" != "X $srcdir/configure conftest.file" \
255
 
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
256
 
 
257
 
      # If neither matched, then we have a broken ls.  This can happen
258
 
      # if, for instance, CONFIG_SHELL is bash and it inherits a
259
 
      # broken ls alias from the environment.  This has actually
260
 
      # happened.  Such a system could not be considered "sane".
261
 
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
262
 
alias in your environment])
263
 
   fi
264
 
 
265
 
   test "$[2]" = conftest.file
266
 
   )
267
 
then
268
 
   # Ok.
269
 
   :
270
 
else
271
 
   AC_MSG_ERROR([newly created file is older than distributed files!
272
 
Check your system clock])
273
 
fi
274
 
AC_MSG_RESULT(yes)])
275
 
 
276
 
#  -*- Autoconf -*-
277
 
 
278
 
 
279
 
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
280
 
 
281
 
# This program is free software; you can redistribute it and/or modify
282
 
# it under the terms of the GNU General Public License as published by
283
 
# the Free Software Foundation; either version 2, or (at your option)
284
 
# any later version.
285
 
 
286
 
# This program is distributed in the hope that it will be useful,
287
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
288
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
289
 
# GNU General Public License for more details.
290
 
 
291
 
# You should have received a copy of the GNU General Public License
292
 
# along with this program; if not, write to the Free Software
293
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
294
 
# 02111-1307, USA.
295
 
 
296
 
# serial 3
297
 
 
298
 
# AM_MISSING_PROG(NAME, PROGRAM)
299
 
# ------------------------------
300
 
AC_DEFUN([AM_MISSING_PROG],
301
 
[AC_REQUIRE([AM_MISSING_HAS_RUN])
302
 
$1=${$1-"${am_missing_run}$2"}
303
 
AC_SUBST($1)])
304
 
 
305
 
 
306
 
# AM_MISSING_HAS_RUN
307
 
# ------------------
308
 
# Define MISSING if not defined so far and test if it supports --run.
309
 
# If it does, set am_missing_run to use it, otherwise, to nothing.
310
 
AC_DEFUN([AM_MISSING_HAS_RUN],
311
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312
 
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313
 
# Use eval to expand $SHELL
314
 
if eval "$MISSING --run true"; then
315
 
  am_missing_run="$MISSING --run "
316
 
else
317
 
  am_missing_run=
318
 
  AC_MSG_WARN([`missing' script is too old or missing])
319
 
fi
320
 
])
321
 
 
322
 
# AM_AUX_DIR_EXPAND
323
 
 
324
 
# Copyright 2001 Free Software Foundation, Inc.
325
 
 
326
 
# This program is free software; you can redistribute it and/or modify
327
 
# it under the terms of the GNU General Public License as published by
328
 
# the Free Software Foundation; either version 2, or (at your option)
329
 
# any later version.
330
 
 
331
 
# This program is distributed in the hope that it will be useful,
332
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
333
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
334
 
# GNU General Public License for more details.
335
 
 
336
 
# You should have received a copy of the GNU General Public License
337
 
# along with this program; if not, write to the Free Software
338
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
339
 
# 02111-1307, USA.
340
 
 
341
 
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342
 
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
343
 
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
344
 
#
345
 
# Of course, Automake must honor this variable whenever it calls a
346
 
# tool from the auxiliary directory.  The problem is that $srcdir (and
347
 
# therefore $ac_aux_dir as well) can be either absolute or relative,
348
 
# depending on how configure is run.  This is pretty annoying, since
349
 
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
350
 
# source directory, any form will work fine, but in subdirectories a
351
 
# relative path needs to be adjusted first.
352
 
#
353
 
# $ac_aux_dir/missing
354
 
#    fails when called from a subdirectory if $ac_aux_dir is relative
355
 
# $top_srcdir/$ac_aux_dir/missing
356
 
#    fails if $ac_aux_dir is absolute,
357
 
#    fails when called from a subdirectory in a VPATH build with
358
 
#          a relative $ac_aux_dir
359
 
#
360
 
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361
 
# are both prefixed by $srcdir.  In an in-source build this is usually
362
 
# harmless because $srcdir is `.', but things will broke when you
363
 
# start a VPATH build or use an absolute $srcdir.
364
 
#
365
 
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366
 
# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
367
 
#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368
 
# and then we would define $MISSING as
369
 
#   MISSING="\${SHELL} $am_aux_dir/missing"
370
 
# This will work as long as MISSING is not called from configure, because
371
 
# unfortunately $(top_srcdir) has no meaning in configure.
372
 
# However there are other variables, like CC, which are often used in
373
 
# configure, and could therefore not use this "fixed" $ac_aux_dir.
374
 
#
375
 
# Another solution, used here, is to always expand $ac_aux_dir to an
376
 
# absolute PATH.  The drawback is that using absolute paths prevent a
377
 
# configured tree to be moved without reconfiguration.
378
 
 
379
 
# Rely on autoconf to set up CDPATH properly.
380
 
AC_PREREQ([2.50])
381
 
 
382
 
AC_DEFUN([AM_AUX_DIR_EXPAND], [
383
 
# expand $ac_aux_dir to an absolute path
384
 
am_aux_dir=`cd $ac_aux_dir && pwd`
385
 
])
386
 
 
387
 
# AM_PROG_INSTALL_SH
388
 
# ------------------
389
 
# Define $install_sh.
390
 
 
391
 
# Copyright 2001 Free Software Foundation, Inc.
392
 
 
393
 
# This program is free software; you can redistribute it and/or modify
394
 
# it under the terms of the GNU General Public License as published by
395
 
# the Free Software Foundation; either version 2, or (at your option)
396
 
# any later version.
397
 
 
398
 
# This program is distributed in the hope that it will be useful,
399
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
400
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
401
 
# GNU General Public License for more details.
402
 
 
403
 
# You should have received a copy of the GNU General Public License
404
 
# along with this program; if not, write to the Free Software
405
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
406
 
# 02111-1307, USA.
407
 
 
408
 
AC_DEFUN([AM_PROG_INSTALL_SH],
409
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410
 
install_sh=${install_sh-"$am_aux_dir/install-sh"}
411
 
AC_SUBST(install_sh)])
412
 
 
413
 
# AM_PROG_INSTALL_STRIP
414
 
 
415
 
# Copyright 2001 Free Software Foundation, Inc.
416
 
 
417
 
# This program is free software; you can redistribute it and/or modify
418
 
# it under the terms of the GNU General Public License as published by
419
 
# the Free Software Foundation; either version 2, or (at your option)
420
 
# any later version.
421
 
 
422
 
# This program is distributed in the hope that it will be useful,
423
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
424
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
425
 
# GNU General Public License for more details.
426
 
 
427
 
# You should have received a copy of the GNU General Public License
428
 
# along with this program; if not, write to the Free Software
429
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
430
 
# 02111-1307, USA.
431
 
 
432
 
# One issue with vendor `install' (even GNU) is that you can't
433
 
# specify the program used to strip binaries.  This is especially
434
 
# annoying in cross-compiling environments, where the build's strip
435
 
# is unlikely to handle the host's binaries.
436
 
# Fortunately install-sh will honor a STRIPPROG variable, so we
437
 
# always use install-sh in `make install-strip', and initialize
438
 
# STRIPPROG with the value of the STRIP variable (set by the user).
439
 
AC_DEFUN([AM_PROG_INSTALL_STRIP],
440
 
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441
 
# Installed binaries are usually stripped using `strip' when the user
442
 
# run `make install-strip'.  However `strip' might not be the right
443
 
# tool to use in cross-compilation environments, therefore Automake
444
 
# will honor the `STRIP' environment variable to overrule this program.
445
 
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446
 
if test "$cross_compiling" != no; then
447
 
  AC_CHECK_TOOL([STRIP], [strip], :)
448
 
fi
449
 
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450
 
AC_SUBST([INSTALL_STRIP_PROGRAM])])
451
 
 
452
 
#                                                          -*- Autoconf -*-
453
 
# Copyright (C) 2003  Free Software Foundation, Inc.
454
 
 
455
 
# This program is free software; you can redistribute it and/or modify
456
 
# it under the terms of the GNU General Public License as published by
457
 
# the Free Software Foundation; either version 2, or (at your option)
458
 
# any later version.
459
 
 
460
 
# This program is distributed in the hope that it will be useful,
461
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
462
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463
 
# GNU General Public License for more details.
464
 
 
465
 
# You should have received a copy of the GNU General Public License
466
 
# along with this program; if not, write to the Free Software
467
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
468
 
# 02111-1307, USA.
469
 
 
470
 
# serial 1
471
 
 
472
 
# Check whether the underlying file-system supports filenames
473
 
# with a leading dot.  For instance MS-DOS doesn't.
474
 
AC_DEFUN([AM_SET_LEADING_DOT],
475
 
[rm -rf .tst 2>/dev/null
476
 
mkdir .tst 2>/dev/null
477
 
if test -d .tst; then
478
 
  am__leading_dot=.
479
 
else
480
 
  am__leading_dot=_
481
 
fi
482
 
rmdir .tst 2>/dev/null
483
 
AC_SUBST([am__leading_dot])])
484
 
 
485
 
# serial 5                                              -*- Autoconf -*-
486
 
 
487
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
488
 
 
489
 
# This program is free software; you can redistribute it and/or modify
490
 
# it under the terms of the GNU General Public License as published by
491
 
# the Free Software Foundation; either version 2, or (at your option)
492
 
# any later version.
493
 
 
494
 
# This program is distributed in the hope that it will be useful,
495
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
496
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
497
 
# GNU General Public License for more details.
498
 
 
499
 
# You should have received a copy of the GNU General Public License
500
 
# along with this program; if not, write to the Free Software
501
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
502
 
# 02111-1307, USA.
503
 
 
504
 
 
505
 
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506
 
# written in clear, in which case automake, when reading aclocal.m4,
507
 
# will think it sees a *use*, and therefore will trigger all it's
508
 
# C support machinery.  Also note that it means that autoscan, seeing
509
 
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
510
 
 
511
 
 
512
 
 
513
 
# _AM_DEPENDENCIES(NAME)
514
 
# ----------------------
515
 
# See how the compiler implements dependency checking.
516
 
# NAME is "CC", "CXX", "GCJ", or "OBJC".
517
 
# We try a few techniques and use that to set a single cache variable.
518
 
#
519
 
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520
 
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521
 
# dependency, and given that the user is not expected to run this macro,
522
 
# just rely on AC_PROG_CC.
523
 
AC_DEFUN([_AM_DEPENDENCIES],
524
 
[AC_REQUIRE([AM_SET_DEPDIR])dnl
525
 
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526
 
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527
 
AC_REQUIRE([AM_DEP_TRACK])dnl
528
 
 
529
 
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
530
 
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
531
 
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532
 
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
533
 
                   [depcc="$$1"   am_compiler_list=])
534
 
 
535
 
AC_CACHE_CHECK([dependency style of $depcc],
536
 
               [am_cv_$1_dependencies_compiler_type],
537
 
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538
 
  # We make a subdir and do the tests there.  Otherwise we can end up
539
 
  # making bogus files that we don't know about and never remove.  For
540
 
  # instance it was reported that on HP-UX the gcc test will end up
541
 
  # making a dummy file named `D' -- because `-MD' means `put the output
542
 
  # in D'.
543
 
  mkdir conftest.dir
544
 
  # Copy depcomp to subdir because otherwise we won't find it if we're
545
 
  # using a relative directory.
546
 
  cp "$am_depcomp" conftest.dir
547
 
  cd conftest.dir
548
 
 
549
 
  am_cv_$1_dependencies_compiler_type=none
550
 
  if test "$am_compiler_list" = ""; then
551
 
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
552
 
  fi
553
 
  for depmode in $am_compiler_list; do
554
 
    # We need to recreate these files for each test, as the compiler may
555
 
    # overwrite some of them when testing with obscure command lines.
556
 
    # This happens at least with the AIX C compiler.
557
 
    echo '#include "conftest.h"' > conftest.c
558
 
    echo 'int i;' > conftest.h
559
 
    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
560
 
 
561
 
    case $depmode in
562
 
    nosideeffect)
563
 
      # after this tag, mechanisms are not by side-effect, so they'll
564
 
      # only be used when explicitly requested
565
 
      if test "x$enable_dependency_tracking" = xyes; then
566
 
        continue
567
 
      else
568
 
        break
569
 
      fi
570
 
      ;;
571
 
    none) break ;;
572
 
    esac
573
 
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
574
 
    # mode.  It turns out that the SunPro C++ compiler does not properly
575
 
    # handle `-M -o', and we need to detect this.
576
 
    if depmode=$depmode \
577
 
       source=conftest.c object=conftest.o \
578
 
       depfile=conftest.Po tmpdepfile=conftest.TPo \
579
 
       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
580
 
         >/dev/null 2>conftest.err &&
581
 
       grep conftest.h conftest.Po > /dev/null 2>&1 &&
582
 
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
583
 
      # icc doesn't choke on unknown options, it will just issue warnings
584
 
      # (even with -Werror).  So we grep stderr for any message
585
 
      # that says an option was ignored.
586
 
      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
587
 
        am_cv_$1_dependencies_compiler_type=$depmode
588
 
        break
589
 
      fi
590
 
    fi
591
 
  done
592
 
 
593
 
  cd ..
594
 
  rm -rf conftest.dir
595
 
else
596
 
  am_cv_$1_dependencies_compiler_type=none
597
 
fi
598
 
])
599
 
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
600
 
AM_CONDITIONAL([am__fastdep$1], [
601
 
  test "x$enable_dependency_tracking" != xno \
602
 
  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
603
 
])
604
 
 
605
 
 
606
 
# AM_SET_DEPDIR
607
 
# -------------
608
 
# Choose a directory name for dependency files.
609
 
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
610
 
AC_DEFUN([AM_SET_DEPDIR],
611
 
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
612
 
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
613
 
])
614
 
 
615
 
 
616
 
# AM_DEP_TRACK
617
 
# ------------
618
 
AC_DEFUN([AM_DEP_TRACK],
619
 
[AC_ARG_ENABLE(dependency-tracking,
620
 
[  --disable-dependency-tracking Speeds up one-time builds
621
 
  --enable-dependency-tracking  Do not reject slow dependency extractors])
622
 
if test "x$enable_dependency_tracking" != xno; then
623
 
  am_depcomp="$ac_aux_dir/depcomp"
624
 
  AMDEPBACKSLASH='\'
625
 
fi
626
 
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
627
 
AC_SUBST([AMDEPBACKSLASH])
628
 
])
629
 
 
630
 
# Generate code to set up dependency tracking.   -*- Autoconf -*-
631
 
 
632
 
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
633
 
 
634
 
# This program is free software; you can redistribute it and/or modify
635
 
# it under the terms of the GNU General Public License as published by
636
 
# the Free Software Foundation; either version 2, or (at your option)
637
 
# any later version.
638
 
 
639
 
# This program is distributed in the hope that it will be useful,
640
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
641
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
642
 
# GNU General Public License for more details.
643
 
 
644
 
# You should have received a copy of the GNU General Public License
645
 
# along with this program; if not, write to the Free Software
646
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
647
 
# 02111-1307, USA.
648
 
 
649
 
#serial 2
650
 
 
651
 
# _AM_OUTPUT_DEPENDENCY_COMMANDS
652
 
# ------------------------------
653
 
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
654
 
[for mf in $CONFIG_FILES; do
655
 
  # Strip MF so we end up with the name of the file.
656
 
  mf=`echo "$mf" | sed -e 's/:.*$//'`
657
 
  # Check whether this is an Automake generated Makefile or not.
658
 
  # We used to match only the files named `Makefile.in', but
659
 
  # some people rename them; so instead we look at the file content.
660
 
  # Grep'ing the first line is not enough: some people post-process
661
 
  # each Makefile.in and add a new line on top of each file to say so.
662
 
  # So let's grep whole file.
663
 
  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
664
 
    dirpart=`AS_DIRNAME("$mf")`
665
 
  else
666
 
    continue
667
 
  fi
668
 
  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
669
 
  # Extract the definition of DEP_FILES from the Makefile without
670
 
  # running `make'.
671
 
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
672
 
  test -z "$DEPDIR" && continue
673
 
  # When using ansi2knr, U may be empty or an underscore; expand it
674
 
  U=`sed -n -e '/^U = / s///p' < "$mf"`
675
 
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
676
 
  # We invoke sed twice because it is the simplest approach to
677
 
  # changing $(DEPDIR) to its actual value in the expansion.
678
 
  for file in `sed -n -e '
679
 
    /^DEP_FILES = .*\\\\$/ {
680
 
      s/^DEP_FILES = //
681
 
      :loop
682
 
        s/\\\\$//
683
 
        p
684
 
        n
685
 
        /\\\\$/ b loop
686
 
      p
687
 
    }
688
 
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
689
 
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
690
 
    # Make sure the directory exists.
691
 
    test -f "$dirpart/$file" && continue
692
 
    fdir=`AS_DIRNAME(["$file"])`
693
 
    AS_MKDIR_P([$dirpart/$fdir])
694
 
    # echo "creating $dirpart/$file"
695
 
    echo '# dummy' > "$dirpart/$file"
696
 
  done
697
 
done
698
 
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
699
 
 
700
 
 
701
 
# AM_OUTPUT_DEPENDENCY_COMMANDS
702
 
# -----------------------------
703
 
# This macro should only be invoked once -- use via AC_REQUIRE.
704
 
#
705
 
# This code is only required when automatic dependency tracking
706
 
# is enabled.  FIXME.  This creates each `.P' file that we will
707
 
# need in order to bootstrap the dependency handling code.
708
 
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
709
 
[AC_CONFIG_COMMANDS([depfiles],
710
 
     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
711
 
     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
712
 
])
713
 
 
714
 
# Check to see how 'make' treats includes.      -*- Autoconf -*-
715
 
 
716
 
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
717
 
 
718
 
# This program is free software; you can redistribute it and/or modify
719
 
# it under the terms of the GNU General Public License as published by
720
 
# the Free Software Foundation; either version 2, or (at your option)
721
 
# any later version.
722
 
 
723
 
# This program is distributed in the hope that it will be useful,
724
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
725
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
726
 
# GNU General Public License for more details.
727
 
 
728
 
# You should have received a copy of the GNU General Public License
729
 
# along with this program; if not, write to the Free Software
730
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
731
 
# 02111-1307, USA.
732
 
 
733
 
# serial 2
734
 
 
735
 
# AM_MAKE_INCLUDE()
736
 
# -----------------
737
 
# Check to see how make treats includes.
738
 
AC_DEFUN([AM_MAKE_INCLUDE],
739
 
[am_make=${MAKE-make}
740
 
cat > confinc << 'END'
741
 
am__doit:
742
 
        @echo done
743
 
.PHONY: am__doit
744
 
END
745
 
# If we don't find an include directive, just comment out the code.
746
 
AC_MSG_CHECKING([for style of include used by $am_make])
747
 
am__include="#"
748
 
am__quote=
749
 
_am_result=none
750
 
# First try GNU make style include.
751
 
echo "include confinc" > confmf
752
 
# We grep out `Entering directory' and `Leaving directory'
753
 
# messages which can occur if `w' ends up in MAKEFLAGS.
754
 
# In particular we don't look at `^make:' because GNU make might
755
 
# be invoked under some other name (usually "gmake"), in which
756
 
# case it prints its new name instead of `make'.
757
 
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
758
 
   am__include=include
759
 
   am__quote=
760
 
   _am_result=GNU
761
 
fi
762
 
# Now try BSD make style include.
763
 
if test "$am__include" = "#"; then
764
 
   echo '.include "confinc"' > confmf
765
 
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
766
 
      am__include=.include
767
 
      am__quote="\""
768
 
      _am_result=BSD
769
 
   fi
770
 
fi
771
 
AC_SUBST([am__include])
772
 
AC_SUBST([am__quote])
773
 
AC_MSG_RESULT([$_am_result])
774
 
rm -f confinc confmf
775
 
])
776
 
 
777
 
# AM_CONDITIONAL                                              -*- Autoconf -*-
778
 
 
779
 
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
780
 
 
781
 
# This program is free software; you can redistribute it and/or modify
782
 
# it under the terms of the GNU General Public License as published by
783
 
# the Free Software Foundation; either version 2, or (at your option)
784
 
# any later version.
785
 
 
786
 
# This program is distributed in the hope that it will be useful,
787
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
788
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
789
 
# GNU General Public License for more details.
790
 
 
791
 
# You should have received a copy of the GNU General Public License
792
 
# along with this program; if not, write to the Free Software
793
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
794
 
# 02111-1307, USA.
795
 
 
796
 
# serial 5
797
 
 
798
 
AC_PREREQ(2.52)
799
 
 
800
 
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
801
 
# -------------------------------------
802
 
# Define a conditional.
803
 
AC_DEFUN([AM_CONDITIONAL],
804
 
[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
805
 
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
806
 
AC_SUBST([$1_TRUE])
807
 
AC_SUBST([$1_FALSE])
808
 
if $2; then
809
 
  $1_TRUE=
810
 
  $1_FALSE='#'
811
 
else
812
 
  $1_TRUE='#'
813
 
  $1_FALSE=
814
 
fi
815
 
AC_CONFIG_COMMANDS_PRE(
816
 
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
817
 
  AC_MSG_ERROR([conditional "$1" was never defined.
818
 
Usually this means the macro was only invoked conditionally.])
819
 
fi])])
820
 
 
821
 
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
822
 
 
823
 
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
824
 
 
825
 
# This program is free software; you can redistribute it and/or modify
826
 
# it under the terms of the GNU General Public License as published by
827
 
# the Free Software Foundation; either version 2, or (at your option)
828
 
# any later version.
829
 
 
830
 
# This program is distributed in the hope that it will be useful,
831
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
832
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
833
 
# GNU General Public License for more details.
834
 
 
835
 
# You should have received a copy of the GNU General Public License
836
 
# along with this program; if not, write to the Free Software
837
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
838
 
# 02111-1307, USA.
839
 
 
840
 
AC_PREREQ([2.52])
841
 
 
842
 
# serial 6
843
 
 
844
 
# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
845
 
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
846
 
 
847
 
dnl Available from the GNU Autoconf Macro Archive at:
848
 
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
849
 
dnl
850
 
AC_DEFUN([ACX_PTHREAD], [
851
 
AC_REQUIRE([AC_CANONICAL_HOST])
852
 
AC_LANG_SAVE
853
 
AC_LANG_C
854
 
acx_pthread_ok=no
855
 
 
856
 
# We used to check for pthread.h first, but this fails if pthread.h
857
 
# requires special compiler flags (e.g. on True64 or Sequent).
858
 
# It gets checked for in the link test anyway.
859
 
 
860
 
# First of all, check if the user has set any of the PTHREAD_LIBS,
861
 
# etcetera environment variables, and if threads linking works using
862
 
# them:
863
 
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
864
 
        save_CFLAGS="$CFLAGS"
865
 
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
866
 
        save_LIBS="$LIBS"
867
 
        LIBS="$PTHREAD_LIBS $LIBS"
868
 
        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
869
 
        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
870
 
        AC_MSG_RESULT($acx_pthread_ok)
871
 
        if test x"$acx_pthread_ok" = xno; then
872
 
                PTHREAD_LIBS=""
873
 
                PTHREAD_CFLAGS=""
874
 
        fi
875
 
        LIBS="$save_LIBS"
876
 
        CFLAGS="$save_CFLAGS"
877
 
fi
878
 
 
879
 
# We must check for the threads library under a number of different
880
 
# names; the ordering is very important because some systems
881
 
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
882
 
# libraries is broken (non-POSIX).
883
 
 
884
 
# Create a list of thread flags to try.  Items starting with a "-" are
885
 
# C compiler flags, and other items are library names, except for "none"
886
 
# which indicates that we try without any flags at all.
887
 
 
888
 
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
889
 
 
890
 
# The ordering *is* (sometimes) important.  Some notes on the
891
 
# individual items follow:
892
 
 
893
 
# pthreads: AIX (must check this before -lpthread)
894
 
# none: in case threads are in libc; should be tried before -Kthread and
895
 
#       other compiler flags to prevent continual compiler warnings
896
 
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
897
 
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
898
 
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
899
 
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
900
 
# -pthreads: Solaris/gcc
901
 
# -mthreads: Mingw32/gcc, Lynx/gcc
902
 
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
903
 
#      doesn't hurt to check since this sometimes defines pthreads too;
904
 
#      also defines -D_REENTRANT)
905
 
# pthread: Linux, etcetera
906
 
# --thread-safe: KAI C++
907
 
 
908
 
case "${host_cpu}-${host_os}" in
909
 
        *solaris*)
910
 
 
911
 
        # On Solaris (at least, for some versions), libc contains stubbed
912
 
        # (non-functional) versions of the pthreads routines, so link-based
913
 
        # tests will erroneously succeed.  (We need to link with -pthread or
914
 
        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
915
 
        # a function called by this macro, so we could check for that, but
916
 
        # who knows whether they'll stub that too in a future libc.)  So,
917
 
        # we'll just look for -pthreads and -lpthread first:
918
 
 
919
 
        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
920
 
        ;;
921
 
esac
922
 
 
923
 
if test x"$acx_pthread_ok" = xno; then
924
 
for flag in $acx_pthread_flags; do
925
 
 
926
 
        case $flag in
927
 
                none)
928
 
                AC_MSG_CHECKING([whether pthreads work without any flags])
929
 
                ;;
930
 
 
931
 
                -*)
932
 
                AC_MSG_CHECKING([whether pthreads work with $flag])
933
 
                PTHREAD_CFLAGS="$flag"
934
 
                ;;
935
 
 
936
 
                *)
937
 
                AC_MSG_CHECKING([for the pthreads library -l$flag])
938
 
                PTHREAD_LIBS="-l$flag"
939
 
                ;;
940
 
        esac
941
 
 
942
 
        save_LIBS="$LIBS"
943
 
        save_CFLAGS="$CFLAGS"
944
 
        LIBS="$PTHREAD_LIBS $LIBS"
945
 
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
946
 
 
947
 
        # Check for various functions.  We must include pthread.h,
948
 
        # since some functions may be macros.  (On the Sequent, we
949
 
        # need a special flag -Kthread to make this header compile.)
950
 
        # We check for pthread_join because it is in -lpthread on IRIX
951
 
        # while pthread_create is in libc.  We check for pthread_attr_init
952
 
        # due to DEC craziness with -lpthreads.  We check for
953
 
        # pthread_cleanup_push because it is one of the few pthread
954
 
        # functions on Solaris that doesn't have a non-functional libc stub.
955
 
        # We try pthread_create on general principles.
956
 
        AC_TRY_LINK([#include <pthread.h>],
957
 
                    [pthread_t th; pthread_join(th, 0);
958
 
                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
959
 
                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
960
 
                    [acx_pthread_ok=yes])
961
 
 
962
 
        LIBS="$save_LIBS"
963
 
        CFLAGS="$save_CFLAGS"
964
 
 
965
 
        AC_MSG_RESULT($acx_pthread_ok)
966
 
        if test "x$acx_pthread_ok" = xyes; then
967
 
                break;
968
 
        fi
969
 
 
970
 
        PTHREAD_LIBS=""
971
 
        PTHREAD_CFLAGS=""
972
 
done
973
 
fi
974
 
 
975
 
# Various other checks:
976
 
if test "x$acx_pthread_ok" = xyes; then
977
 
        save_LIBS="$LIBS"
978
 
        LIBS="$PTHREAD_LIBS $LIBS"
979
 
        save_CFLAGS="$CFLAGS"
980
 
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
981
 
 
982
 
        # Detect AIX lossage: threads are created detached by default
983
 
        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
984
 
        AC_MSG_CHECKING([for joinable pthread attribute])
985
 
        AC_TRY_LINK([#include <pthread.h>],
986
 
                    [int attr=PTHREAD_CREATE_JOINABLE;],
987
 
                    ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
988
 
        if test x"$ok" = xunknown; then
989
 
                AC_TRY_LINK([#include <pthread.h>],
990
 
                            [int attr=PTHREAD_CREATE_UNDETACHED;],
991
 
                            ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
992
 
        fi
993
 
        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
994
 
                AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
995
 
                          [Define to the necessary symbol if this constant
996
 
                           uses a non-standard name on your system.])
997
 
        fi
998
 
        AC_MSG_RESULT(${ok})
999
 
        if test x"$ok" = xunknown; then
1000
 
                AC_MSG_WARN([we do not know how to create joinable pthreads])
1001
 
        fi
1002
 
 
1003
 
        AC_MSG_CHECKING([if more special flags are required for pthreads])
1004
 
        flag=no
1005
 
        case "${host_cpu}-${host_os}" in
1006
 
                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
1007
 
                *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
1008
 
        esac
1009
 
        AC_MSG_RESULT(${flag})
1010
 
        if test "x$flag" != xno; then
1011
 
                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
1012
 
        fi
1013
 
 
1014
 
        LIBS="$save_LIBS"
1015
 
        CFLAGS="$save_CFLAGS"
1016
 
 
1017
 
        # More AIX lossage: must compile with cc_r
1018
 
        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
1019
 
else
1020
 
        PTHREAD_CC="$CC"
1021
 
fi
1022
 
 
1023
 
AC_SUBST(PTHREAD_LIBS)
1024
 
AC_SUBST(PTHREAD_CFLAGS)
1025
 
AC_SUBST(PTHREAD_CC)
1026
 
 
1027
 
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
1028
 
if test x"$acx_pthread_ok" = xyes; then
1029
 
        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
1030
 
        :
1031
 
else
1032
 
        acx_pthread_ok=no
1033
 
        $2
1034
 
fi
1035
 
AC_LANG_RESTORE
1036
 
])dnl ACX_PTHREAD
1037
 
 
1038
 
# gettext.m4 serial 17 (gettext-0.11.5)
1039
 
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1040
 
dnl This file is free software, distributed under the terms of the GNU
1041
 
dnl General Public License.  As a special exception to the GNU General
1042
 
dnl Public License, this file may be distributed as part of a program
1043
 
dnl that contains a configuration script generated by Autoconf, under
1044
 
dnl the same distribution terms as the rest of that program.
1045
 
dnl
1046
 
dnl This file can can be used in projects which are not available under
1047
 
dnl the GNU General Public License or the GNU Library General Public
1048
 
dnl License but which still want to provide support for the GNU gettext
1049
 
dnl functionality.
1050
 
dnl Please note that the actual code of the GNU gettext library is covered
1051
 
dnl by the GNU Library General Public License, and the rest of the GNU
1052
 
dnl gettext package package is covered by the GNU General Public License.
1053
 
dnl They are *not* in the public domain.
1054
 
 
1055
 
dnl Authors:
1056
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1057
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1058
 
 
1059
 
dnl Macro to add for using GNU gettext.
1060
 
 
1061
 
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1062
 
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1063
 
dnl    default (if it is not specified or empty) is 'no-libtool'.
1064
 
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
1065
 
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1066
 
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
1067
 
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1068
 
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
1069
 
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1070
 
dnl    $(top_builddir)/intl/libintl.a will be created.
1071
 
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1072
 
dnl    implementations (in libc or libintl) without the ngettext() function
1073
 
dnl    will be ignored.  If NEEDSYMBOL is specified and is
1074
 
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
1075
 
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1076
 
dnl INTLDIR is used to find the intl libraries.  If empty,
1077
 
dnl    the value `$(top_builddir)/intl/' is used.
1078
 
dnl
1079
 
dnl The result of the configuration is one of three cases:
1080
 
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1081
 
dnl    and used.
1082
 
dnl    Catalog format: GNU --> install in $(datadir)
1083
 
dnl    Catalog extension: .mo after installation, .gmo in source tree
1084
 
dnl 2) GNU gettext has been found in the system's C library.
1085
 
dnl    Catalog format: GNU --> install in $(datadir)
1086
 
dnl    Catalog extension: .mo after installation, .gmo in source tree
1087
 
dnl 3) No internationalization, always use English msgid.
1088
 
dnl    Catalog format: none
1089
 
dnl    Catalog extension: none
1090
 
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1091
 
dnl The use of .gmo is historical (it was needed to avoid overwriting the
1092
 
dnl GNU format catalogs when building on a platform with an X/Open gettext),
1093
 
dnl but we keep it in order not to force irrelevant filename changes on the
1094
 
dnl maintainers.
1095
 
dnl
1096
 
AC_DEFUN([AM_GNU_GETTEXT],
1097
 
[
1098
 
  dnl Argument checking.
1099
 
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1100
 
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1101
 
])])])])])
1102
 
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1103
 
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1104
 
])])])])
1105
 
  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1106
 
  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1107
 
 
1108
 
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
1109
 
  ifelse(gt_included_intl, yes, [
1110
 
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
1111
 
  ])
1112
 
 
1113
 
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1114
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1115
 
  AC_REQUIRE([AC_LIB_RPATH])
1116
 
 
1117
 
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
1118
 
  dnl Ideally we would do this search only after the
1119
 
  dnl      if test "$USE_NLS" = "yes"; then
1120
 
  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1121
 
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1122
 
  dnl the configure script would need to contain the same shell code
1123
 
  dnl again, outside any 'if'. There are two solutions:
1124
 
  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1125
 
  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1126
 
  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1127
 
  dnl documented, we avoid it.
1128
 
  ifelse(gt_included_intl, yes, , [
1129
 
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1130
 
  ])
1131
 
 
1132
 
  AC_MSG_CHECKING([whether NLS is requested])
1133
 
  dnl Default is enabled NLS
1134
 
  AC_ARG_ENABLE(nls,
1135
 
    [  --disable-nls           do not use Native Language Support],
1136
 
    USE_NLS=$enableval, USE_NLS=yes)
1137
 
  AC_MSG_RESULT($USE_NLS)
1138
 
  AC_SUBST(USE_NLS)
1139
 
 
1140
 
  ifelse(gt_included_intl, yes, [
1141
 
    BUILD_INCLUDED_LIBINTL=no
1142
 
    USE_INCLUDED_LIBINTL=no
1143
 
  ])
1144
 
  LIBINTL=
1145
 
  LTLIBINTL=
1146
 
  POSUB=
1147
 
 
1148
 
  dnl If we use NLS figure out what method
1149
 
  if test "$USE_NLS" = "yes"; then
1150
 
    gt_use_preinstalled_gnugettext=no
1151
 
    ifelse(gt_included_intl, yes, [
1152
 
      AC_MSG_CHECKING([whether included gettext is requested])
1153
 
      AC_ARG_WITH(included-gettext,
1154
 
        [  --with-included-gettext use the GNU gettext library included here],
1155
 
        nls_cv_force_use_gnu_gettext=$withval,
1156
 
        nls_cv_force_use_gnu_gettext=no)
1157
 
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1158
 
 
1159
 
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1160
 
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1161
 
    ])
1162
 
        dnl User does not insist on using GNU NLS library.  Figure out what
1163
 
        dnl to use.  If GNU gettext is available we use this.  Else we have
1164
 
        dnl to fall back to GNU NLS library.
1165
 
 
1166
 
        dnl Add a version number to the cache macros.
1167
 
        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1168
 
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1169
 
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1170
 
 
1171
 
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1172
 
         [AC_TRY_LINK([#include <libintl.h>
1173
 
]ifelse([$2], [need-formatstring-macros],
1174
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1175
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1176
 
#endif
1177
 
changequote(,)dnl
1178
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1179
 
changequote([,])dnl
1180
 
], [])[extern int _nl_msg_cat_cntr;
1181
 
extern int *_nl_domain_bindings;],
1182
 
            [bindtextdomain ("", "");
1183
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1184
 
            gt_cv_func_gnugettext_libc=yes,
1185
 
            gt_cv_func_gnugettext_libc=no)])
1186
 
 
1187
 
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1188
 
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
1189
 
          ifelse(gt_included_intl, yes, , [
1190
 
            AM_ICONV_LINK
1191
 
          ])
1192
 
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1193
 
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1194
 
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1195
 
          dnl even if libiconv doesn't exist.
1196
 
          AC_LIB_LINKFLAGS_BODY([intl])
1197
 
          AC_CACHE_CHECK([for GNU gettext in libintl],
1198
 
            gt_cv_func_gnugettext_libintl,
1199
 
           [gt_save_CPPFLAGS="$CPPFLAGS"
1200
 
            CPPFLAGS="$CPPFLAGS $INCINTL"
1201
 
            gt_save_LIBS="$LIBS"
1202
 
            LIBS="$LIBS $LIBINTL"
1203
 
            dnl Now see whether libintl exists and does not depend on libiconv.
1204
 
            AC_TRY_LINK([#include <libintl.h>
1205
 
]ifelse([$2], [need-formatstring-macros],
1206
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1207
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1208
 
#endif
1209
 
changequote(,)dnl
1210
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1211
 
changequote([,])dnl
1212
 
], [])[extern int _nl_msg_cat_cntr;
1213
 
extern
1214
 
#ifdef __cplusplus
1215
 
"C"
1216
 
#endif
1217
 
const char *_nl_expand_alias ();],
1218
 
              [bindtextdomain ("", "");
1219
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1220
 
              gt_cv_func_gnugettext_libintl=yes,
1221
 
              gt_cv_func_gnugettext_libintl=no)
1222
 
            dnl Now see whether libintl exists and depends on libiconv.
1223
 
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1224
 
              LIBS="$LIBS $LIBICONV"
1225
 
              AC_TRY_LINK([#include <libintl.h>
1226
 
]ifelse([$2], [need-formatstring-macros],
1227
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1228
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1229
 
#endif
1230
 
changequote(,)dnl
1231
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1232
 
changequote([,])dnl
1233
 
], [])[extern int _nl_msg_cat_cntr;
1234
 
extern
1235
 
#ifdef __cplusplus
1236
 
"C"
1237
 
#endif
1238
 
const char *_nl_expand_alias ();],
1239
 
                [bindtextdomain ("", "");
1240
 
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1241
 
               [LIBINTL="$LIBINTL $LIBICONV"
1242
 
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1243
 
                gt_cv_func_gnugettext_libintl=yes
1244
 
               ])
1245
 
            fi
1246
 
            CPPFLAGS="$gt_save_CPPFLAGS"
1247
 
            LIBS="$gt_save_LIBS"])
1248
 
        fi
1249
 
 
1250
 
        dnl If an already present or preinstalled GNU gettext() is found,
1251
 
        dnl use it.  But if this macro is used in GNU gettext, and GNU
1252
 
        dnl gettext is already preinstalled in libintl, we update this
1253
 
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1254
 
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
1255
 
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1256
 
                && test "$PACKAGE" != gettext; }; then
1257
 
          gt_use_preinstalled_gnugettext=yes
1258
 
        else
1259
 
          dnl Reset the values set by searching for libintl.
1260
 
          LIBINTL=
1261
 
          LTLIBINTL=
1262
 
          INCINTL=
1263
 
        fi
1264
 
 
1265
 
    ifelse(gt_included_intl, yes, [
1266
 
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1267
 
          dnl GNU gettext is not found in the C library.
1268
 
          dnl Fall back on included GNU gettext library.
1269
 
          nls_cv_use_gnu_gettext=yes
1270
 
        fi
1271
 
      fi
1272
 
 
1273
 
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
1274
 
        dnl Mark actions used to generate GNU NLS library.
1275
 
        INTLOBJS="\$(GETTOBJS)"
1276
 
        BUILD_INCLUDED_LIBINTL=yes
1277
 
        USE_INCLUDED_LIBINTL=yes
1278
 
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1279
 
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1280
 
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1281
 
      fi
1282
 
 
1283
 
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
1284
 
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
1285
 
        dnl Mark actions to use GNU gettext tools.
1286
 
        CATOBJEXT=.gmo
1287
 
      fi
1288
 
    ])
1289
 
 
1290
 
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
1291
 
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
1292
 
      AC_DEFINE(ENABLE_NLS, 1,
1293
 
        [Define to 1 if translation of program messages to the user's native language
1294
 
   is requested.])
1295
 
    else
1296
 
      USE_NLS=no
1297
 
    fi
1298
 
  fi
1299
 
 
1300
 
  if test "$USE_NLS" = "yes"; then
1301
 
 
1302
 
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1303
 
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1304
 
        AC_MSG_CHECKING([how to link with libintl])
1305
 
        AC_MSG_RESULT([$LIBINTL])
1306
 
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1307
 
      fi
1308
 
 
1309
 
      dnl For backward compatibility. Some packages may be using this.
1310
 
      AC_DEFINE(HAVE_GETTEXT, 1,
1311
 
       [Define if the GNU gettext() function is already present or preinstalled.])
1312
 
      AC_DEFINE(HAVE_DCGETTEXT, 1,
1313
 
       [Define if the GNU dcgettext() function is already present or preinstalled.])
1314
 
    fi
1315
 
 
1316
 
    dnl We need to process the po/ directory.
1317
 
    POSUB=po
1318
 
  fi
1319
 
 
1320
 
  ifelse(gt_included_intl, yes, [
1321
 
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1322
 
    dnl to 'yes' because some of the testsuite requires it.
1323
 
    if test "$PACKAGE" = gettext; then
1324
 
      BUILD_INCLUDED_LIBINTL=yes
1325
 
    fi
1326
 
 
1327
 
    dnl Make all variables we use known to autoconf.
1328
 
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
1329
 
    AC_SUBST(USE_INCLUDED_LIBINTL)
1330
 
    AC_SUBST(CATOBJEXT)
1331
 
    AC_SUBST(INTLOBJS)
1332
 
 
1333
 
    dnl For backward compatibility. Some configure.ins may be using this.
1334
 
    nls_cv_header_intl=
1335
 
    nls_cv_header_libgt=
1336
 
 
1337
 
    dnl For backward compatibility. Some Makefiles may be using this.
1338
 
    DATADIRNAME=share
1339
 
    AC_SUBST(DATADIRNAME)
1340
 
 
1341
 
    dnl For backward compatibility. Some Makefiles may be using this.
1342
 
    INSTOBJEXT=.mo
1343
 
    AC_SUBST(INSTOBJEXT)
1344
 
 
1345
 
    dnl For backward compatibility. Some Makefiles may be using this.
1346
 
    GENCAT=gencat
1347
 
    AC_SUBST(GENCAT)
1348
 
 
1349
 
    dnl Enable libtool support if the surrounding package wishes it.
1350
 
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1351
 
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1352
 
  ])
1353
 
 
1354
 
  dnl For backward compatibility. Some Makefiles may be using this.
1355
 
  INTLLIBS="$LIBINTL"
1356
 
  AC_SUBST(INTLLIBS)
1357
 
 
1358
 
  dnl Make all documented variables known to autoconf.
1359
 
  AC_SUBST(LIBINTL)
1360
 
  AC_SUBST(LTLIBINTL)
1361
 
  AC_SUBST(POSUB)
1362
 
])
1363
 
 
1364
 
 
1365
 
dnl Checks for all prerequisites of the po subdirectory,
1366
 
dnl except for USE_NLS.
1367
 
AC_DEFUN([AM_PO_SUBDIRS],
1368
 
[
1369
 
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1370
 
  AC_REQUIRE([AC_PROG_INSTALL])dnl
1371
 
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1372
 
 
1373
 
  dnl Perform the following tests also if --disable-nls has been given,
1374
 
  dnl because they are needed for "make dist" to work.
1375
 
 
1376
 
  dnl Search for GNU msgfmt in the PATH.
1377
 
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1378
 
  dnl The second test excludes FreeBSD msgfmt.
1379
 
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1380
 
    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1381
 
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1382
 
    :)
1383
 
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1384
 
 
1385
 
  dnl Search for GNU xgettext 0.11 or newer in the PATH.
1386
 
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1387
 
  dnl The second test excludes FreeBSD xgettext.
1388
 
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1389
 
    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1390
 
     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1391
 
    :)
1392
 
  dnl Remove leftover from FreeBSD xgettext call.
1393
 
  rm -f messages.po
1394
 
 
1395
 
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1396
 
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1397
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1398
 
 
1399
 
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1400
 
  dnl Test whether we really found GNU msgfmt.
1401
 
  if test "$GMSGFMT" != ":"; then
1402
 
    dnl If it is no GNU msgfmt we define it as : so that the
1403
 
    dnl Makefiles still can work.
1404
 
    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1405
 
       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1406
 
      : ;
1407
 
    else
1408
 
      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1409
 
      AC_MSG_RESULT(
1410
 
        [found $GMSGFMT program is not GNU msgfmt; ignore it])
1411
 
      GMSGFMT=":"
1412
 
    fi
1413
 
  fi
1414
 
 
1415
 
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1416
 
  dnl Test whether we really found GNU xgettext.
1417
 
  if test "$XGETTEXT" != ":"; then
1418
 
    dnl If it is no GNU xgettext we define it as : so that the
1419
 
    dnl Makefiles still can work.
1420
 
    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1421
 
       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1422
 
      : ;
1423
 
    else
1424
 
      AC_MSG_RESULT(
1425
 
        [found xgettext program is not GNU xgettext; ignore it])
1426
 
      XGETTEXT=":"
1427
 
    fi
1428
 
    dnl Remove leftover from FreeBSD xgettext call.
1429
 
    rm -f messages.po
1430
 
  fi
1431
 
 
1432
 
  AC_OUTPUT_COMMANDS([
1433
 
    for ac_file in $CONFIG_FILES; do
1434
 
      # Support "outfile[:infile[:infile...]]"
1435
 
      case "$ac_file" in
1436
 
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1437
 
      esac
1438
 
      # PO directories have a Makefile.in generated from Makefile.in.in.
1439
 
      case "$ac_file" in */Makefile.in)
1440
 
        # Adjust a relative srcdir.
1441
 
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1442
 
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1443
 
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1444
 
        # In autoconf-2.13 it is called $ac_given_srcdir.
1445
 
        # In autoconf-2.50 it is called $srcdir.
1446
 
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1447
 
        case "$ac_given_srcdir" in
1448
 
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1449
 
          /*) top_srcdir="$ac_given_srcdir" ;;
1450
 
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1451
 
        esac
1452
 
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1453
 
          rm -f "$ac_dir/POTFILES"
1454
 
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1455
 
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1456
 
          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1457
 
          # on $ac_dir but don't depend on user-specified configuration
1458
 
          # parameters.
1459
 
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1460
 
            # The LINGUAS file contains the set of available languages.
1461
 
            if test -n "$ALL_LINGUAS"; then
1462
 
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1463
 
            fi
1464
 
            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1465
 
            # Hide the ALL_LINGUAS assigment from automake.
1466
 
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1467
 
          fi
1468
 
          case "$ac_given_srcdir" in
1469
 
            .) srcdirpre= ;;
1470
 
            *) srcdirpre='$(srcdir)/' ;;
1471
 
          esac
1472
 
          POFILES=
1473
 
          GMOFILES=
1474
 
          UPDATEPOFILES=
1475
 
          DUMMYPOFILES=
1476
 
          for lang in $ALL_LINGUAS; do
1477
 
            POFILES="$POFILES $srcdirpre$lang.po"
1478
 
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1479
 
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1480
 
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1481
 
          done
1482
 
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
1483
 
          # environment variable.
1484
 
          INST_LINGUAS=
1485
 
          if test -n "$ALL_LINGUAS"; then
1486
 
            for presentlang in $ALL_LINGUAS; do
1487
 
              useit=no
1488
 
              if test "%UNSET%" != "$LINGUAS"; then
1489
 
                desiredlanguages="$LINGUAS"
1490
 
              else
1491
 
                desiredlanguages="$ALL_LINGUAS"
1492
 
              fi
1493
 
              for desiredlang in $desiredlanguages; do
1494
 
                # Use the presentlang catalog if desiredlang is
1495
 
                #   a. equal to presentlang, or
1496
 
                #   b. a variant of presentlang (because in this case,
1497
 
                #      presentlang can be used as a fallback for messages
1498
 
                #      which are not translated in the desiredlang catalog).
1499
 
                case "$desiredlang" in
1500
 
                  "$presentlang"*) useit=yes;;
1501
 
                esac
1502
 
              done
1503
 
              if test $useit = yes; then
1504
 
                INST_LINGUAS="$INST_LINGUAS $presentlang"
1505
 
              fi
1506
 
            done
1507
 
          fi
1508
 
          CATALOGS=
1509
 
          if test -n "$INST_LINGUAS"; then
1510
 
            for lang in $INST_LINGUAS; do
1511
 
              CATALOGS="$CATALOGS $lang.gmo"
1512
 
            done
1513
 
          fi
1514
 
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1515
 
          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1516
 
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1517
 
            if test -f "$f"; then
1518
 
              case "$f" in
1519
 
                *.orig | *.bak | *~) ;;
1520
 
                *) cat "$f" >> "$ac_dir/Makefile" ;;
1521
 
              esac
1522
 
            fi
1523
 
          done
1524
 
        fi
1525
 
        ;;
1526
 
      esac
1527
 
    done],
1528
 
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1529
 
    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1530
 
    # from automake.
1531
 
    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1532
 
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
1533
 
    LINGUAS="${LINGUAS-%UNSET%}"
1534
 
   ])
1535
 
])
1536
 
 
1537
 
 
1538
 
dnl Checks for all prerequisites of the intl subdirectory,
1539
 
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1540
 
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1541
 
AC_DEFUN([AM_INTL_SUBDIR],
1542
 
[
1543
 
  AC_REQUIRE([AC_PROG_INSTALL])dnl
1544
 
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1545
 
  AC_REQUIRE([AC_PROG_CC])dnl
1546
 
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
1547
 
  AC_REQUIRE([AC_PROG_RANLIB])dnl
1548
 
  AC_REQUIRE([AC_ISC_POSIX])dnl
1549
 
  AC_REQUIRE([AC_HEADER_STDC])dnl
1550
 
  AC_REQUIRE([AC_C_CONST])dnl
1551
 
  AC_REQUIRE([AC_C_INLINE])dnl
1552
 
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
1553
 
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1554
 
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1555
 
  AC_REQUIRE([AC_FUNC_MMAP])dnl
1556
 
  AC_REQUIRE([jm_GLIBC21])dnl
1557
 
  AC_REQUIRE([gt_INTDIV0])dnl
1558
 
  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1559
 
  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1560
 
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
1561
 
 
1562
 
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1563
 
stdlib.h string.h unistd.h sys/param.h])
1564
 
  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1565
 
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1566
 
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1567
 
 
1568
 
  AM_ICONV
1569
 
  AM_LANGINFO_CODESET
1570
 
  if test $ac_cv_header_locale_h = yes; then
1571
 
    AM_LC_MESSAGES
1572
 
  fi
1573
 
 
1574
 
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1575
 
  dnl because plural.y uses bison specific features. It requires at least
1576
 
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1577
 
  dnl compile.
1578
 
  dnl bison is only needed for the maintainer (who touches plural.y). But in
1579
 
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1580
 
  dnl the rule in general Makefile. Now, some people carelessly touch the
1581
 
  dnl files or have a broken "make" program, hence the plural.c rule will
1582
 
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1583
 
  dnl present or too old.
1584
 
  AC_CHECK_PROGS([INTLBISON], [bison])
1585
 
  if test -z "$INTLBISON"; then
1586
 
    ac_verc_fail=yes
1587
 
  else
1588
 
    dnl Found it, now check the version.
1589
 
    AC_MSG_CHECKING([version of bison])
1590
 
changequote(<<,>>)dnl
1591
 
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1592
 
    case $ac_prog_version in
1593
 
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1594
 
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1595
 
changequote([,])dnl
1596
 
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1597
 
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1598
 
    esac
1599
 
    AC_MSG_RESULT([$ac_prog_version])
1600
 
  fi
1601
 
  if test $ac_verc_fail = yes; then
1602
 
    INTLBISON=:
1603
 
  fi
1604
 
])
1605
 
 
1606
 
 
1607
 
AC_DEFUN([AM_MKINSTALLDIRS],
1608
 
[
1609
 
  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1610
 
  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1611
 
  dnl Try to locate is.
1612
 
  MKINSTALLDIRS=
1613
 
  if test -n "$ac_aux_dir"; then
1614
 
    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1615
 
  fi
1616
 
  if test -z "$MKINSTALLDIRS"; then
1617
 
    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1618
 
  fi
1619
 
  AC_SUBST(MKINSTALLDIRS)
1620
 
])
1621
 
 
1622
 
 
1623
 
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1624
 
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1625
 
 
1626
 
# lib-prefix.m4 serial 1 (gettext-0.11)
1627
 
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1628
 
dnl This file is free software, distributed under the terms of the GNU
1629
 
dnl General Public License.  As a special exception to the GNU General
1630
 
dnl Public License, this file may be distributed as part of a program
1631
 
dnl that contains a configuration script generated by Autoconf, under
1632
 
dnl the same distribution terms as the rest of that program.
1633
 
 
1634
 
dnl From Bruno Haible.
1635
 
 
1636
 
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1637
 
dnl to access previously installed libraries. The basic assumption is that
1638
 
dnl a user will want packages to use other packages he previously installed
1639
 
dnl with the same --prefix option.
1640
 
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1641
 
dnl libraries, but is otherwise very convenient.
1642
 
AC_DEFUN([AC_LIB_PREFIX],
1643
 
[
1644
 
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1645
 
  AC_REQUIRE([AC_PROG_CC])
1646
 
  AC_REQUIRE([AC_CANONICAL_HOST])
1647
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1648
 
  dnl By default, look in $includedir and $libdir.
1649
 
  use_additional=yes
1650
 
  AC_LIB_WITH_FINAL_PREFIX([
1651
 
    eval additional_includedir=\"$includedir\"
1652
 
    eval additional_libdir=\"$libdir\"
1653
 
  ])
1654
 
  AC_ARG_WITH([lib-prefix],
1655
 
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1656
 
  --without-lib-prefix    don't search for libraries in includedir and libdir],
1657
 
[
1658
 
    if test "X$withval" = "Xno"; then
1659
 
      use_additional=no
1660
 
    else
1661
 
      if test "X$withval" = "X"; then
1662
 
        AC_LIB_WITH_FINAL_PREFIX([
1663
 
          eval additional_includedir=\"$includedir\"
1664
 
          eval additional_libdir=\"$libdir\"
1665
 
        ])
1666
 
      else
1667
 
        additional_includedir="$withval/include"
1668
 
        additional_libdir="$withval/lib"
1669
 
      fi
1670
 
    fi
1671
 
])
1672
 
  if test $use_additional = yes; then
1673
 
    dnl Potentially add $additional_includedir to $CPPFLAGS.
1674
 
    dnl But don't add it
1675
 
    dnl   1. if it's the standard /usr/include,
1676
 
    dnl   2. if it's already present in $CPPFLAGS,
1677
 
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1678
 
    dnl   4. if it doesn't exist as a directory.
1679
 
    if test "X$additional_includedir" != "X/usr/include"; then
1680
 
      haveit=
1681
 
      for x in $CPPFLAGS; do
1682
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1683
 
        if test "X$x" = "X-I$additional_includedir"; then
1684
 
          haveit=yes
1685
 
          break
1686
 
        fi
1687
 
      done
1688
 
      if test -z "$haveit"; then
1689
 
        if test "X$additional_includedir" = "X/usr/local/include"; then
1690
 
          if test -n "$GCC"; then
1691
 
            case $host_os in
1692
 
              linux*) haveit=yes;;
1693
 
            esac
1694
 
          fi
1695
 
        fi
1696
 
        if test -z "$haveit"; then
1697
 
          if test -d "$additional_includedir"; then
1698
 
            dnl Really add $additional_includedir to $CPPFLAGS.
1699
 
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1700
 
          fi
1701
 
        fi
1702
 
      fi
1703
 
    fi
1704
 
    dnl Potentially add $additional_libdir to $LDFLAGS.
1705
 
    dnl But don't add it
1706
 
    dnl   1. if it's the standard /usr/lib,
1707
 
    dnl   2. if it's already present in $LDFLAGS,
1708
 
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1709
 
    dnl   4. if it doesn't exist as a directory.
1710
 
    if test "X$additional_libdir" != "X/usr/lib"; then
1711
 
      haveit=
1712
 
      for x in $LDFLAGS; do
1713
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1714
 
        if test "X$x" = "X-L$additional_libdir"; then
1715
 
          haveit=yes
1716
 
          break
1717
 
        fi
1718
 
      done
1719
 
      if test -z "$haveit"; then
1720
 
        if test "X$additional_libdir" = "X/usr/local/lib"; then
1721
 
          if test -n "$GCC"; then
1722
 
            case $host_os in
1723
 
              linux*) haveit=yes;;
1724
 
            esac
1725
 
          fi
1726
 
        fi
1727
 
        if test -z "$haveit"; then
1728
 
          if test -d "$additional_libdir"; then
1729
 
            dnl Really add $additional_libdir to $LDFLAGS.
1730
 
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1731
 
          fi
1732
 
        fi
1733
 
      fi
1734
 
    fi
1735
 
  fi
1736
 
])
1737
 
 
1738
 
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1739
 
dnl acl_final_exec_prefix, containing the values to which $prefix and
1740
 
dnl $exec_prefix will expand at the end of the configure script.
1741
 
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1742
 
[
1743
 
  dnl Unfortunately, prefix and exec_prefix get only finally determined
1744
 
  dnl at the end of configure.
1745
 
  if test "X$prefix" = "XNONE"; then
1746
 
    acl_final_prefix="$ac_default_prefix"
1747
 
  else
1748
 
    acl_final_prefix="$prefix"
1749
 
  fi
1750
 
  if test "X$exec_prefix" = "XNONE"; then
1751
 
    acl_final_exec_prefix='${prefix}'
1752
 
  else
1753
 
    acl_final_exec_prefix="$exec_prefix"
1754
 
  fi
1755
 
  acl_save_prefix="$prefix"
1756
 
  prefix="$acl_final_prefix"
1757
 
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1758
 
  prefix="$acl_save_prefix"
1759
 
])
1760
 
 
1761
 
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1762
 
dnl variables prefix and exec_prefix bound to the values they will have
1763
 
dnl at the end of the configure script.
1764
 
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1765
 
[
1766
 
  acl_save_prefix="$prefix"
1767
 
  prefix="$acl_final_prefix"
1768
 
  acl_save_exec_prefix="$exec_prefix"
1769
 
  exec_prefix="$acl_final_exec_prefix"
1770
 
  $1
1771
 
  exec_prefix="$acl_save_exec_prefix"
1772
 
  prefix="$acl_save_prefix"
1773
 
])
1774
 
 
1775
 
# lib-link.m4 serial 3 (gettext-0.11.3)
1776
 
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1777
 
dnl This file is free software, distributed under the terms of the GNU
1778
 
dnl General Public License.  As a special exception to the GNU General
1779
 
dnl Public License, this file may be distributed as part of a program
1780
 
dnl that contains a configuration script generated by Autoconf, under
1781
 
dnl the same distribution terms as the rest of that program.
1782
 
 
1783
 
dnl From Bruno Haible.
1784
 
 
1785
 
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1786
 
dnl the libraries corresponding to explicit and implicit dependencies.
1787
 
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1788
 
dnl augments the CPPFLAGS variable.
1789
 
AC_DEFUN([AC_LIB_LINKFLAGS],
1790
 
[
1791
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1792
 
  AC_REQUIRE([AC_LIB_RPATH])
1793
 
  define([Name],[translit([$1],[./-], [___])])
1794
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1795
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1796
 
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1797
 
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1798
 
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1799
 
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1800
 
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1801
 
  ])
1802
 
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1803
 
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1804
 
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1805
 
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1806
 
  AC_SUBST([LIB]NAME)
1807
 
  AC_SUBST([LTLIB]NAME)
1808
 
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1809
 
  dnl results of this search when this library appears as a dependency.
1810
 
  HAVE_LIB[]NAME=yes
1811
 
  undefine([Name])
1812
 
  undefine([NAME])
1813
 
])
1814
 
 
1815
 
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1816
 
dnl searches for libname and the libraries corresponding to explicit and
1817
 
dnl implicit dependencies, together with the specified include files and
1818
 
dnl the ability to compile and link the specified testcode. If found, it
1819
 
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1820
 
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1821
 
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1822
 
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1823
 
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1824
 
[
1825
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1826
 
  AC_REQUIRE([AC_LIB_RPATH])
1827
 
  define([Name],[translit([$1],[./-], [___])])
1828
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1829
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1830
 
 
1831
 
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1832
 
  dnl accordingly.
1833
 
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
1834
 
 
1835
 
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1836
 
  dnl because if the user has installed lib[]Name and not disabled its use
1837
 
  dnl via --without-lib[]Name-prefix, he wants to use it.
1838
 
  ac_save_CPPFLAGS="$CPPFLAGS"
1839
 
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1840
 
 
1841
 
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1842
 
    ac_save_LIBS="$LIBS"
1843
 
    LIBS="$LIBS $LIB[]NAME"
1844
 
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1845
 
    LIBS="$ac_save_LIBS"
1846
 
  ])
1847
 
  if test "$ac_cv_lib[]Name" = yes; then
1848
 
    HAVE_LIB[]NAME=yes
1849
 
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1850
 
    AC_MSG_CHECKING([how to link with lib[]$1])
1851
 
    AC_MSG_RESULT([$LIB[]NAME])
1852
 
  else
1853
 
    HAVE_LIB[]NAME=no
1854
 
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1855
 
    dnl $INC[]NAME either.
1856
 
    CPPFLAGS="$ac_save_CPPFLAGS"
1857
 
    LIB[]NAME=
1858
 
    LTLIB[]NAME=
1859
 
  fi
1860
 
  AC_SUBST([HAVE_LIB]NAME)
1861
 
  AC_SUBST([LIB]NAME)
1862
 
  AC_SUBST([LTLIB]NAME)
1863
 
  undefine([Name])
1864
 
  undefine([NAME])
1865
 
])
1866
 
 
1867
 
dnl Determine the platform dependent parameters needed to use rpath:
1868
 
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1869
 
dnl hardcode_direct, hardcode_minus_L,
1870
 
dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1871
 
AC_DEFUN([AC_LIB_RPATH],
1872
 
[
1873
 
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1874
 
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1875
 
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1876
 
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1877
 
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1878
 
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1879
 
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1880
 
    . ./conftest.sh
1881
 
    rm -f ./conftest.sh
1882
 
    acl_cv_rpath=done
1883
 
  ])
1884
 
  wl="$acl_cv_wl"
1885
 
  libext="$acl_cv_libext"
1886
 
  shlibext="$acl_cv_shlibext"
1887
 
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1888
 
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1889
 
  hardcode_direct="$acl_cv_hardcode_direct"
1890
 
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
1891
 
  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1892
 
  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1893
 
  dnl Determine whether the user wants rpath handling at all.
1894
 
  AC_ARG_ENABLE(rpath,
1895
 
    [  --disable-rpath         do not hardcode runtime library paths],
1896
 
    :, enable_rpath=yes)
1897
 
])
1898
 
 
1899
 
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1900
 
dnl the libraries corresponding to explicit and implicit dependencies.
1901
 
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1902
 
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1903
 
[
1904
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1905
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1906
 
  dnl By default, look in $includedir and $libdir.
1907
 
  use_additional=yes
1908
 
  AC_LIB_WITH_FINAL_PREFIX([
1909
 
    eval additional_includedir=\"$includedir\"
1910
 
    eval additional_libdir=\"$libdir\"
1911
 
  ])
1912
 
  AC_ARG_WITH([lib$1-prefix],
1913
 
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1914
 
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1915
 
[
1916
 
    if test "X$withval" = "Xno"; then
1917
 
      use_additional=no
1918
 
    else
1919
 
      if test "X$withval" = "X"; then
1920
 
        AC_LIB_WITH_FINAL_PREFIX([
1921
 
          eval additional_includedir=\"$includedir\"
1922
 
          eval additional_libdir=\"$libdir\"
1923
 
        ])
1924
 
      else
1925
 
        additional_includedir="$withval/include"
1926
 
        additional_libdir="$withval/lib"
1927
 
      fi
1928
 
    fi
1929
 
])
1930
 
  dnl Search the library and its dependencies in $additional_libdir and
1931
 
  dnl $LDFLAGS. Using breadth-first-seach.
1932
 
  LIB[]NAME=
1933
 
  LTLIB[]NAME=
1934
 
  INC[]NAME=
1935
 
  rpathdirs=
1936
 
  ltrpathdirs=
1937
 
  names_already_handled=
1938
 
  names_next_round='$1 $2'
1939
 
  while test -n "$names_next_round"; do
1940
 
    names_this_round="$names_next_round"
1941
 
    names_next_round=
1942
 
    for name in $names_this_round; do
1943
 
      already_handled=
1944
 
      for n in $names_already_handled; do
1945
 
        if test "$n" = "$name"; then
1946
 
          already_handled=yes
1947
 
          break
1948
 
        fi
1949
 
      done
1950
 
      if test -z "$already_handled"; then
1951
 
        names_already_handled="$names_already_handled $name"
1952
 
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1953
 
        dnl or AC_LIB_HAVE_LINKFLAGS call.
1954
 
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1955
 
        eval value=\"\$HAVE_LIB$uppername\"
1956
 
        if test -n "$value"; then
1957
 
          if test "$value" = yes; then
1958
 
            eval value=\"\$LIB$uppername\"
1959
 
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1960
 
            eval value=\"\$LTLIB$uppername\"
1961
 
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1962
 
          else
1963
 
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1964
 
            dnl that this library doesn't exist. So just drop it.
1965
 
            :
1966
 
          fi
1967
 
        else
1968
 
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1969
 
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
1970
 
          found_dir=
1971
 
          found_la=
1972
 
          found_so=
1973
 
          found_a=
1974
 
          if test $use_additional = yes; then
1975
 
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1976
 
              found_dir="$additional_libdir"
1977
 
              found_so="$additional_libdir/lib$name.$shlibext"
1978
 
              if test -f "$additional_libdir/lib$name.la"; then
1979
 
                found_la="$additional_libdir/lib$name.la"
1980
 
              fi
1981
 
            else
1982
 
              if test -f "$additional_libdir/lib$name.$libext"; then
1983
 
                found_dir="$additional_libdir"
1984
 
                found_a="$additional_libdir/lib$name.$libext"
1985
 
                if test -f "$additional_libdir/lib$name.la"; then
1986
 
                  found_la="$additional_libdir/lib$name.la"
1987
 
                fi
1988
 
              fi
1989
 
            fi
1990
 
          fi
1991
 
          if test "X$found_dir" = "X"; then
1992
 
            for x in $LDFLAGS $LTLIB[]NAME; do
1993
 
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1994
 
              case "$x" in
1995
 
                -L*)
1996
 
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1997
 
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1998
 
                    found_dir="$dir"
1999
 
                    found_so="$dir/lib$name.$shlibext"
2000
 
                    if test -f "$dir/lib$name.la"; then
2001
 
                      found_la="$dir/lib$name.la"
2002
 
                    fi
2003
 
                  else
2004
 
                    if test -f "$dir/lib$name.$libext"; then
2005
 
                      found_dir="$dir"
2006
 
                      found_a="$dir/lib$name.$libext"
2007
 
                      if test -f "$dir/lib$name.la"; then
2008
 
                        found_la="$dir/lib$name.la"
2009
 
                      fi
2010
 
                    fi
2011
 
                  fi
2012
 
                  ;;
2013
 
              esac
2014
 
              if test "X$found_dir" != "X"; then
2015
 
                break
2016
 
              fi
2017
 
            done
2018
 
          fi
2019
 
          if test "X$found_dir" != "X"; then
2020
 
            dnl Found the library.
2021
 
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2022
 
            if test "X$found_so" != "X"; then
2023
 
              dnl Linking with a shared library. We attempt to hardcode its
2024
 
              dnl directory into the executable's runpath, unless it's the
2025
 
              dnl standard /usr/lib.
2026
 
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2027
 
                dnl No hardcoding is needed.
2028
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2029
 
              else
2030
 
                dnl Use an explicit option to hardcode DIR into the resulting
2031
 
                dnl binary.
2032
 
                dnl Potentially add DIR to ltrpathdirs.
2033
 
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2034
 
                haveit=
2035
 
                for x in $ltrpathdirs; do
2036
 
                  if test "X$x" = "X$found_dir"; then
2037
 
                    haveit=yes
2038
 
                    break
2039
 
                  fi
2040
 
                done
2041
 
                if test -z "$haveit"; then
2042
 
                  ltrpathdirs="$ltrpathdirs $found_dir"
2043
 
                fi
2044
 
                dnl The hardcoding into $LIBNAME is system dependent.
2045
 
                if test "$hardcode_direct" = yes; then
2046
 
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2047
 
                  dnl resulting binary.
2048
 
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2049
 
                else
2050
 
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2051
 
                    dnl Use an explicit option to hardcode DIR into the resulting
2052
 
                    dnl binary.
2053
 
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2054
 
                    dnl Potentially add DIR to rpathdirs.
2055
 
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
2056
 
                    haveit=
2057
 
                    for x in $rpathdirs; do
2058
 
                      if test "X$x" = "X$found_dir"; then
2059
 
                        haveit=yes
2060
 
                        break
2061
 
                      fi
2062
 
                    done
2063
 
                    if test -z "$haveit"; then
2064
 
                      rpathdirs="$rpathdirs $found_dir"
2065
 
                    fi
2066
 
                  else
2067
 
                    dnl Rely on "-L$found_dir".
2068
 
                    dnl But don't add it if it's already contained in the LDFLAGS
2069
 
                    dnl or the already constructed $LIBNAME
2070
 
                    haveit=
2071
 
                    for x in $LDFLAGS $LIB[]NAME; do
2072
 
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2073
 
                      if test "X$x" = "X-L$found_dir"; then
2074
 
                        haveit=yes
2075
 
                        break
2076
 
                      fi
2077
 
                    done
2078
 
                    if test -z "$haveit"; then
2079
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2080
 
                    fi
2081
 
                    if test "$hardcode_minus_L" != no; then
2082
 
                      dnl FIXME: Not sure whether we should use
2083
 
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2084
 
                      dnl here.
2085
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2086
 
                    else
2087
 
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2088
 
                      dnl here, because this doesn't fit in flags passed to the
2089
 
                      dnl compiler. So give up. No hardcoding. This affects only
2090
 
                      dnl very old systems.
2091
 
                      dnl FIXME: Not sure whether we should use
2092
 
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2093
 
                      dnl here.
2094
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2095
 
                    fi
2096
 
                  fi
2097
 
                fi
2098
 
              fi
2099
 
            else
2100
 
              if test "X$found_a" != "X"; then
2101
 
                dnl Linking with a static library.
2102
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2103
 
              else
2104
 
                dnl We shouldn't come here, but anyway it's good to have a
2105
 
                dnl fallback.
2106
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2107
 
              fi
2108
 
            fi
2109
 
            dnl Assume the include files are nearby.
2110
 
            additional_includedir=
2111
 
            case "$found_dir" in
2112
 
              */lib | */lib/)
2113
 
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2114
 
                additional_includedir="$basedir/include"
2115
 
                ;;
2116
 
            esac
2117
 
            if test "X$additional_includedir" != "X"; then
2118
 
              dnl Potentially add $additional_includedir to $INCNAME.
2119
 
              dnl But don't add it
2120
 
              dnl   1. if it's the standard /usr/include,
2121
 
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
2122
 
              dnl   3. if it's already present in $CPPFLAGS or the already
2123
 
              dnl      constructed $INCNAME,
2124
 
              dnl   4. if it doesn't exist as a directory.
2125
 
              if test "X$additional_includedir" != "X/usr/include"; then
2126
 
                haveit=
2127
 
                if test "X$additional_includedir" = "X/usr/local/include"; then
2128
 
                  if test -n "$GCC"; then
2129
 
                    case $host_os in
2130
 
                      linux*) haveit=yes;;
2131
 
                    esac
2132
 
                  fi
2133
 
                fi
2134
 
                if test -z "$haveit"; then
2135
 
                  for x in $CPPFLAGS $INC[]NAME; do
2136
 
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2137
 
                    if test "X$x" = "X-I$additional_includedir"; then
2138
 
                      haveit=yes
2139
 
                      break
2140
 
                    fi
2141
 
                  done
2142
 
                  if test -z "$haveit"; then
2143
 
                    if test -d "$additional_includedir"; then
2144
 
                      dnl Really add $additional_includedir to $INCNAME.
2145
 
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2146
 
                    fi
2147
 
                  fi
2148
 
                fi
2149
 
              fi
2150
 
            fi
2151
 
            dnl Look for dependencies.
2152
 
            if test -n "$found_la"; then
2153
 
              dnl Read the .la file. It defines the variables
2154
 
              dnl dlname, library_names, old_library, dependency_libs, current,
2155
 
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
2156
 
              save_libdir="$libdir"
2157
 
              case "$found_la" in
2158
 
                */* | *\\*) . "$found_la" ;;
2159
 
                *) . "./$found_la" ;;
2160
 
              esac
2161
 
              libdir="$save_libdir"
2162
 
              dnl We use only dependency_libs.
2163
 
              for dep in $dependency_libs; do
2164
 
                case "$dep" in
2165
 
                  -L*)
2166
 
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2167
 
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2168
 
                    dnl But don't add it
2169
 
                    dnl   1. if it's the standard /usr/lib,
2170
 
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2171
 
                    dnl   3. if it's already present in $LDFLAGS or the already
2172
 
                    dnl      constructed $LIBNAME,
2173
 
                    dnl   4. if it doesn't exist as a directory.
2174
 
                    if test "X$additional_libdir" != "X/usr/lib"; then
2175
 
                      haveit=
2176
 
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
2177
 
                        if test -n "$GCC"; then
2178
 
                          case $host_os in
2179
 
                            linux*) haveit=yes;;
2180
 
                          esac
2181
 
                        fi
2182
 
                      fi
2183
 
                      if test -z "$haveit"; then
2184
 
                        haveit=
2185
 
                        for x in $LDFLAGS $LIB[]NAME; do
2186
 
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2187
 
                          if test "X$x" = "X-L$additional_libdir"; then
2188
 
                            haveit=yes
2189
 
                            break
2190
 
                          fi
2191
 
                        done
2192
 
                        if test -z "$haveit"; then
2193
 
                          if test -d "$additional_libdir"; then
2194
 
                            dnl Really add $additional_libdir to $LIBNAME.
2195
 
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2196
 
                          fi
2197
 
                        fi
2198
 
                        haveit=
2199
 
                        for x in $LDFLAGS $LTLIB[]NAME; do
2200
 
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2201
 
                          if test "X$x" = "X-L$additional_libdir"; then
2202
 
                            haveit=yes
2203
 
                            break
2204
 
                          fi
2205
 
                        done
2206
 
                        if test -z "$haveit"; then
2207
 
                          if test -d "$additional_libdir"; then
2208
 
                            dnl Really add $additional_libdir to $LTLIBNAME.
2209
 
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2210
 
                          fi
2211
 
                        fi
2212
 
                      fi
2213
 
                    fi
2214
 
                    ;;
2215
 
                  -R*)
2216
 
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
2217
 
                    if test "$enable_rpath" != no; then
2218
 
                      dnl Potentially add DIR to rpathdirs.
2219
 
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
2220
 
                      haveit=
2221
 
                      for x in $rpathdirs; do
2222
 
                        if test "X$x" = "X$dir"; then
2223
 
                          haveit=yes
2224
 
                          break
2225
 
                        fi
2226
 
                      done
2227
 
                      if test -z "$haveit"; then
2228
 
                        rpathdirs="$rpathdirs $dir"
2229
 
                      fi
2230
 
                      dnl Potentially add DIR to ltrpathdirs.
2231
 
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2232
 
                      haveit=
2233
 
                      for x in $ltrpathdirs; do
2234
 
                        if test "X$x" = "X$dir"; then
2235
 
                          haveit=yes
2236
 
                          break
2237
 
                        fi
2238
 
                      done
2239
 
                      if test -z "$haveit"; then
2240
 
                        ltrpathdirs="$ltrpathdirs $dir"
2241
 
                      fi
2242
 
                    fi
2243
 
                    ;;
2244
 
                  -l*)
2245
 
                    dnl Handle this in the next round.
2246
 
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2247
 
                    ;;
2248
 
                  *.la)
2249
 
                    dnl Handle this in the next round. Throw away the .la's
2250
 
                    dnl directory; it is already contained in a preceding -L
2251
 
                    dnl option.
2252
 
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2253
 
                    ;;
2254
 
                  *)
2255
 
                    dnl Most likely an immediate library name.
2256
 
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2257
 
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2258
 
                    ;;
2259
 
                esac
2260
 
              done
2261
 
            fi
2262
 
          else
2263
 
            dnl Didn't find the library; assume it is in the system directories
2264
 
            dnl known to the linker and runtime loader. (All the system
2265
 
            dnl directories known to the linker should also be known to the
2266
 
            dnl runtime loader, otherwise the system is severely misconfigured.)
2267
 
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2268
 
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2269
 
          fi
2270
 
        fi
2271
 
      fi
2272
 
    done
2273
 
  done
2274
 
  if test "X$rpathdirs" != "X"; then
2275
 
    if test -n "$hardcode_libdir_separator"; then
2276
 
      dnl Weird platform: only the last -rpath option counts, the user must
2277
 
      dnl pass all path elements in one option. We can arrange that for a
2278
 
      dnl single library, but not when more than one $LIBNAMEs are used.
2279
 
      alldirs=
2280
 
      for found_dir in $rpathdirs; do
2281
 
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2282
 
      done
2283
 
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2284
 
      acl_save_libdir="$libdir"
2285
 
      libdir="$alldirs"
2286
 
      eval flag=\"$hardcode_libdir_flag_spec\"
2287
 
      libdir="$acl_save_libdir"
2288
 
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2289
 
    else
2290
 
      dnl The -rpath options are cumulative.
2291
 
      for found_dir in $rpathdirs; do
2292
 
        acl_save_libdir="$libdir"
2293
 
        libdir="$found_dir"
2294
 
        eval flag=\"$hardcode_libdir_flag_spec\"
2295
 
        libdir="$acl_save_libdir"
2296
 
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2297
 
      done
2298
 
    fi
2299
 
  fi
2300
 
  if test "X$ltrpathdirs" != "X"; then
2301
 
    dnl When using libtool, the option that works for both libraries and
2302
 
    dnl executables is -R. The -R options are cumulative.
2303
 
    for found_dir in $ltrpathdirs; do
2304
 
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2305
 
    done
2306
 
  fi
2307
 
])
2308
 
 
2309
 
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2310
 
dnl unless already present in VAR.
2311
 
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2312
 
dnl contains two or three consecutive elements that belong together.
2313
 
AC_DEFUN([AC_LIB_APPENDTOVAR],
2314
 
[
2315
 
  for element in [$2]; do
2316
 
    haveit=
2317
 
    for x in $[$1]; do
2318
 
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2319
 
      if test "X$x" = "X$element"; then
2320
 
        haveit=yes
2321
 
        break
2322
 
      fi
2323
 
    done
2324
 
    if test -z "$haveit"; then
2325
 
      [$1]="${[$1]}${[$1]:+ }$element"
2326
 
    fi
2327
 
  done
2328
 
])
2329
 
 
2330
 
# lib-ld.m4 serial 1 (gettext-0.11)
2331
 
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2332
 
dnl This file is free software, distributed under the terms of the GNU
2333
 
dnl General Public License.  As a special exception to the GNU General
2334
 
dnl Public License, this file may be distributed as part of a program
2335
 
dnl that contains a configuration script generated by Autoconf, under
2336
 
dnl the same distribution terms as the rest of that program.
2337
 
 
2338
 
dnl Subroutines of libtool.m4,
2339
 
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2340
 
dnl with libtool.m4.
2341
 
 
2342
 
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2343
 
AC_DEFUN([AC_LIB_PROG_LD_GNU],
2344
 
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2345
 
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2346
 
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2347
 
  acl_cv_prog_gnu_ld=yes
2348
 
else
2349
 
  acl_cv_prog_gnu_ld=no
2350
 
fi])
2351
 
with_gnu_ld=$acl_cv_prog_gnu_ld
2352
 
])
2353
 
 
2354
 
dnl From libtool-1.4. Sets the variable LD.
2355
 
AC_DEFUN([AC_LIB_PROG_LD],
2356
 
[AC_ARG_WITH(gnu-ld,
2357
 
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
2358
 
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2359
 
AC_REQUIRE([AC_PROG_CC])dnl
2360
 
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2361
 
ac_prog=ld
2362
 
if test "$GCC" = yes; then
2363
 
  # Check if gcc -print-prog-name=ld gives a path.
2364
 
  AC_MSG_CHECKING([for ld used by GCC])
2365
 
  case $host in
2366
 
  *-*-mingw*)
2367
 
    # gcc leaves a trailing carriage return which upsets mingw
2368
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2369
 
  *)
2370
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2371
 
  esac
2372
 
  case $ac_prog in
2373
 
    # Accept absolute paths.
2374
 
    [[\\/]* | [A-Za-z]:[\\/]*)]
2375
 
      [re_direlt='/[^/][^/]*/\.\./']
2376
 
      # Canonicalize the path of ld
2377
 
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2378
 
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2379
 
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2380
 
      done
2381
 
      test -z "$LD" && LD="$ac_prog"
2382
 
      ;;
2383
 
  "")
2384
 
    # If it fails, then pretend we aren't using GCC.
2385
 
    ac_prog=ld
2386
 
    ;;
2387
 
  *)
2388
 
    # If it is relative, then search for the first ld in PATH.
2389
 
    with_gnu_ld=unknown
2390
 
    ;;
2391
 
  esac
2392
 
elif test "$with_gnu_ld" = yes; then
2393
 
  AC_MSG_CHECKING([for GNU ld])
2394
 
else
2395
 
  AC_MSG_CHECKING([for non-GNU ld])
2396
 
fi
2397
 
AC_CACHE_VAL(acl_cv_path_LD,
2398
 
[if test -z "$LD"; then
2399
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2400
 
  for ac_dir in $PATH; do
2401
 
    test -z "$ac_dir" && ac_dir=.
2402
 
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2403
 
      acl_cv_path_LD="$ac_dir/$ac_prog"
2404
 
      # Check to see if the program is GNU ld.  I'd rather use --version,
2405
 
      # but apparently some GNU ld's only accept -v.
2406
 
      # Break only if it was the GNU/non-GNU ld that we prefer.
2407
 
      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2408
 
        test "$with_gnu_ld" != no && break
2409
 
      else
2410
 
        test "$with_gnu_ld" != yes && break
2411
 
      fi
2412
 
    fi
2413
 
  done
2414
 
  IFS="$ac_save_ifs"
2415
 
else
2416
 
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
2417
 
fi])
2418
 
LD="$acl_cv_path_LD"
2419
 
if test -n "$LD"; then
2420
 
  AC_MSG_RESULT($LD)
2421
 
else
2422
 
  AC_MSG_RESULT(no)
2423
 
fi
2424
 
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2425
 
AC_LIB_PROG_LD_GNU
2426
 
])
2427
 
 
2428
 
# iconv.m4 serial AM4 (gettext-0.11.3)
2429
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2430
 
dnl This file is free software, distributed under the terms of the GNU
2431
 
dnl General Public License.  As a special exception to the GNU General
2432
 
dnl Public License, this file may be distributed as part of a program
2433
 
dnl that contains a configuration script generated by Autoconf, under
2434
 
dnl the same distribution terms as the rest of that program.
2435
 
 
2436
 
dnl From Bruno Haible.
2437
 
 
2438
 
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2439
 
[
2440
 
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2441
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2442
 
  AC_REQUIRE([AC_LIB_RPATH])
2443
 
 
2444
 
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2445
 
  dnl accordingly.
2446
 
  AC_LIB_LINKFLAGS_BODY([iconv])
2447
 
])
2448
 
 
2449
 
AC_DEFUN([AM_ICONV_LINK],
2450
 
[
2451
 
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2452
 
  dnl those with the standalone portable GNU libiconv installed).
2453
 
 
2454
 
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2455
 
  dnl accordingly.
2456
 
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2457
 
 
2458
 
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2459
 
  dnl because if the user has installed libiconv and not disabled its use
2460
 
  dnl via --without-libiconv-prefix, he wants to use it. The first
2461
 
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2462
 
  am_save_CPPFLAGS="$CPPFLAGS"
2463
 
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2464
 
 
2465
 
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2466
 
    am_cv_func_iconv="no, consider installing GNU libiconv"
2467
 
    am_cv_lib_iconv=no
2468
 
    AC_TRY_LINK([#include <stdlib.h>
2469
 
#include <iconv.h>],
2470
 
      [iconv_t cd = iconv_open("","");
2471
 
       iconv(cd,NULL,NULL,NULL,NULL);
2472
 
       iconv_close(cd);],
2473
 
      am_cv_func_iconv=yes)
2474
 
    if test "$am_cv_func_iconv" != yes; then
2475
 
      am_save_LIBS="$LIBS"
2476
 
      LIBS="$LIBS $LIBICONV"
2477
 
      AC_TRY_LINK([#include <stdlib.h>
2478
 
#include <iconv.h>],
2479
 
        [iconv_t cd = iconv_open("","");
2480
 
         iconv(cd,NULL,NULL,NULL,NULL);
2481
 
         iconv_close(cd);],
2482
 
        am_cv_lib_iconv=yes
2483
 
        am_cv_func_iconv=yes)
2484
 
      LIBS="$am_save_LIBS"
2485
 
    fi
2486
 
  ])
2487
 
  if test "$am_cv_func_iconv" = yes; then
2488
 
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2489
 
  fi
2490
 
  if test "$am_cv_lib_iconv" = yes; then
2491
 
    AC_MSG_CHECKING([how to link with libiconv])
2492
 
    AC_MSG_RESULT([$LIBICONV])
2493
 
  else
2494
 
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2495
 
    dnl either.
2496
 
    CPPFLAGS="$am_save_CPPFLAGS"
2497
 
    LIBICONV=
2498
 
    LTLIBICONV=
2499
 
  fi
2500
 
  AC_SUBST(LIBICONV)
2501
 
  AC_SUBST(LTLIBICONV)
2502
 
])
2503
 
 
2504
 
AC_DEFUN([AM_ICONV],
2505
 
[
2506
 
  AM_ICONV_LINK
2507
 
  if test "$am_cv_func_iconv" = yes; then
2508
 
    AC_MSG_CHECKING([for iconv declaration])
2509
 
    AC_CACHE_VAL(am_cv_proto_iconv, [
2510
 
      AC_TRY_COMPILE([
2511
 
#include <stdlib.h>
2512
 
#include <iconv.h>
2513
 
extern
2514
 
#ifdef __cplusplus
2515
 
"C"
2516
 
#endif
2517
 
#if defined(__STDC__) || defined(__cplusplus)
2518
 
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2519
 
#else
2520
 
size_t iconv();
2521
 
#endif
2522
 
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2523
 
      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);"])
2524
 
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2525
 
    AC_MSG_RESULT([$]{ac_t:-
2526
 
         }[$]am_cv_proto_iconv)
2527
 
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2528
 
      [Define as const if the declaration of iconv() needs const.])
2529
 
  fi
2530
 
])
2531
 
 
2532
 
# progtest.m4 serial 2 (gettext-0.10.40)
2533
 
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2534
 
dnl This file is free software, distributed under the terms of the GNU
2535
 
dnl General Public License.  As a special exception to the GNU General
2536
 
dnl Public License, this file may be distributed as part of a program
2537
 
dnl that contains a configuration script generated by Autoconf, under
2538
 
dnl the same distribution terms as the rest of that program.
2539
 
dnl
2540
 
dnl This file can can be used in projects which are not available under
2541
 
dnl the GNU General Public License or the GNU Library General Public
2542
 
dnl License but which still want to provide support for the GNU gettext
2543
 
dnl functionality.
2544
 
dnl Please note that the actual code of the GNU gettext library is covered
2545
 
dnl by the GNU Library General Public License, and the rest of the GNU
2546
 
dnl gettext package package is covered by the GNU General Public License.
2547
 
dnl They are *not* in the public domain.
2548
 
 
2549
 
dnl Authors:
2550
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2551
 
 
2552
 
# Search path for a program which passes the given test.
2553
 
 
2554
 
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2555
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2556
 
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2557
 
[# Extract the first word of "$2", so it can be a program name with args.
2558
 
set dummy $2; ac_word=[$]2
2559
 
AC_MSG_CHECKING([for $ac_word])
2560
 
AC_CACHE_VAL(ac_cv_path_$1,
2561
 
[case "[$]$1" in
2562
 
  /*)
2563
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2564
 
  ;;
2565
 
  *)
2566
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2567
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
2568
 
    test -z "$ac_dir" && ac_dir=.
2569
 
    if test -f $ac_dir/$ac_word; then
2570
 
      if [$3]; then
2571
 
        ac_cv_path_$1="$ac_dir/$ac_word"
2572
 
        break
2573
 
      fi
2574
 
    fi
2575
 
  done
2576
 
  IFS="$ac_save_ifs"
2577
 
dnl If no 4th arg is given, leave the cache variable unset,
2578
 
dnl so AC_PATH_PROGS will keep looking.
2579
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2580
 
])dnl
2581
 
  ;;
2582
 
esac])dnl
2583
 
$1="$ac_cv_path_$1"
2584
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2585
 
  AC_MSG_RESULT([$]$1)
2586
 
else
2587
 
  AC_MSG_RESULT(no)
2588
 
fi
2589
 
AC_SUBST($1)dnl
2590
 
])
2591
 
 
2592
 
# isc-posix.m4 serial 2 (gettext-0.11.2)
2593
 
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2594
 
dnl This file is free software, distributed under the terms of the GNU
2595
 
dnl General Public License.  As a special exception to the GNU General
2596
 
dnl Public License, this file may be distributed as part of a program
2597
 
dnl that contains a configuration script generated by Autoconf, under
2598
 
dnl the same distribution terms as the rest of that program.
2599
 
 
2600
 
# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
2601
 
 
2602
 
# This test replaces the one in autoconf.
2603
 
# Currently this macro should have the same name as the autoconf macro
2604
 
# because gettext's gettext.m4 (distributed in the automake package)
2605
 
# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
2606
 
# give these diagnostics:
2607
 
#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2608
 
#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2609
 
 
2610
 
undefine([AC_ISC_POSIX])
2611
 
 
2612
 
AC_DEFUN([AC_ISC_POSIX],
2613
 
  [
2614
 
    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2615
 
    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2616
 
  ]
2617
 
)
2618
 
 
2619
 
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2620
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2621
 
dnl This file is free software, distributed under the terms of the GNU
2622
 
dnl General Public License.  As a special exception to the GNU General
2623
 
dnl Public License, this file may be distributed as part of a program
2624
 
dnl that contains a configuration script generated by Autoconf, under
2625
 
dnl the same distribution terms as the rest of that program.
2626
 
 
2627
 
# Test for the GNU C Library, version 2.1 or newer.
2628
 
# From Bruno Haible.
2629
 
 
2630
 
AC_DEFUN([jm_GLIBC21],
2631
 
  [
2632
 
    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2633
 
      ac_cv_gnu_library_2_1,
2634
 
      [AC_EGREP_CPP([Lucky GNU user],
2635
 
        [
2636
 
#include <features.h>
2637
 
#ifdef __GNU_LIBRARY__
2638
 
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2639
 
  Lucky GNU user
2640
 
 #endif
2641
 
#endif
2642
 
        ],
2643
 
        ac_cv_gnu_library_2_1=yes,
2644
 
        ac_cv_gnu_library_2_1=no)
2645
 
      ]
2646
 
    )
2647
 
    AC_SUBST(GLIBC21)
2648
 
    GLIBC21="$ac_cv_gnu_library_2_1"
2649
 
  ]
2650
 
)
2651
 
 
2652
 
# intdiv0.m4 serial 1 (gettext-0.11.3)
2653
 
dnl Copyright (C) 2002 Free Software Foundation, Inc.
2654
 
dnl This file is free software, distributed under the terms of the GNU
2655
 
dnl General Public License.  As a special exception to the GNU General
2656
 
dnl Public License, this file may be distributed as part of a program
2657
 
dnl that contains a configuration script generated by Autoconf, under
2658
 
dnl the same distribution terms as the rest of that program.
2659
 
 
2660
 
dnl From Bruno Haible.
2661
 
 
2662
 
AC_DEFUN([gt_INTDIV0],
2663
 
[
2664
 
  AC_REQUIRE([AC_PROG_CC])dnl
2665
 
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
2666
 
 
2667
 
  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2668
 
    gt_cv_int_divbyzero_sigfpe,
2669
 
    [
2670
 
      AC_TRY_RUN([
2671
 
#include <stdlib.h>
2672
 
#include <signal.h>
2673
 
 
2674
 
static void
2675
 
#ifdef __cplusplus
2676
 
sigfpe_handler (int sig)
2677
 
#else
2678
 
sigfpe_handler (sig) int sig;
2679
 
#endif
2680
 
{
2681
 
  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
2682
 
  exit (sig != SIGFPE);
2683
 
}
2684
 
 
2685
 
int x = 1;
2686
 
int y = 0;
2687
 
int z;
2688
 
int nan;
2689
 
 
2690
 
int main ()
2691
 
{
2692
 
  signal (SIGFPE, sigfpe_handler);
2693
 
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
2694
 
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2695
 
  signal (SIGTRAP, sigfpe_handler);
2696
 
#endif
2697
 
/* Linux/SPARC yields signal SIGILL.  */
2698
 
#if defined (__sparc__) && defined (__linux__)
2699
 
  signal (SIGILL, sigfpe_handler);
2700
 
#endif
2701
 
 
2702
 
  z = x / y;
2703
 
  nan = y / y;
2704
 
  exit (1);
2705
 
}
2706
 
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2707
 
        [
2708
 
          # Guess based on the CPU.
2709
 
          case "$host_cpu" in
2710
 
            alpha* | i[34567]86 | m68k | s390*)
2711
 
              gt_cv_int_divbyzero_sigfpe="guessing yes";;
2712
 
            *)
2713
 
              gt_cv_int_divbyzero_sigfpe="guessing no";;
2714
 
          esac
2715
 
        ])
2716
 
    ])
2717
 
  case "$gt_cv_int_divbyzero_sigfpe" in
2718
 
    *yes) value=1;;
2719
 
    *) value=0;;
2720
 
  esac
2721
 
  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2722
 
    [Define if integer division by zero raises signal SIGFPE.])
2723
 
])
2724
 
 
2725
 
# uintmax_t.m4 serial 6 (gettext-0.11)
2726
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2727
 
dnl This file is free software, distributed under the terms of the GNU
2728
 
dnl General Public License.  As a special exception to the GNU General
2729
 
dnl Public License, this file may be distributed as part of a program
2730
 
dnl that contains a configuration script generated by Autoconf, under
2731
 
dnl the same distribution terms as the rest of that program.
2732
 
 
2733
 
dnl From Paul Eggert.
2734
 
 
2735
 
AC_PREREQ(2.13)
2736
 
 
2737
 
# Define uintmax_t to `unsigned long' or `unsigned long long'
2738
 
# if <inttypes.h> does not exist.
2739
 
 
2740
 
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2741
 
[
2742
 
  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2743
 
  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2744
 
  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2745
 
    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2746
 
    test $ac_cv_type_unsigned_long_long = yes \
2747
 
      && ac_type='unsigned long long' \
2748
 
      || ac_type='unsigned long'
2749
 
    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2750
 
  [Define to unsigned long or unsigned long long
2751
 
   if <inttypes.h> and <stdint.h> don't define.])
2752
 
  fi
2753
 
])
2754
 
 
2755
 
# inttypes_h.m4 serial 4 (gettext-0.11.4)
2756
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2757
 
dnl This file is free software, distributed under the terms of the GNU
2758
 
dnl General Public License.  As a special exception to the GNU General
2759
 
dnl Public License, this file may be distributed as part of a program
2760
 
dnl that contains a configuration script generated by Autoconf, under
2761
 
dnl the same distribution terms as the rest of that program.
2762
 
 
2763
 
dnl From Paul Eggert.
2764
 
 
2765
 
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2766
 
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2767
 
 
2768
 
AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2769
 
[
2770
 
  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2771
 
  [AC_TRY_COMPILE(
2772
 
    [#include <sys/types.h>
2773
 
#include <inttypes.h>],
2774
 
    [uintmax_t i = (uintmax_t) -1;],
2775
 
    jm_ac_cv_header_inttypes_h=yes,
2776
 
    jm_ac_cv_header_inttypes_h=no)])
2777
 
  if test $jm_ac_cv_header_inttypes_h = yes; then
2778
 
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2779
 
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2780
 
   and declares uintmax_t. ])
2781
 
  fi
2782
 
])
2783
 
 
2784
 
# stdint_h.m4 serial 2 (gettext-0.11.4)
2785
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2786
 
dnl This file is free software, distributed under the terms of the GNU
2787
 
dnl General Public License.  As a special exception to the GNU General
2788
 
dnl Public License, this file may be distributed as part of a program
2789
 
dnl that contains a configuration script generated by Autoconf, under
2790
 
dnl the same distribution terms as the rest of that program.
2791
 
 
2792
 
dnl From Paul Eggert.
2793
 
 
2794
 
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2795
 
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2796
 
 
2797
 
AC_DEFUN([jm_AC_HEADER_STDINT_H],
2798
 
[
2799
 
  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2800
 
  [AC_TRY_COMPILE(
2801
 
    [#include <sys/types.h>
2802
 
#include <stdint.h>],
2803
 
    [uintmax_t i = (uintmax_t) -1;],
2804
 
    jm_ac_cv_header_stdint_h=yes,
2805
 
    jm_ac_cv_header_stdint_h=no)])
2806
 
  if test $jm_ac_cv_header_stdint_h = yes; then
2807
 
    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2808
 
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2809
 
   and declares uintmax_t. ])
2810
 
  fi
2811
 
])
2812
 
 
2813
 
# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2814
 
dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2815
 
dnl This file is free software, distributed under the terms of the GNU
2816
 
dnl General Public License.  As a special exception to the GNU General
2817
 
dnl Public License, this file may be distributed as part of a program
2818
 
dnl that contains a configuration script generated by Autoconf, under
2819
 
dnl the same distribution terms as the rest of that program.
2820
 
 
2821
 
dnl From Paul Eggert.
2822
 
 
2823
 
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2824
 
[
2825
 
  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2826
 
  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2827
 
    [unsigned long long ullmax = (unsigned long long) -1;
2828
 
     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2829
 
    ac_cv_type_unsigned_long_long=yes,
2830
 
    ac_cv_type_unsigned_long_long=no)])
2831
 
  if test $ac_cv_type_unsigned_long_long = yes; then
2832
 
    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2833
 
      [Define if you have the unsigned long long type.])
2834
 
  fi
2835
 
])
2836
 
 
2837
 
# inttypes.m4 serial 1 (gettext-0.11.4)
2838
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2839
 
dnl This file is free software, distributed under the terms of the GNU
2840
 
dnl General Public License.  As a special exception to the GNU General
2841
 
dnl Public License, this file may be distributed as part of a program
2842
 
dnl that contains a configuration script generated by Autoconf, under
2843
 
dnl the same distribution terms as the rest of that program.
2844
 
 
2845
 
dnl From Paul Eggert.
2846
 
 
2847
 
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2848
 
# <sys/types.h>.
2849
 
 
2850
 
AC_DEFUN([gt_HEADER_INTTYPES_H],
2851
 
[
2852
 
  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2853
 
  [
2854
 
    AC_TRY_COMPILE(
2855
 
      [#include <sys/types.h>
2856
 
#include <inttypes.h>],
2857
 
      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2858
 
  ])
2859
 
  if test $gt_cv_header_inttypes_h = yes; then
2860
 
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2861
 
      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2862
 
  fi
2863
 
])
2864
 
 
2865
 
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
2866
 
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2867
 
dnl This file is free software, distributed under the terms of the GNU
2868
 
dnl General Public License.  As a special exception to the GNU General
2869
 
dnl Public License, this file may be distributed as part of a program
2870
 
dnl that contains a configuration script generated by Autoconf, under
2871
 
dnl the same distribution terms as the rest of that program.
2872
 
 
2873
 
dnl From Bruno Haible.
2874
 
 
2875
 
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2876
 
# macros to non-string values.  This is the case on AIX 4.3.3.
2877
 
 
2878
 
AC_DEFUN([gt_INTTYPES_PRI],
2879
 
[
2880
 
  AC_REQUIRE([gt_HEADER_INTTYPES_H])
2881
 
  if test $gt_cv_header_inttypes_h = yes; then
2882
 
    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2883
 
      gt_cv_inttypes_pri_broken,
2884
 
      [
2885
 
        AC_TRY_COMPILE([#include <inttypes.h>
2886
 
#ifdef PRId32
2887
 
char *p = PRId32;
2888
 
#endif
2889
 
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2890
 
      ])
2891
 
  fi
2892
 
  if test "$gt_cv_inttypes_pri_broken" = yes; then
2893
 
    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2894
 
      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2895
 
  fi
2896
 
])
2897
 
 
2898
 
# codeset.m4 serial AM1 (gettext-0.10.40)
2899
 
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2900
 
dnl This file is free software, distributed under the terms of the GNU
2901
 
dnl General Public License.  As a special exception to the GNU General
2902
 
dnl Public License, this file may be distributed as part of a program
2903
 
dnl that contains a configuration script generated by Autoconf, under
2904
 
dnl the same distribution terms as the rest of that program.
2905
 
 
2906
 
dnl From Bruno Haible.
2907
 
 
2908
 
AC_DEFUN([AM_LANGINFO_CODESET],
2909
 
[
2910
 
  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2911
 
    [AC_TRY_LINK([#include <langinfo.h>],
2912
 
      [char* cs = nl_langinfo(CODESET);],
2913
 
      am_cv_langinfo_codeset=yes,
2914
 
      am_cv_langinfo_codeset=no)
2915
 
    ])
2916
 
  if test $am_cv_langinfo_codeset = yes; then
2917
 
    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2918
 
      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2919
 
  fi
2920
 
])
2921
 
 
2922
 
# lcmessage.m4 serial 3 (gettext-0.11.3)
2923
 
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2924
 
dnl This file is free software, distributed under the terms of the GNU
2925
 
dnl General Public License.  As a special exception to the GNU General
2926
 
dnl Public License, this file may be distributed as part of a program
2927
 
dnl that contains a configuration script generated by Autoconf, under
2928
 
dnl the same distribution terms as the rest of that program.
2929
 
dnl
2930
 
dnl This file can can be used in projects which are not available under
2931
 
dnl the GNU General Public License or the GNU Library General Public
2932
 
dnl License but which still want to provide support for the GNU gettext
2933
 
dnl functionality.
2934
 
dnl Please note that the actual code of the GNU gettext library is covered
2935
 
dnl by the GNU Library General Public License, and the rest of the GNU
2936
 
dnl gettext package package is covered by the GNU General Public License.
2937
 
dnl They are *not* in the public domain.
2938
 
 
2939
 
dnl Authors:
2940
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
2941
 
 
2942
 
# Check whether LC_MESSAGES is available in <locale.h>.
2943
 
 
2944
 
AC_DEFUN([AM_LC_MESSAGES],
2945
 
[
2946
 
  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2947
 
    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2948
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2949
 
  if test $am_cv_val_LC_MESSAGES = yes; then
2950
 
    AC_DEFINE(HAVE_LC_MESSAGES, 1,
2951
 
      [Define if your <locale.h> file defines LC_MESSAGES.])
2952
 
  fi
2953
 
])
2954