~ubuntu-branches/ubuntu/oneiric/libtorrent/oneiric

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Rivas
  • Date: 2007-09-11 15:12:31 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070911151231-brompt7pecvfbaau
Tags: 0.11.8-1
* New upstream version
* debian/patches/update-changelog.patch:
 + Updated with the new changelog.
* debian/control:
 + Added the Homepage field, deleted Homepages from the descriptions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
 
1
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
2
 
3
 
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4
 
# Free Software Foundation, Inc.
 
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 
4
# 2005  Free Software Foundation, Inc.
5
5
# This file is free software; the Free Software Foundation
6
6
# gives unlimited permission to copy and/or distribute it,
7
7
# with or without modifications, as long as this notice is preserved.
11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
13
13
 
14
 
# 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 1996, 1997, 1998, 1999, 2000, 2001, 2002
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 8
38
 
 
39
 
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40
 
# written in clear, in which case automake, when reading aclocal.m4,
41
 
# will think it sees a *use*, and therefore will trigger all it's
42
 
# C support machinery.  Also note that it means that autoscan, seeing
43
 
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
44
 
 
45
 
 
46
 
AC_PREREQ([2.52])
47
 
 
48
 
# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
49
 
# the ones we care about.
50
 
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
51
 
 
52
 
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53
 
# AM_INIT_AUTOMAKE([OPTIONS])
54
 
# -----------------------------------------------
55
 
# The call with PACKAGE and VERSION arguments is the old style
56
 
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
57
 
# and VERSION should now be passed to AC_INIT and removed from
58
 
# the call to AM_INIT_AUTOMAKE.
59
 
# We support both call styles for the transition.  After
60
 
# the next Automake release, Autoconf can make the AC_INIT
61
 
# arguments mandatory, and then we can depend on a new Autoconf
62
 
# release and drop the old call support.
63
 
AC_DEFUN([AM_INIT_AUTOMAKE],
64
 
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65
 
 AC_REQUIRE([AC_PROG_INSTALL])dnl
66
 
# test to see if srcdir already configured
67
 
if test "`cd $srcdir && pwd`" != "`pwd`" &&
68
 
   test -f $srcdir/config.status; then
69
 
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
70
 
fi
71
 
 
72
 
# Define the identity of the package.
73
 
dnl Distinguish between old-style and new-style calls.
74
 
m4_ifval([$2],
75
 
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
76
 
 AC_SUBST([PACKAGE], [$1])dnl
77
 
 AC_SUBST([VERSION], [$2])],
78
 
[_AM_SET_OPTIONS([$1])dnl
79
 
 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
80
 
 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
81
 
 
82
 
_AM_IF_OPTION([no-define],,
83
 
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
84
 
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
85
 
 
86
 
# Some tools Automake needs.
87
 
AC_REQUIRE([AM_SANITY_CHECK])dnl
88
 
AC_REQUIRE([AC_ARG_PROGRAM])dnl
89
 
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
90
 
AM_MISSING_PROG(AUTOCONF, autoconf)
91
 
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
92
 
AM_MISSING_PROG(AUTOHEADER, autoheader)
93
 
AM_MISSING_PROG(MAKEINFO, makeinfo)
94
 
AM_MISSING_PROG(AMTAR, tar)
95
 
AM_PROG_INSTALL_SH
96
 
AM_PROG_INSTALL_STRIP
97
 
# We need awk for the "check" target.  The system "awk" is bad on
98
 
# some platforms.
99
 
AC_REQUIRE([AC_PROG_AWK])dnl
100
 
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
101
 
 
102
 
_AM_IF_OPTION([no-dependencies],,
103
 
[AC_PROVIDE_IFELSE([AC_PROG_][CC],
104
 
                  [_AM_DEPENDENCIES(CC)],
105
 
                  [define([AC_PROG_][CC],
106
 
                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
107
 
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
108
 
                  [_AM_DEPENDENCIES(CXX)],
109
 
                  [define([AC_PROG_][CXX],
110
 
                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111
 
])
112
 
])
113
 
 
114
 
# Copyright 2002  Free Software Foundation, Inc.
115
 
 
116
 
# This program is free software; you can redistribute it and/or modify
117
 
# it under the terms of the GNU General Public License as published by
118
 
# the Free Software Foundation; either version 2, or (at your option)
119
 
# any later version.
120
 
 
121
 
# This program is distributed in the hope that it will be useful,
122
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
123
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
124
 
# GNU General Public License for more details.
125
 
 
126
 
# You should have received a copy of the GNU General Public License
127
 
# along with this program; if not, write to the Free Software
128
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
14
# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
 
15
#
 
16
# This file is free software; the Free Software Foundation
 
17
# gives unlimited permission to copy and/or distribute it,
 
18
# with or without modifications, as long as this notice is preserved.
129
19
 
130
20
# AM_AUTOMAKE_VERSION(VERSION)
131
21
# ----------------------------
132
22
# Automake X.Y traces this macro to ensure aclocal.m4 has been
133
23
# generated from the m4 files accompanying Automake X.Y.
134
 
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
 
24
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
135
25
 
136
26
# AM_SET_CURRENT_AUTOMAKE_VERSION
137
27
# -------------------------------
138
28
# Call AM_AUTOMAKE_VERSION so it can be traced.
139
29
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
140
30
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
141
 
         [AM_AUTOMAKE_VERSION([1.6.3])])
142
 
 
143
 
# Helper functions for option handling.                    -*- Autoconf -*-
144
 
 
145
 
# Copyright 2001, 2002  Free Software Foundation, Inc.
146
 
 
147
 
# This program is free software; you can redistribute it and/or modify
148
 
# it under the terms of the GNU General Public License as published by
149
 
# the Free Software Foundation; either version 2, or (at your option)
150
 
# any later version.
151
 
 
152
 
# This program is distributed in the hope that it will be useful,
153
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
154
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155
 
# GNU General Public License for more details.
156
 
 
157
 
# You should have received a copy of the GNU General Public License
158
 
# along with this program; if not, write to the Free Software
159
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
160
 
# 02111-1307, USA.
161
 
 
162
 
# serial 2
163
 
 
164
 
# _AM_MANGLE_OPTION(NAME)
165
 
# -----------------------
166
 
AC_DEFUN([_AM_MANGLE_OPTION],
167
 
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
168
 
 
169
 
# _AM_SET_OPTION(NAME)
170
 
# ------------------------------
171
 
# Set option NAME.  Presently that only means defining a flag for this option.
172
 
AC_DEFUN([_AM_SET_OPTION],
173
 
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
174
 
 
175
 
# _AM_SET_OPTIONS(OPTIONS)
176
 
# ----------------------------------
177
 
# OPTIONS is a space-separated list of Automake options.
178
 
AC_DEFUN([_AM_SET_OPTIONS],
179
 
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
180
 
 
181
 
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
182
 
# -------------------------------------------
183
 
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
184
 
AC_DEFUN([_AM_IF_OPTION],
185
 
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
186
 
 
187
 
#
188
 
# Check to make sure that the build environment is sane.
189
 
#
190
 
 
191
 
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
192
 
 
193
 
# This program is free software; you can redistribute it and/or modify
194
 
# it under the terms of the GNU General Public License as published by
195
 
# the Free Software Foundation; either version 2, or (at your option)
196
 
# any later version.
197
 
 
198
 
# This program is distributed in the hope that it will be useful,
199
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
200
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
201
 
# GNU General Public License for more details.
202
 
 
203
 
# You should have received a copy of the GNU General Public License
204
 
# along with this program; if not, write to the Free Software
205
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
206
 
# 02111-1307, USA.
207
 
 
208
 
# serial 3
209
 
 
210
 
# AM_SANITY_CHECK
211
 
# ---------------
212
 
AC_DEFUN([AM_SANITY_CHECK],
213
 
[AC_MSG_CHECKING([whether build environment is sane])
214
 
# Just in case
215
 
sleep 1
216
 
echo timestamp > conftest.file
217
 
# Do `set' in a subshell so we don't clobber the current shell's
218
 
# arguments.  Must try -L first in case configure is actually a
219
 
# symlink; some systems play weird games with the mod time of symlinks
220
 
# (eg FreeBSD returns the mod time of the symlink's containing
221
 
# directory).
222
 
if (
223
 
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
224
 
   if test "$[*]" = "X"; then
225
 
      # -L didn't work.
226
 
      set X `ls -t $srcdir/configure conftest.file`
227
 
   fi
228
 
   rm -f conftest.file
229
 
   if test "$[*]" != "X $srcdir/configure conftest.file" \
230
 
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
231
 
 
232
 
      # If neither matched, then we have a broken ls.  This can happen
233
 
      # if, for instance, CONFIG_SHELL is bash and it inherits a
234
 
      # broken ls alias from the environment.  This has actually
235
 
      # happened.  Such a system could not be considered "sane".
236
 
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
237
 
alias in your environment])
238
 
   fi
239
 
 
240
 
   test "$[2]" = conftest.file
241
 
   )
242
 
then
243
 
   # Ok.
244
 
   :
245
 
else
246
 
   AC_MSG_ERROR([newly created file is older than distributed files!
247
 
Check your system clock])
248
 
fi
249
 
AC_MSG_RESULT(yes)])
250
 
 
251
 
#  -*- Autoconf -*-
252
 
 
253
 
 
254
 
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
255
 
 
256
 
# This program is free software; you can redistribute it and/or modify
257
 
# it under the terms of the GNU General Public License as published by
258
 
# the Free Software Foundation; either version 2, or (at your option)
259
 
# any later version.
260
 
 
261
 
# This program is distributed in the hope that it will be useful,
262
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
263
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
264
 
# GNU General Public License for more details.
265
 
 
266
 
# You should have received a copy of the GNU General Public License
267
 
# along with this program; if not, write to the Free Software
268
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
269
 
# 02111-1307, USA.
270
 
 
271
 
# serial 3
272
 
 
273
 
# AM_MISSING_PROG(NAME, PROGRAM)
274
 
# ------------------------------
275
 
AC_DEFUN([AM_MISSING_PROG],
276
 
[AC_REQUIRE([AM_MISSING_HAS_RUN])
277
 
$1=${$1-"${am_missing_run}$2"}
278
 
AC_SUBST($1)])
279
 
 
280
 
 
281
 
# AM_MISSING_HAS_RUN
282
 
# ------------------
283
 
# Define MISSING if not defined so far and test if it supports --run.
284
 
# If it does, set am_missing_run to use it, otherwise, to nothing.
285
 
AC_DEFUN([AM_MISSING_HAS_RUN],
286
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
287
 
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
288
 
# Use eval to expand $SHELL
289
 
if eval "$MISSING --run true"; then
290
 
  am_missing_run="$MISSING --run "
291
 
else
292
 
  am_missing_run=
293
 
  AC_MSG_WARN([`missing' script is too old or missing])
294
 
fi
295
 
])
296
 
 
297
 
# AM_AUX_DIR_EXPAND
298
 
 
299
 
# Copyright 2001 Free Software Foundation, Inc.
300
 
 
301
 
# This program is free software; you can redistribute it and/or modify
302
 
# it under the terms of the GNU General Public License as published by
303
 
# the Free Software Foundation; either version 2, or (at your option)
304
 
# any later version.
305
 
 
306
 
# This program is distributed in the hope that it will be useful,
307
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
308
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
309
 
# GNU General Public License for more details.
310
 
 
311
 
# You should have received a copy of the GNU General Public License
312
 
# along with this program; if not, write to the Free Software
313
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
314
 
# 02111-1307, USA.
 
31
         [AM_AUTOMAKE_VERSION([1.9.6])])
 
32
 
 
33
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
34
 
 
35
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
36
#
 
37
# This file is free software; the Free Software Foundation
 
38
# gives unlimited permission to copy and/or distribute it,
 
39
# with or without modifications, as long as this notice is preserved.
315
40
 
316
41
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
317
42
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
351
76
# absolute PATH.  The drawback is that using absolute paths prevent a
352
77
# configured tree to be moved without reconfiguration.
353
78
 
354
 
# Rely on autoconf to set up CDPATH properly.
355
 
AC_PREREQ([2.50])
356
 
 
357
 
AC_DEFUN([AM_AUX_DIR_EXPAND], [
 
79
AC_DEFUN([AM_AUX_DIR_EXPAND],
 
80
[dnl Rely on autoconf to set up CDPATH properly.
 
81
AC_PREREQ([2.50])dnl
358
82
# expand $ac_aux_dir to an absolute path
359
83
am_aux_dir=`cd $ac_aux_dir && pwd`
360
84
])
361
85
 
362
 
# AM_PROG_INSTALL_SH
363
 
# ------------------
364
 
# Define $install_sh.
365
 
 
366
 
# Copyright 2001 Free Software Foundation, Inc.
367
 
 
368
 
# This program is free software; you can redistribute it and/or modify
369
 
# it under the terms of the GNU General Public License as published by
370
 
# the Free Software Foundation; either version 2, or (at your option)
371
 
# any later version.
372
 
 
373
 
# This program is distributed in the hope that it will be useful,
374
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
375
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
376
 
# GNU General Public License for more details.
377
 
 
378
 
# You should have received a copy of the GNU General Public License
379
 
# along with this program; if not, write to the Free Software
380
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
381
 
# 02111-1307, USA.
382
 
 
383
 
AC_DEFUN([AM_PROG_INSTALL_SH],
384
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
385
 
install_sh=${install_sh-"$am_aux_dir/install-sh"}
386
 
AC_SUBST(install_sh)])
387
 
 
388
 
# AM_PROG_INSTALL_STRIP
389
 
 
390
 
# Copyright 2001 Free Software Foundation, Inc.
391
 
 
392
 
# This program is free software; you can redistribute it and/or modify
393
 
# it under the terms of the GNU General Public License as published by
394
 
# the Free Software Foundation; either version 2, or (at your option)
395
 
# any later version.
396
 
 
397
 
# This program is distributed in the hope that it will be useful,
398
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
399
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
400
 
# GNU General Public License for more details.
401
 
 
402
 
# You should have received a copy of the GNU General Public License
403
 
# along with this program; if not, write to the Free Software
404
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
405
 
# 02111-1307, USA.
406
 
 
407
 
# One issue with vendor `install' (even GNU) is that you can't
408
 
# specify the program used to strip binaries.  This is especially
409
 
# annoying in cross-compiling environments, where the build's strip
410
 
# is unlikely to handle the host's binaries.
411
 
# Fortunately install-sh will honor a STRIPPROG variable, so we
412
 
# always use install-sh in `make install-strip', and initialize
413
 
# STRIPPROG with the value of the STRIP variable (set by the user).
414
 
AC_DEFUN([AM_PROG_INSTALL_STRIP],
415
 
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
416
 
# Installed binaries are usually stripped using `strip' when the user
417
 
# run `make install-strip'.  However `strip' might not be the right
418
 
# tool to use in cross-compilation environments, therefore Automake
419
 
# will honor the `STRIP' environment variable to overrule this program.
420
 
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
421
 
if test "$cross_compiling" != no; then
422
 
  AC_CHECK_TOOL([STRIP], [strip], :)
 
86
# AM_CONDITIONAL                                            -*- Autoconf -*-
 
87
 
 
88
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
 
89
# Free Software Foundation, Inc.
 
90
#
 
91
# This file is free software; the Free Software Foundation
 
92
# gives unlimited permission to copy and/or distribute it,
 
93
# with or without modifications, as long as this notice is preserved.
 
94
 
 
95
# serial 7
 
96
 
 
97
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
 
98
# -------------------------------------
 
99
# Define a conditional.
 
100
AC_DEFUN([AM_CONDITIONAL],
 
101
[AC_PREREQ(2.52)dnl
 
102
 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
 
103
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 
104
AC_SUBST([$1_TRUE])
 
105
AC_SUBST([$1_FALSE])
 
106
if $2; then
 
107
  $1_TRUE=
 
108
  $1_FALSE='#'
 
109
else
 
110
  $1_TRUE='#'
 
111
  $1_FALSE=
423
112
fi
424
 
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
425
 
AC_SUBST([INSTALL_STRIP_PROGRAM])])
426
 
 
427
 
# serial 4                                              -*- Autoconf -*-
428
 
 
429
 
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
430
 
 
431
 
# This program is free software; you can redistribute it and/or modify
432
 
# it under the terms of the GNU General Public License as published by
433
 
# the Free Software Foundation; either version 2, or (at your option)
434
 
# any later version.
435
 
 
436
 
# This program is distributed in the hope that it will be useful,
437
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
438
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
439
 
# GNU General Public License for more details.
440
 
 
441
 
# You should have received a copy of the GNU General Public License
442
 
# along with this program; if not, write to the Free Software
443
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
444
 
# 02111-1307, USA.
445
 
 
 
113
AC_CONFIG_COMMANDS_PRE(
 
114
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
 
115
  AC_MSG_ERROR([[conditional "$1" was never defined.
 
116
Usually this means the macro was only invoked conditionally.]])
 
117
fi])])
 
118
 
 
119
 
 
120
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
121
# Free Software Foundation, Inc.
 
122
#
 
123
# This file is free software; the Free Software Foundation
 
124
# gives unlimited permission to copy and/or distribute it,
 
125
# with or without modifications, as long as this notice is preserved.
 
126
 
 
127
# serial 8
446
128
 
447
129
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
448
130
# written in clear, in which case automake, when reading aclocal.m4,
451
133
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
452
134
 
453
135
 
454
 
 
455
136
# _AM_DEPENDENCIES(NAME)
456
137
# ----------------------
457
138
# See how the compiler implements dependency checking.
487
168
  # using a relative directory.
488
169
  cp "$am_depcomp" conftest.dir
489
170
  cd conftest.dir
 
171
  # We will build objects and dependencies in a subdirectory because
 
172
  # it helps to detect inapplicable dependency modes.  For instance
 
173
  # both Tru64's cc and ICC support -MD to output dependencies as a
 
174
  # side effect of compilation, but ICC will put the dependencies in
 
175
  # the current directory while Tru64 will put them in the object
 
176
  # directory.
 
177
  mkdir sub
490
178
 
491
179
  am_cv_$1_dependencies_compiler_type=none
492
180
  if test "$am_compiler_list" = ""; then
493
181
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
494
182
  fi
495
183
  for depmode in $am_compiler_list; do
 
184
    # Setup a source with many dependencies, because some compilers
 
185
    # like to wrap large dependency lists on column 80 (with \), and
 
186
    # we should not choose a depcomp mode which is confused by this.
 
187
    #
496
188
    # We need to recreate these files for each test, as the compiler may
497
189
    # overwrite some of them when testing with obscure command lines.
498
190
    # This happens at least with the AIX C compiler.
499
 
    echo '#include "conftest.h"' > conftest.c
500
 
    echo 'int i;' > conftest.h
501
 
    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
 
191
    : > sub/conftest.c
 
192
    for i in 1 2 3 4 5 6; do
 
193
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
 
194
      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
 
195
      # Solaris 8's {/usr,}/bin/sh.
 
196
      touch sub/conftst$i.h
 
197
    done
 
198
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
502
199
 
503
200
    case $depmode in
504
201
    nosideeffect)
516
213
    # mode.  It turns out that the SunPro C++ compiler does not properly
517
214
    # handle `-M -o', and we need to detect this.
518
215
    if depmode=$depmode \
519
 
       source=conftest.c object=conftest.o \
520
 
       depfile=conftest.Po tmpdepfile=conftest.TPo \
521
 
       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
522
 
       grep conftest.h conftest.Po > /dev/null 2>&1 &&
 
216
       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
 
217
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
 
218
       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
 
219
         >/dev/null 2>conftest.err &&
 
220
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
 
221
       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
523
222
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
524
 
      am_cv_$1_dependencies_compiler_type=$depmode
525
 
      break
 
223
      # icc doesn't choke on unknown options, it will just issue warnings
 
224
      # or remarks (even with -Werror).  So we grep stderr for any message
 
225
      # that says an option was ignored or not supported.
 
226
      # When given -MP, icc 7.0 and 7.1 complain thusly:
 
227
      #   icc: Command line warning: ignoring option '-M'; no argument required
 
228
      # The diagnosis changed in icc 8.0:
 
229
      #   icc: Command line remark: option '-MP' not supported
 
230
      if (grep 'ignoring option' conftest.err ||
 
231
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
 
232
        am_cv_$1_dependencies_compiler_type=$depmode
 
233
        break
 
234
      fi
526
235
    fi
527
236
  done
528
237
 
533
242
fi
534
243
])
535
244
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
 
245
AM_CONDITIONAL([am__fastdep$1], [
 
246
  test "x$enable_dependency_tracking" != xno \
 
247
  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
536
248
])
537
249
 
538
250
 
541
253
# Choose a directory name for dependency files.
542
254
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
543
255
AC_DEFUN([AM_SET_DEPDIR],
544
 
[rm -f .deps 2>/dev/null
545
 
mkdir .deps 2>/dev/null
546
 
if test -d .deps; then
547
 
  DEPDIR=.deps
548
 
else
549
 
  # MS-DOS does not allow filenames that begin with a dot.
550
 
  DEPDIR=_deps
551
 
fi
552
 
rmdir .deps 2>/dev/null
553
 
AC_SUBST([DEPDIR])
 
256
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 
257
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
554
258
])
555
259
 
556
260
 
558
262
# ------------
559
263
AC_DEFUN([AM_DEP_TRACK],
560
264
[AC_ARG_ENABLE(dependency-tracking,
561
 
[  --disable-dependency-tracking Speeds up one-time builds
562
 
  --enable-dependency-tracking  Do not reject slow dependency extractors])
 
265
[  --disable-dependency-tracking  speeds up one-time build
 
266
  --enable-dependency-tracking   do not reject slow dependency extractors])
563
267
if test "x$enable_dependency_tracking" != xno; then
564
268
  am_depcomp="$ac_aux_dir/depcomp"
565
269
  AMDEPBACKSLASH='\'
568
272
AC_SUBST([AMDEPBACKSLASH])
569
273
])
570
274
 
571
 
# Generate code to set up dependency tracking.   -*- Autoconf -*-
572
 
 
573
 
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
574
 
 
575
 
# This program is free software; you can redistribute it and/or modify
576
 
# it under the terms of the GNU General Public License as published by
577
 
# the Free Software Foundation; either version 2, or (at your option)
578
 
# any later version.
579
 
 
580
 
# This program is distributed in the hope that it will be useful,
581
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
582
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
583
 
# GNU General Public License for more details.
584
 
 
585
 
# You should have received a copy of the GNU General Public License
586
 
# along with this program; if not, write to the Free Software
587
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
588
 
# 02111-1307, USA.
589
 
 
590
 
#serial 2
 
275
# Generate code to set up dependency tracking.              -*- Autoconf -*-
 
276
 
 
277
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
278
# Free Software Foundation, Inc.
 
279
#
 
280
# This file is free software; the Free Software Foundation
 
281
# gives unlimited permission to copy and/or distribute it,
 
282
# with or without modifications, as long as this notice is preserved.
 
283
 
 
284
#serial 3
591
285
 
592
286
# _AM_OUTPUT_DEPENDENCY_COMMANDS
593
287
# ------------------------------
606
300
  else
607
301
    continue
608
302
  fi
609
 
  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
610
 
  # Extract the definition of DEP_FILES from the Makefile without
611
 
  # running `make'.
612
 
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
 
303
  # Extract the definition of DEPDIR, am__include, and am__quote
 
304
  # from the Makefile without running `make'.
 
305
  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
613
306
  test -z "$DEPDIR" && continue
 
307
  am__include=`sed -n 's/^am__include = //p' < "$mf"`
 
308
  test -z "am__include" && continue
 
309
  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
614
310
  # When using ansi2knr, U may be empty or an underscore; expand it
615
 
  U=`sed -n -e '/^U = / s///p' < "$mf"`
616
 
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
617
 
  # We invoke sed twice because it is the simplest approach to
618
 
  # changing $(DEPDIR) to its actual value in the expansion.
619
 
  for file in `sed -n -e '
620
 
    /^DEP_FILES = .*\\\\$/ {
621
 
      s/^DEP_FILES = //
622
 
      :loop
623
 
        s/\\\\$//
624
 
        p
625
 
        n
626
 
        /\\\\$/ b loop
627
 
      p
628
 
    }
629
 
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
 
311
  U=`sed -n 's/^U = //p' < "$mf"`
 
312
  # Find all dependency output files, they are included files with
 
313
  # $(DEPDIR) in their names.  We invoke sed twice because it is the
 
314
  # simplest approach to changing $(DEPDIR) to its actual value in the
 
315
  # expansion.
 
316
  for file in `sed -n "
 
317
    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
630
318
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
631
319
    # Make sure the directory exists.
632
320
    test -f "$dirpart/$file" && continue
652
340
     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
653
341
])
654
342
 
655
 
# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
656
 
 
657
 
# This program is free software; you can redistribute it and/or modify
658
 
# it under the terms of the GNU General Public License as published by
659
 
# the Free Software Foundation; either version 2, or (at your option)
660
 
# any later version.
661
 
 
662
 
# This program is distributed in the hope that it will be useful,
663
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
664
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
665
 
# GNU General Public License for more details.
666
 
 
667
 
# You should have received a copy of the GNU General Public License
668
 
# along with this program; if not, write to the Free Software
669
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
670
 
# 02111-1307, USA.
 
343
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
 
344
# Free Software Foundation, Inc.
 
345
#
 
346
# This file is free software; the Free Software Foundation
 
347
# gives unlimited permission to copy and/or distribute it,
 
348
# with or without modifications, as long as this notice is preserved.
 
349
 
 
350
# serial 8
 
351
 
 
352
# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
 
353
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 
354
 
 
355
# Do all the work for Automake.                             -*- Autoconf -*-
 
356
 
 
357
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
358
# Free Software Foundation, Inc.
 
359
#
 
360
# This file is free software; the Free Software Foundation
 
361
# gives unlimited permission to copy and/or distribute it,
 
362
# with or without modifications, as long as this notice is preserved.
 
363
 
 
364
# serial 12
 
365
 
 
366
# This macro actually does too much.  Some checks are only needed if
 
367
# your package does certain things.  But this isn't really a big deal.
 
368
 
 
369
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 
370
# AM_INIT_AUTOMAKE([OPTIONS])
 
371
# -----------------------------------------------
 
372
# The call with PACKAGE and VERSION arguments is the old style
 
373
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
 
374
# and VERSION should now be passed to AC_INIT and removed from
 
375
# the call to AM_INIT_AUTOMAKE.
 
376
# We support both call styles for the transition.  After
 
377
# the next Automake release, Autoconf can make the AC_INIT
 
378
# arguments mandatory, and then we can depend on a new Autoconf
 
379
# release and drop the old call support.
 
380
AC_DEFUN([AM_INIT_AUTOMAKE],
 
381
[AC_PREREQ([2.58])dnl
 
382
dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 
383
dnl the ones we care about.
 
384
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 
385
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 
386
AC_REQUIRE([AC_PROG_INSTALL])dnl
 
387
# test to see if srcdir already configured
 
388
if test "`cd $srcdir && pwd`" != "`pwd`" &&
 
389
   test -f $srcdir/config.status; then
 
390
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
391
fi
 
392
 
 
393
# test whether we have cygpath
 
394
if test -z "$CYGPATH_W"; then
 
395
  if (cygpath --version) >/dev/null 2>/dev/null; then
 
396
    CYGPATH_W='cygpath -w'
 
397
  else
 
398
    CYGPATH_W=echo
 
399
  fi
 
400
fi
 
401
AC_SUBST([CYGPATH_W])
 
402
 
 
403
# Define the identity of the package.
 
404
dnl Distinguish between old-style and new-style calls.
 
405
m4_ifval([$2],
 
406
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 
407
 AC_SUBST([PACKAGE], [$1])dnl
 
408
 AC_SUBST([VERSION], [$2])],
 
409
[_AM_SET_OPTIONS([$1])dnl
 
410
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
 
411
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
412
 
 
413
_AM_IF_OPTION([no-define],,
 
414
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 
415
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
416
 
 
417
# Some tools Automake needs.
 
418
AC_REQUIRE([AM_SANITY_CHECK])dnl
 
419
AC_REQUIRE([AC_ARG_PROGRAM])dnl
 
420
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
 
421
AM_MISSING_PROG(AUTOCONF, autoconf)
 
422
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 
423
AM_MISSING_PROG(AUTOHEADER, autoheader)
 
424
AM_MISSING_PROG(MAKEINFO, makeinfo)
 
425
AM_PROG_INSTALL_SH
 
426
AM_PROG_INSTALL_STRIP
 
427
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 
428
# We need awk for the "check" target.  The system "awk" is bad on
 
429
# some platforms.
 
430
AC_REQUIRE([AC_PROG_AWK])dnl
 
431
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
432
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 
433
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 
434
              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
 
435
                             [_AM_PROG_TAR([v7])])])
 
436
_AM_IF_OPTION([no-dependencies],,
 
437
[AC_PROVIDE_IFELSE([AC_PROG_CC],
 
438
                  [_AM_DEPENDENCIES(CC)],
 
439
                  [define([AC_PROG_CC],
 
440
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 
441
AC_PROVIDE_IFELSE([AC_PROG_CXX],
 
442
                  [_AM_DEPENDENCIES(CXX)],
 
443
                  [define([AC_PROG_CXX],
 
444
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
445
])
 
446
])
 
447
 
 
448
 
 
449
# When config.status generates a header, we must update the stamp-h file.
 
450
# This file resides in the same directory as the config header
 
451
# that is generated.  The stamp files are numbered to have different names.
 
452
 
 
453
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
 
454
# loop where config.status creates the headers, so we can generate
 
455
# our stamp files there.
 
456
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 
457
[# Compute $1's index in $config_headers.
 
458
_am_stamp_count=1
 
459
for _am_header in $config_headers :; do
 
460
  case $_am_header in
 
461
    $1 | $1:* )
 
462
      break ;;
 
463
    * )
 
464
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
 
465
  esac
 
466
done
 
467
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
468
 
 
469
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
470
#
 
471
# This file is free software; the Free Software Foundation
 
472
# gives unlimited permission to copy and/or distribute it,
 
473
# with or without modifications, as long as this notice is preserved.
 
474
 
 
475
# AM_PROG_INSTALL_SH
 
476
# ------------------
 
477
# Define $install_sh.
 
478
AC_DEFUN([AM_PROG_INSTALL_SH],
 
479
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
480
install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
481
AC_SUBST(install_sh)])
 
482
 
 
483
# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
 
484
#
 
485
# This file is free software; the Free Software Foundation
 
486
# gives unlimited permission to copy and/or distribute it,
 
487
# with or without modifications, as long as this notice is preserved.
671
488
 
672
489
# serial 2
673
490
 
 
491
# Check whether the underlying file-system supports filenames
 
492
# with a leading dot.  For instance MS-DOS doesn't.
 
493
AC_DEFUN([AM_SET_LEADING_DOT],
 
494
[rm -rf .tst 2>/dev/null
 
495
mkdir .tst 2>/dev/null
 
496
if test -d .tst; then
 
497
  am__leading_dot=.
 
498
else
 
499
  am__leading_dot=_
 
500
fi
 
501
rmdir .tst 2>/dev/null
 
502
AC_SUBST([am__leading_dot])])
 
503
 
 
504
# Check to see how 'make' treats includes.                  -*- Autoconf -*-
 
505
 
 
506
# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
 
507
#
 
508
# This file is free software; the Free Software Foundation
 
509
# gives unlimited permission to copy and/or distribute it,
 
510
# with or without modifications, as long as this notice is preserved.
 
511
 
 
512
# serial 3
 
513
 
674
514
# AM_MAKE_INCLUDE()
675
515
# -----------------
676
516
# Check to see how make treats includes.
677
517
AC_DEFUN([AM_MAKE_INCLUDE],
678
518
[am_make=${MAKE-make}
679
519
cat > confinc << 'END'
680
 
doit:
 
520
am__doit:
681
521
        @echo done
 
522
.PHONY: am__doit
682
523
END
683
524
# If we don't find an include directive, just comment out the code.
684
525
AC_MSG_CHECKING([for style of include used by $am_make])
692
533
# In particular we don't look at `^make:' because GNU make might
693
534
# be invoked under some other name (usually "gmake"), in which
694
535
# case it prints its new name instead of `make'.
695
 
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
 
536
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
696
537
   am__include=include
697
538
   am__quote=
698
539
   _am_result=GNU
706
547
      _am_result=BSD
707
548
   fi
708
549
fi
709
 
AC_SUBST(am__include)
710
 
AC_SUBST(am__quote)
711
 
AC_MSG_RESULT($_am_result)
 
550
AC_SUBST([am__include])
 
551
AC_SUBST([am__quote])
 
552
AC_MSG_RESULT([$_am_result])
712
553
rm -f confinc confmf
713
554
])
714
555
 
715
 
# AM_CONDITIONAL                                              -*- Autoconf -*-
716
 
 
717
 
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
718
 
 
719
 
# This program is free software; you can redistribute it and/or modify
720
 
# it under the terms of the GNU General Public License as published by
721
 
# the Free Software Foundation; either version 2, or (at your option)
722
 
# any later version.
723
 
 
724
 
# This program is distributed in the hope that it will be useful,
725
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
726
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
727
 
# GNU General Public License for more details.
728
 
 
729
 
# You should have received a copy of the GNU General Public License
730
 
# along with this program; if not, write to the Free Software
731
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
732
 
# 02111-1307, USA.
733
 
 
734
 
# serial 5
735
 
 
736
 
AC_PREREQ(2.52)
737
 
 
738
 
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
739
 
# -------------------------------------
740
 
# Define a conditional.
741
 
AC_DEFUN([AM_CONDITIONAL],
742
 
[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
743
 
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
744
 
AC_SUBST([$1_TRUE])
745
 
AC_SUBST([$1_FALSE])
746
 
if $2; then
747
 
  $1_TRUE=
748
 
  $1_FALSE='#'
749
 
else
750
 
  $1_TRUE='#'
751
 
  $1_FALSE=
752
 
fi
753
 
AC_CONFIG_COMMANDS_PRE(
754
 
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
755
 
  AC_MSG_ERROR([conditional \"$1\" was never defined.
756
 
Usually this means the macro was only invoked conditionally.])
757
 
fi])])
758
 
 
759
 
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
760
 
 
761
 
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
762
 
 
763
 
# This program is free software; you can redistribute it and/or modify
764
 
# it under the terms of the GNU General Public License as published by
765
 
# the Free Software Foundation; either version 2, or (at your option)
766
 
# any later version.
767
 
 
768
 
# This program is distributed in the hope that it will be useful,
769
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
770
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
771
 
# GNU General Public License for more details.
772
 
 
773
 
# You should have received a copy of the GNU General Public License
774
 
# along with this program; if not, write to the Free Software
775
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
776
 
# 02111-1307, USA.
777
 
 
778
 
AC_PREREQ([2.52])
779
 
 
780
 
# serial 6
781
 
 
782
 
# When config.status generates a header, we must update the stamp-h file.
783
 
# This file resides in the same directory as the config header
784
 
# that is generated.  We must strip everything past the first ":",
785
 
# and everything past the last "/".
786
 
 
787
 
# _AM_DIRNAME(PATH)
788
 
# -----------------
789
 
# Like AS_DIRNAME, only do it during macro expansion
790
 
AC_DEFUN([_AM_DIRNAME],
791
 
       [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
792
 
              m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
793
 
                    m4_if(regexp([$1], [^/.*]), -1,
794
 
                          [.],
795
 
                          patsubst([$1], [^\(/\).*], [\1])),
796
 
                    patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
797
 
              patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
798
 
])# _AM_DIRNAME
799
 
 
800
 
 
801
 
# The stamp files are numbered to have different names.
802
 
# We could number them on a directory basis, but that's additional
803
 
# complications, let's have a unique counter.
804
 
m4_define([_AM_STAMP_Count], [0])
805
 
 
806
 
 
807
 
# _AM_STAMP(HEADER)
808
 
# -----------------
809
 
# The name of the stamp file for HEADER.
810
 
AC_DEFUN([_AM_STAMP],
811
 
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
812
 
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
813
 
                               [:.*])))/stamp-h[]_AM_STAMP_Count])
814
 
 
815
 
 
816
 
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
817
 
# ------------------------------------------------------------
818
 
# We used to try to get a real timestamp in stamp-h.  But the fear is that
819
 
# that will cause unnecessary cvs conflicts.
820
 
AC_DEFUN([_AM_CONFIG_HEADER],
821
 
[# Add the stamp file to the list of files AC keeps track of,
822
 
# along with our hook.
823
 
AC_CONFIG_HEADERS([$1],
824
 
                  [# update the timestamp
825
 
echo 'timestamp for $1' >"_AM_STAMP([$1])"
826
 
$2],
827
 
                  [$3])
828
 
])# _AM_CONFIG_HEADER
829
 
 
830
 
 
831
 
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
832
 
# --------------------------------------------------------------
833
 
AC_DEFUN([AM_CONFIG_HEADER],
834
 
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
835
 
])# AM_CONFIG_HEADER
 
556
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
557
 
 
558
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
 
559
# Free Software Foundation, Inc.
 
560
#
 
561
# This file is free software; the Free Software Foundation
 
562
# gives unlimited permission to copy and/or distribute it,
 
563
# with or without modifications, as long as this notice is preserved.
 
564
 
 
565
# serial 4
 
566
 
 
567
# AM_MISSING_PROG(NAME, PROGRAM)
 
568
# ------------------------------
 
569
AC_DEFUN([AM_MISSING_PROG],
 
570
[AC_REQUIRE([AM_MISSING_HAS_RUN])
 
571
$1=${$1-"${am_missing_run}$2"}
 
572
AC_SUBST($1)])
 
573
 
 
574
 
 
575
# AM_MISSING_HAS_RUN
 
576
# ------------------
 
577
# Define MISSING if not defined so far and test if it supports --run.
 
578
# If it does, set am_missing_run to use it, otherwise, to nothing.
 
579
AC_DEFUN([AM_MISSING_HAS_RUN],
 
580
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
581
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 
582
# Use eval to expand $SHELL
 
583
if eval "$MISSING --run true"; then
 
584
  am_missing_run="$MISSING --run "
 
585
else
 
586
  am_missing_run=
 
587
  AC_MSG_WARN([`missing' script is too old or missing])
 
588
fi
 
589
])
 
590
 
 
591
# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
 
592
#
 
593
# This file is free software; the Free Software Foundation
 
594
# gives unlimited permission to copy and/or distribute it,
 
595
# with or without modifications, as long as this notice is preserved.
 
596
 
 
597
# AM_PROG_MKDIR_P
 
598
# ---------------
 
599
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
 
600
#
 
601
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
 
602
# created by `make install' are always world readable, even if the
 
603
# installer happens to have an overly restrictive umask (e.g. 077).
 
604
# This was a mistake.  There are at least two reasons why we must not
 
605
# use `-m 0755':
 
606
#   - it causes special bits like SGID to be ignored,
 
607
#   - it may be too restrictive (some setups expect 775 directories).
 
608
#
 
609
# Do not use -m 0755 and let people choose whatever they expect by
 
610
# setting umask.
 
611
#
 
612
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
 
613
# Some implementations (such as Solaris 8's) are not thread-safe: if a
 
614
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
 
615
# concurrently, both version can detect that a/ is missing, but only
 
616
# one can create it and the other will error out.  Consequently we
 
617
# restrict ourselves to GNU make (using the --version option ensures
 
618
# this.)
 
619
AC_DEFUN([AM_PROG_MKDIR_P],
 
620
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
 
621
  # We used to keeping the `.' as first argument, in order to
 
622
  # allow $(mkdir_p) to be used without argument.  As in
 
623
  #   $(mkdir_p) $(somedir)
 
624
  # where $(somedir) is conditionally defined.  However this is wrong
 
625
  # for two reasons:
 
626
  #  1. if the package is installed by a user who cannot write `.'
 
627
  #     make install will fail,
 
628
  #  2. the above comment should most certainly read
 
629
  #     $(mkdir_p) $(DESTDIR)$(somedir)
 
630
  #     so it does not work when $(somedir) is undefined and
 
631
  #     $(DESTDIR) is not.
 
632
  #  To support the latter case, we have to write
 
633
  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
 
634
  #  so the `.' trick is pointless.
 
635
  mkdir_p='mkdir -p --'
 
636
else
 
637
  # On NextStep and OpenStep, the `mkdir' command does not
 
638
  # recognize any option.  It will interpret all options as
 
639
  # directories to create, and then abort because `.' already
 
640
  # exists.
 
641
  for d in ./-p ./--version;
 
642
  do
 
643
    test -d $d && rmdir $d
 
644
  done
 
645
  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
 
646
  if test -f "$ac_aux_dir/mkinstalldirs"; then
 
647
    mkdir_p='$(mkinstalldirs)'
 
648
  else
 
649
    mkdir_p='$(install_sh) -d'
 
650
  fi
 
651
fi
 
652
AC_SUBST([mkdir_p])])
 
653
 
 
654
# Helper functions for option handling.                     -*- Autoconf -*-
 
655
 
 
656
# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
 
657
#
 
658
# This file is free software; the Free Software Foundation
 
659
# gives unlimited permission to copy and/or distribute it,
 
660
# with or without modifications, as long as this notice is preserved.
 
661
 
 
662
# serial 3
 
663
 
 
664
# _AM_MANGLE_OPTION(NAME)
 
665
# -----------------------
 
666
AC_DEFUN([_AM_MANGLE_OPTION],
 
667
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
668
 
 
669
# _AM_SET_OPTION(NAME)
 
670
# ------------------------------
 
671
# Set option NAME.  Presently that only means defining a flag for this option.
 
672
AC_DEFUN([_AM_SET_OPTION],
 
673
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
674
 
 
675
# _AM_SET_OPTIONS(OPTIONS)
 
676
# ----------------------------------
 
677
# OPTIONS is a space-separated list of Automake options.
 
678
AC_DEFUN([_AM_SET_OPTIONS],
 
679
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
680
 
 
681
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 
682
# -------------------------------------------
 
683
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
 
684
AC_DEFUN([_AM_IF_OPTION],
 
685
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
686
 
 
687
# Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
688
 
 
689
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
 
690
# Free Software Foundation, Inc.
 
691
#
 
692
# This file is free software; the Free Software Foundation
 
693
# gives unlimited permission to copy and/or distribute it,
 
694
# with or without modifications, as long as this notice is preserved.
 
695
 
 
696
# serial 4
 
697
 
 
698
# AM_SANITY_CHECK
 
699
# ---------------
 
700
AC_DEFUN([AM_SANITY_CHECK],
 
701
[AC_MSG_CHECKING([whether build environment is sane])
 
702
# Just in case
 
703
sleep 1
 
704
echo timestamp > conftest.file
 
705
# Do `set' in a subshell so we don't clobber the current shell's
 
706
# arguments.  Must try -L first in case configure is actually a
 
707
# symlink; some systems play weird games with the mod time of symlinks
 
708
# (eg FreeBSD returns the mod time of the symlink's containing
 
709
# directory).
 
710
if (
 
711
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 
712
   if test "$[*]" = "X"; then
 
713
      # -L didn't work.
 
714
      set X `ls -t $srcdir/configure conftest.file`
 
715
   fi
 
716
   rm -f conftest.file
 
717
   if test "$[*]" != "X $srcdir/configure conftest.file" \
 
718
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
719
 
 
720
      # If neither matched, then we have a broken ls.  This can happen
 
721
      # if, for instance, CONFIG_SHELL is bash and it inherits a
 
722
      # broken ls alias from the environment.  This has actually
 
723
      # happened.  Such a system could not be considered "sane".
 
724
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
 
725
alias in your environment])
 
726
   fi
 
727
 
 
728
   test "$[2]" = conftest.file
 
729
   )
 
730
then
 
731
   # Ok.
 
732
   :
 
733
else
 
734
   AC_MSG_ERROR([newly created file is older than distributed files!
 
735
Check your system clock])
 
736
fi
 
737
AC_MSG_RESULT(yes)])
 
738
 
 
739
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
740
#
 
741
# This file is free software; the Free Software Foundation
 
742
# gives unlimited permission to copy and/or distribute it,
 
743
# with or without modifications, as long as this notice is preserved.
 
744
 
 
745
# AM_PROG_INSTALL_STRIP
 
746
# ---------------------
 
747
# One issue with vendor `install' (even GNU) is that you can't
 
748
# specify the program used to strip binaries.  This is especially
 
749
# annoying in cross-compiling environments, where the build's strip
 
750
# is unlikely to handle the host's binaries.
 
751
# Fortunately install-sh will honor a STRIPPROG variable, so we
 
752
# always use install-sh in `make install-strip', and initialize
 
753
# STRIPPROG with the value of the STRIP variable (set by the user).
 
754
AC_DEFUN([AM_PROG_INSTALL_STRIP],
 
755
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 
756
# Installed binaries are usually stripped using `strip' when the user
 
757
# run `make install-strip'.  However `strip' might not be the right
 
758
# tool to use in cross-compilation environments, therefore Automake
 
759
# will honor the `STRIP' environment variable to overrule this program.
 
760
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
 
761
if test "$cross_compiling" != no; then
 
762
  AC_CHECK_TOOL([STRIP], [strip], :)
 
763
fi
 
764
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
765
AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
766
 
 
767
# Check how to create a tarball.                            -*- Autoconf -*-
 
768
 
 
769
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
770
#
 
771
# This file is free software; the Free Software Foundation
 
772
# gives unlimited permission to copy and/or distribute it,
 
773
# with or without modifications, as long as this notice is preserved.
 
774
 
 
775
# serial 2
 
776
 
 
777
# _AM_PROG_TAR(FORMAT)
 
778
# --------------------
 
779
# Check how to create a tarball in format FORMAT.
 
780
# FORMAT should be one of `v7', `ustar', or `pax'.
 
781
#
 
782
# Substitute a variable $(am__tar) that is a command
 
783
# writing to stdout a FORMAT-tarball containing the directory
 
784
# $tardir.
 
785
#     tardir=directory && $(am__tar) > result.tar
 
786
#
 
787
# Substitute a variable $(am__untar) that extract such
 
788
# a tarball read from stdin.
 
789
#     $(am__untar) < result.tar
 
790
AC_DEFUN([_AM_PROG_TAR],
 
791
[# Always define AMTAR for backward compatibility.
 
792
AM_MISSING_PROG([AMTAR], [tar])
 
793
m4_if([$1], [v7],
 
794
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
 
795
     [m4_case([$1], [ustar],, [pax],,
 
796
              [m4_fatal([Unknown tar format])])
 
797
AC_MSG_CHECKING([how to create a $1 tar archive])
 
798
# Loop over all known methods to create a tar archive until one works.
 
799
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 
800
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
 
801
# Do not fold the above two line into one, because Tru64 sh and
 
802
# Solaris sh will not grok spaces in the rhs of `-'.
 
803
for _am_tool in $_am_tools
 
804
do
 
805
  case $_am_tool in
 
806
  gnutar)
 
807
    for _am_tar in tar gnutar gtar;
 
808
    do
 
809
      AM_RUN_LOG([$_am_tar --version]) && break
 
810
    done
 
811
    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
 
812
    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
 
813
    am__untar="$_am_tar -xf -"
 
814
    ;;
 
815
  plaintar)
 
816
    # Must skip GNU tar: if it does not support --format= it doesn't create
 
817
    # ustar tarball either.
 
818
    (tar --version) >/dev/null 2>&1 && continue
 
819
    am__tar='tar chf - "$$tardir"'
 
820
    am__tar_='tar chf - "$tardir"'
 
821
    am__untar='tar xf -'
 
822
    ;;
 
823
  pax)
 
824
    am__tar='pax -L -x $1 -w "$$tardir"'
 
825
    am__tar_='pax -L -x $1 -w "$tardir"'
 
826
    am__untar='pax -r'
 
827
    ;;
 
828
  cpio)
 
829
    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
 
830
    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
 
831
    am__untar='cpio -i -H $1 -d'
 
832
    ;;
 
833
  none)
 
834
    am__tar=false
 
835
    am__tar_=false
 
836
    am__untar=false
 
837
    ;;
 
838
  esac
 
839
 
 
840
  # If the value was cached, stop now.  We just wanted to have am__tar
 
841
  # and am__untar set.
 
842
  test -n "${am_cv_prog_tar_$1}" && break
 
843
 
 
844
  # tar/untar a dummy directory, and stop if the command works
 
845
  rm -rf conftest.dir
 
846
  mkdir conftest.dir
 
847
  echo GrepMe > conftest.dir/file
 
848
  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
 
849
  rm -rf conftest.dir
 
850
  if test -s conftest.tar; then
 
851
    AM_RUN_LOG([$am__untar <conftest.tar])
 
852
    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
 
853
  fi
 
854
done
 
855
rm -rf conftest.dir
 
856
 
 
857
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
 
858
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
 
859
AC_SUBST([am__tar])
 
860
AC_SUBST([am__untar])
 
861
]) # _AM_PROG_TAR
836
862
 
837
863
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
838
864
 
7211
7237
AC_MSG_RESULT([$SED])
7212
7238
])
7213
7239
 
7214
 
AC_DEFUN([TORRENT_CHECK_CXXFLAGS], [
7215
 
 
7216
 
  AC_MSG_CHECKING([for user-defined CXXFLAGS])
7217
 
 
7218
 
  if test -n "$CXXFLAGS"; then
7219
 
    AC_MSG_RESULT([user-defined "$CXXFLAGS"])
7220
 
  else
7221
 
    CXXFLAGS="-O2 -Wall"
7222
 
    AC_MSG_RESULT([default "$CXXFLAGS"])
7223
 
  fi
7224
 
])
7225
 
 
7226
 
 
7227
 
AC_DEFUN([TORRENT_ENABLE_DEBUG], [
7228
 
  AC_ARG_ENABLE(debug,
7229
 
    [  --enable-debug          enable debug information [[default=yes]]],
7230
 
    [
7231
 
        if test "$enableval" = "yes"; then
7232
 
            CXXFLAGS="$CXXFLAGS -g -DDEBUG"
7233
 
        else
7234
 
            CXXFLAGS="$CXXFLAGS -DNDEBUG"
7235
 
        fi
7236
 
    ],[
7237
 
        CXXFLAGS="$CXXFLAGS -g -DDEBUG"
7238
 
  ])
7239
 
])
7240
 
 
7241
 
 
7242
 
AC_DEFUN([TORRENT_ENABLE_WERROR], [
7243
 
  AC_ARG_ENABLE(werror,
7244
 
    [  --enable-werror         enable the -Werror and -Wall flag [[default=no]]],
7245
 
    [
7246
 
        if test "$enableval" = "yes"; then
7247
 
            CXXFLAGS="$CXXFLAGS -Werror -Wall"
7248
 
        fi
7249
 
  ])
7250
 
])
7251
 
 
7252
 
 
7253
 
AC_DEFUN([TORRENT_ENABLE_EXTRA_DEBUG], [
7254
 
  AC_ARG_ENABLE(extra-debug,
7255
 
    [  --enable-extra-debug    enable extra debugging checks. [[default=no]]],
7256
 
    [
7257
 
        if test "$enableval" = "yes"; then
7258
 
            AC_DEFINE(USE_EXTRA_DEBUG, 1, Enable extra debugging checks.)
7259
 
        fi
7260
 
    ])
7261
 
])
7262
 
 
7263
 
 
7264
 
AC_DEFUN([TORRENT_OTFD], [
7265
 
  AC_LANG_PUSH(C++)
7266
 
  AC_MSG_CHECKING(for proper overloaded template function disambiguation)
7267
 
 
7268
 
  AC_COMPILE_IFELSE(
7269
 
    [[template <typename T> void f(T&) {}
7270
 
      template <typename T> void f(T*) {}
7271
 
      int main() { int *i = 0; f(*i); f(i); }
7272
 
    ]],
7273
 
    [
7274
 
      AC_MSG_RESULT(yes)
7275
 
    ], [
7276
 
      AC_MSG_RESULT(no)
7277
 
      AC_MSG_ERROR([your compiler does not properly handle overloaded template function disambiguation])
7278
 
  ])
7279
 
 
7280
 
  AC_LANG_POP(C++)
7281
 
])
7282
 
 
7283
 
 
7284
 
AC_DEFUN([TORRENT_MINCORE_SIGNEDNESS], [
7285
 
  AC_LANG_PUSH(C++)
7286
 
  AC_MSG_CHECKING(signedness of mincore parameter)
7287
 
 
7288
 
  AC_COMPILE_IFELSE(
7289
 
    [[#include <sys/types.h>
7290
 
      #include <sys/mman.h>
7291
 
      #include <unistd.h>
7292
 
      void f() { mincore((char*)0, 0, (unsigned char*)0); }
7293
 
    ]],
7294
 
    [
7295
 
      AC_DEFINE(USE_MINCORE, 1, Use mincore)
7296
 
      AC_DEFINE(USE_MINCORE_UNSIGNED, 1, use unsigned char* in mincore)
7297
 
      AC_MSG_RESULT(unsigned)
7298
 
    ],
7299
 
    [
7300
 
      AC_COMPILE_IFELSE(
7301
 
        [[#include <sys/types.h>
7302
 
          #include <sys/mman.h>
7303
 
          #include <unistd.h>
7304
 
          void f() { mincore((char*)0, 0, (char*)0); }
7305
 
        ]],
7306
 
        [
7307
 
          AC_DEFINE(USE_MINCORE, 1, Use mincore)
7308
 
          AC_DEFINE(USE_MINCORE_UNSIGNED, 0, use char* in mincore)
7309
 
          AC_MSG_RESULT(signed)
7310
 
        ],
7311
 
        [
7312
 
          AC_MSG_ERROR([failed, do *not* attempt to use --disable-mincore unless you are running Win32.])
7313
 
      ])
7314
 
  ])
7315
 
 
7316
 
  AC_LANG_POP(C++)
7317
 
])
7318
 
 
7319
 
AC_DEFUN([TORRENT_MINCORE], [
7320
 
  AC_ARG_ENABLE(mincore,
7321
 
    [  --disable-mincore       disable mincore check [[default=enable]]],
7322
 
    [
7323
 
      if test "$enableval" = "yes"; then
7324
 
        TORRENT_MINCORE_SIGNEDNESS()
7325
 
      else
7326
 
        AC_MSG_CHECKING(for mincore)
7327
 
        AC_MSG_RESULT(disabled)
7328
 
      fi
7329
 
    ],[
7330
 
        TORRENT_MINCORE_SIGNEDNESS()
7331
 
    ])
7332
 
])
7333
 
 
7334
 
AC_DEFUN([TORRENT_CHECK_MADVISE], [
7335
 
  AC_MSG_CHECKING(for madvise)
7336
 
 
7337
 
  AC_COMPILE_IFELSE(
7338
 
    [[#include <sys/types.h>
7339
 
          #include <sys/mman.h>
7340
 
          void f() { static char test[1024]; madvise((void *)test, sizeof(test), MADV_NORMAL); }
7341
 
    ]],
7342
 
    [
7343
 
      AC_MSG_RESULT(yes)
7344
 
      AC_DEFINE(USE_MADVISE, 1, Use madvise)
7345
 
    ], [
7346
 
      AC_MSG_RESULT(no)
7347
 
  ])
7348
 
])
7349
 
 
7350
 
AC_DEFUN([TORRENT_CHECK_EXECINFO], [
7351
 
  AC_MSG_CHECKING(for execinfo.h)
7352
 
 
7353
 
  AC_COMPILE_IFELSE(
7354
 
    [[#include <execinfo.h>
7355
 
      int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
7356
 
    ]],
7357
 
    [
7358
 
      AC_MSG_RESULT(yes)
7359
 
      AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h)
7360
 
    ], [
7361
 
      AC_MSG_RESULT(no)
7362
 
  ])
7363
 
])
7364
 
 
7365
 
AC_DEFUN([TORRENT_CHECK_ALIGNED], [
7366
 
  AC_MSG_CHECKING(the byte alignment)
7367
 
 
7368
 
  AC_RUN_IFELSE(
7369
 
    [[#include <inttypes.h>
7370
 
      int main() {
7371
 
        char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 };
7372
 
        int i;
7373
 
        for (i = 1; i < 4; ++i)
7374
 
          if (*(uint32_t*)(buf + i) == 0) return -1;
7375
 
        return 0;
7376
 
        }
7377
 
    ]],
7378
 
    [
7379
 
      AC_MSG_RESULT(none needed)
7380
 
    ], [
7381
 
      AC_DEFINE(USE_ALIGNED, 1, Require byte alignment)
7382
 
      AC_MSG_RESULT(required)
7383
 
  ])
7384
 
])
7385
 
 
7386
 
 
7387
 
AC_DEFUN([TORRENT_ENABLE_ALIGNED], [
7388
 
  AC_ARG_ENABLE(aligned,
7389
 
    [  --enable-aligned        enable alignment safe code [[default=check]]],
7390
 
    [
7391
 
        if test "$enableval" = "yes"; then
7392
 
          AC_DEFINE(USE_ALIGNED, 1, Require byte alignment)
7393
 
        fi
7394
 
    ],[
7395
 
        TORRENT_CHECK_ALIGNED
7396
 
  ])
7397
 
])
7398
 
 
7399
 
 
7400
 
AC_DEFUN([TORRENT_DISABLE_IPV6], [
7401
 
  AC_ARG_ENABLE(ipv6,
7402
 
    [  --enable-ipv6           disable ipv6 [[default=no]]],
7403
 
    [
7404
 
        if test "$enableval" = "yes"; then
7405
 
            AC_DEFINE(RAK_USE_INET6, 1, enable ipv6 stuff)
7406
 
        fi
7407
 
    ])
7408
 
])
7409
 
 
7410
 
AC_DEFUN([TORRENT_CHECK_XFS], [
7411
 
  AC_MSG_CHECKING(for XFS support)
7412
 
 
7413
 
  AC_COMPILE_IFELSE(
7414
 
    [[#include <xfs/libxfs.h>
7415
 
      #include <sys/ioctl.h>
7416
 
      int main() {
7417
 
        struct xfs_flock64 l;
7418
 
        ioctl(0, XFS_IOC_RESVSP64, &l);
7419
 
        return 0;
7420
 
      }
7421
 
    ]],
7422
 
    [
7423
 
      AC_DEFINE(USE_XFS, 1, Use XFS filesystem stuff.)
7424
 
      AC_MSG_RESULT(yes)
7425
 
    ], [
7426
 
      AC_MSG_RESULT(no)
7427
 
    ])
7428
 
])
7429
 
 
7430
 
 
7431
 
AC_DEFUN([TORRENT_WITHOUT_XFS], [
7432
 
  AC_ARG_WITH(xfs,
7433
 
    [  --without-xfs           Do not check for XFS filesystem support],
7434
 
    [
7435
 
      if test "$withval" = "yes"; then
7436
 
        TORRENT_CHECK_XFS
7437
 
      fi
7438
 
    ], [
7439
 
        TORRENT_CHECK_XFS
7440
 
    ])
7441
 
])
7442
 
 
7443
 
 
7444
 
AC_DEFUN([TORRENT_WITH_XFS], [
7445
 
  AC_ARG_WITH(xfs,
7446
 
    [  --with-xfs           Check for XFS filesystem support],
7447
 
    [
7448
 
      if test "$withval" = "yes"; then
7449
 
        TORRENT_CHECK_XFS
7450
 
      fi
7451
 
    ])
7452
 
])
7453
 
 
7454
 
 
7455
 
AC_DEFUN([TORRENT_CHECK_EPOLL], [
7456
 
  AC_MSG_CHECKING(for epoll support)
7457
 
 
7458
 
  AC_COMPILE_IFELSE(
7459
 
    [[#include <sys/epoll.h>
7460
 
      int main() {
7461
 
        int fd = epoll_create(100);
7462
 
        return 0;
7463
 
      }
7464
 
    ]],
7465
 
    [
7466
 
      AC_DEFINE(USE_EPOLL, 1, Use epoll.)
7467
 
      AC_MSG_RESULT(yes)
7468
 
    ], [
7469
 
      AC_MSG_RESULT(no)
7470
 
    ])
7471
 
])
7472
 
 
7473
 
 
7474
 
AC_DEFUN([TORRENT_WITHOUT_EPOLL], [
7475
 
  AC_ARG_WITH(epoll,
7476
 
    [  --without-epoll         Do not check for epoll support.],
7477
 
    [
7478
 
      if test "$withval" = "yes"; then
7479
 
        TORRENT_CHECK_EPOLL
7480
 
      fi
7481
 
    ], [
7482
 
        TORRENT_CHECK_EPOLL
7483
 
    ])
7484
 
])
7485
 
 
7486
 
 
7487
 
AC_DEFUN([TORRENT_WITH_KQUEUE], [
7488
 
  AC_ARG_WITH(kqueue,
7489
 
    [  --with-kqueue                  enable kqueue. [[default=no]]],
7490
 
    [
7491
 
        if test "$withval" = "yes"; then
7492
 
            AC_DEFINE(USE_KQUEUE, 1, Enable kqueue.)
7493
 
        fi
7494
 
    ])
7495
 
])
7496
 
 
7497
 
 
7498
 
AC_DEFUN([TORRENT_WITHOUT_VARIABLE_FDSET], [
7499
 
  AC_ARG_WITH(variable-fdset,
7500
 
 
7501
 
    [  --without-variable-fdset       do not use non-portable variable sized fd_set's.],
7502
 
    [
7503
 
      if test "$withval" = "yes"; then
7504
 
        AC_DEFINE(USE_VARIABLE_FDSET, 1, defined when we allow the use of fd_set's of any size)
7505
 
      fi
7506
 
    ], [
7507
 
      AC_DEFINE(USE_VARIABLE_FDSET, 1, defined when we allow the use of fd_set's of any size)
7508
 
    ])
7509
 
])
7510
 
 
7511
 
 
7512
 
AC_DEFUN([TORRENT_CHECK_POSIX_FALLOCATE], [
7513
 
  AC_MSG_CHECKING(for posix_fallocate)
7514
 
 
7515
 
  AC_COMPILE_IFELSE(
7516
 
    [[#include <fcntl.h>
7517
 
      int main() {
7518
 
        posix_fallocate(0, 0, 0);
7519
 
        return 0;
7520
 
      }
7521
 
    ]],
7522
 
    [
7523
 
      AC_DEFINE(USE_POSIX_FALLOCATE, 1, posix_fallocate supported.)
7524
 
      AC_MSG_RESULT(yes)
7525
 
    ], [
7526
 
      AC_MSG_RESULT(no)
7527
 
    ])
7528
 
])
7529
 
 
7530
 
 
7531
 
AC_DEFUN([TORRENT_WITH_POSIX_FALLOCATE], [
7532
 
  AC_ARG_WITH(posix-fallocate,
7533
 
    [  --with-posix-fallocate  Check for and use posix_fallocate to allocate files.],
7534
 
    [
7535
 
      if test "$withval" = "yes"; then
7536
 
        TORRENT_CHECK_POSIX_FALLOCATE
7537
 
      fi
7538
 
    ])
7539
 
])
7540
 
 
7541
 
AC_DEFUN([TORRENT_WITHOUT_NCURSESW], [
7542
 
  AC_ARG_WITH(ncursesw,
7543
 
    [  --without-ncursesw      Don't try to use wide char ncurses.],
7544
 
    [
7545
 
      if test "$withval" = "no"; then
7546
 
        AC_SEARCH_LIBS(add_wch, ncursesw,
7547
 
          AC_DEFINE(HAVE_NCURSESW, 1, defined if ncurses wide character support is available),
7548
 
          AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
7549
 
        )
7550
 
      else
7551
 
        AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
7552
 
      fi
7553
 
    ],[
7554
 
      AC_SEARCH_LIBS(add_wch, ncursesw,
7555
 
        AC_DEFINE(HAVE_NCURSESW, 1, defined if ncurses wide character support is available),
7556
 
        AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
7557
 
      )
7558
 
    ])
7559
 
])
7560
 
 
7561
 
AC_DEFUN([TORRENT_CHECK_STATVFS], [
7562
 
  AC_CHECK_HEADERS(sys/vfs.h sys/statvfs.h sys/statfs.h)
7563
 
 
7564
 
  AC_MSG_CHECKING(for statvfs)
7565
 
 
7566
 
  AC_TRY_LINK(
7567
 
    [
7568
 
      #if HAVE_SYS_VFS_H
7569
 
      #include <sys/vfs.h>
7570
 
      #endif
7571
 
      #if HAVE_SYS_STATVFS_H
7572
 
      #include <sys/statvfs.h>
7573
 
      #endif
7574
 
      #if HAVE_SYS_STATFS_H
7575
 
      #include <sys/statfs.h>
7576
 
      #endif
7577
 
    ],[
7578
 
      struct statvfs s; fsblkcnt_t c;
7579
 
      statvfs("", &s);
7580
 
      fstatvfs(0, &s);
7581
 
    ],
7582
 
    [
7583
 
      AC_DEFINE(FS_STAT_FD, [fstatvfs(fd, &m_stat) == 0], Function to determine filesystem stats from fd)
7584
 
      AC_DEFINE(FS_STAT_FN, [statvfs(fn, &m_stat) == 0], Function to determine filesystem stats from filename)
7585
 
      AC_DEFINE(FS_STAT_STRUCT, [struct statvfs], Type of second argument to statfs function)
7586
 
      AC_DEFINE(FS_STAT_SIZE_TYPE, [unsigned long], Type of block size member in stat struct)
7587
 
      AC_DEFINE(FS_STAT_COUNT_TYPE, [fsblkcnt_t], Type of block count member in stat struct)
7588
 
      AC_DEFINE(FS_STAT_BLOCK_SIZE, [(m_stat.f_frsize)], Determine the block size)
7589
 
      AC_MSG_RESULT(ok)
7590
 
      have_stat_vfs=yes
7591
 
    ],
7592
 
    [
7593
 
      AC_MSG_RESULT(no)
7594
 
      have_stat_vfs=no
7595
 
    ])
7596
 
])
7597
 
 
7598
 
AC_DEFUN([TORRENT_CHECK_STATFS], [
7599
 
  AC_CHECK_HEADERS(sys/statfs.h sys/param.h sys/mount.h)
7600
 
 
7601
 
  AC_MSG_CHECKING(for statfs)
7602
 
 
7603
 
  AC_TRY_LINK(
7604
 
    [
7605
 
      #if HAVE_SYS_STATFS_H
7606
 
      #include <sys/statfs.h>
7607
 
      #endif
7608
 
      #if HAVE_SYS_PARAM_H
7609
 
      #include <sys/param.h>
7610
 
      #endif
7611
 
      #if HAVE_SYS_MOUNT_H
7612
 
      #include <sys/mount.h>
7613
 
      #endif
7614
 
    ],[
7615
 
      struct statfs s;
7616
 
      statfs("", &s);
7617
 
      fstatfs(0, &s);
7618
 
    ],
7619
 
    [
7620
 
      AC_DEFINE(FS_STAT_FD, [fstatfs(fd, &m_stat) == 0], Function to determine filesystem stats from fd)
7621
 
      AC_DEFINE(FS_STAT_FN, [statfs(fn, &m_stat) == 0], Function to determine filesystem stats from filename)
7622
 
      AC_DEFINE(FS_STAT_STRUCT, [struct statfs], Type of second argument to statfs function)
7623
 
      AC_DEFINE(FS_STAT_SIZE_TYPE, [long], Type of block size member in stat struct)
7624
 
      AC_DEFINE(FS_STAT_COUNT_TYPE, [long], Type of block count member in stat struct)
7625
 
      AC_DEFINE(FS_STAT_BLOCK_SIZE, [(m_stat.f_bsize)], Determine the block size)
7626
 
      AC_MSG_RESULT(ok)
7627
 
    ],
7628
 
    [
7629
 
      AC_MSG_RESULT(no)
7630
 
    ])
7631
 
])
7632
 
 
7633
 
AC_DEFUN([TORRENT_DISABLED_STATFS], [
7634
 
      AC_DEFINE(FS_STAT_FD, [(errno = ENOSYS) == 0], Function to determine filesystem stats from fd)
7635
 
      AC_DEFINE(FS_STAT_FN, [(errno = ENOSYS) == 0], Function to determine filesystem stats from filename)
7636
 
      AC_DEFINE(FS_STAT_STRUCT, [struct {blocksize_type  f_bsize; blockcount_type f_bavail;}], Type of second argument to statfs function)
7637
 
      AC_DEFINE(FS_STAT_SIZE_TYPE, [int], Type of block size member in stat struct)
7638
 
      AC_DEFINE(FS_STAT_COUNT_TYPE, [int], Type of block count member in stat struct)
7639
 
      AC_DEFINE(FS_STAT_BLOCK_SIZE, [(4096)], Determine the block size)
7640
 
      AC_MSG_RESULT(No filesystem stats available)
7641
 
])
7642
 
 
7643
 
AC_DEFUN([TORRENT_WITHOUT_STATVFS], [
7644
 
  AC_ARG_WITH(statvfs,
7645
 
    [  --without-statvfs       Don't try to use statvfs to find free diskspace.],
7646
 
    [
7647
 
      if test "$withval" = "yes"; then
7648
 
        TORRENT_CHECK_STATVFS
7649
 
      else
7650
 
        have_stat_vfs=no
7651
 
      fi
7652
 
    ],
7653
 
    [
7654
 
      TORRENT_CHECK_STATVFS
7655
 
    ])
7656
 
])
7657
 
 
7658
 
AC_DEFUN([TORRENT_WITHOUT_STATFS], [
7659
 
  AC_ARG_WITH(statfs,
7660
 
    [  --without-statfs        Don't try to use statfs to find free diskspace.],
7661
 
    [
7662
 
      if test "$have_stat_vfs" = "no"; then
7663
 
        if test "$withval" = "yes"; then
7664
 
          TORRENT_CHECK_STATFS
7665
 
        else
7666
 
          TORRENT_DISABLED_STATFS
7667
 
        fi
7668
 
      fi
7669
 
    ],
7670
 
    [
7671
 
      if test "$have_stat_vfs" = "no"; then
7672
 
        TORRENT_CHECK_STATFS
7673
 
        if test "$have_stat_vfs" = "no"; then
7674
 
          TORRENT_DISABLED_STATFS
7675
 
        fi
7676
 
      fi
7677
 
    ])
7678
 
])
7679
 
 
7680
 
AC_DEFUN([TORRENT_WITH_ADDRESS_SPACE], [
7681
 
  AC_ARG_WITH(address-space,
7682
 
    AC_HELP_STRING([--with-address-space=MB], [Change the default address space size, default 1024 MB.]),
7683
 
    [
7684
 
      if test ! -z $withval -a "$withval" != "yes" -a "$withval" != "no"; then
7685
 
        AC_DEFINE_UNQUOTED(DEFAULT_ADDRESS_SPACE_SIZE, [$withval])
7686
 
      else
7687
 
        AC_MSG_ERROR(--with-address-space requires a parameter.)
7688
 
      fi
7689
 
    ],
7690
 
    [
7691
 
      AC_CHECK_SIZEOF(long)
7692
 
 
7693
 
      if test $ac_cv_sizeof_long = 8; then
7694
 
        AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 4096, Default address space size.)
7695
 
      else
7696
 
        AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 1024, Default address space size.)
7697
 
      fi
7698
 
    ])
7699
 
])
7700
 
 
7701
 
# Functions to check for attributes support in compiler
7702
 
 
7703
 
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
7704
 
        AC_CACHE_CHECK([if compiler supports __attribute__((constructor))],
7705
 
                [cc_cv_attribute_constructor],
7706
 
                [AC_COMPILE_IFELSE([
7707
 
                        void ctor() __attribute__((constructor));
7708
 
                        void ctor() { };
7709
 
                        ],
7710
 
                        [cc_cv_attribute_constructor=yes],
7711
 
                        [cc_cv_attribute_constructor=no])
7712
 
                ])
7713
 
        
7714
 
        if test "x$cc_cv_attribute_constructor" = "xyes"; then
7715
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_CONSTRUCTOR], 1, [Define this if the compiler supports the constructor attribute])
7716
 
                $1
7717
 
        else
7718
 
                true
7719
 
                $2
7720
 
        fi
7721
 
])
7722
 
 
7723
 
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
7724
 
        AC_CACHE_CHECK([if compiler supports __attribute__((format(printf, n, n)))],
7725
 
                [cc_cv_attribute_format],
7726
 
                [AC_COMPILE_IFELSE([
7727
 
                        void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { }
7728
 
                        ],
7729
 
                        [cc_cv_attribute_format=yes],
7730
 
                        [cc_cv_attribute_format=no])
7731
 
                ])
7732
 
        
7733
 
        if test "x$cc_cv_attribute_format" = "xyes"; then
7734
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_FORMAT], 1, [Define this if the compiler supports the format attribute])
7735
 
                $1
7736
 
        else
7737
 
                true
7738
 
                $2
7739
 
        fi
7740
 
])
7741
 
 
7742
 
AC_DEFUN([CC_ATTRIBUTE_INTERNAL], [
7743
 
        AC_CACHE_CHECK([if compiler supports __attribute__((visibility("internal")))],
7744
 
                [cc_cv_attribute_internal],
7745
 
                [AC_COMPILE_IFELSE([
7746
 
                        void __attribute__((visibility("internal"))) internal_function() { }
7747
 
                        ],
7748
 
                        [cc_cv_attribute_internal=yes],
7749
 
                        [cc_cv_attribute_internal=no])
7750
 
                ])
7751
 
        
7752
 
        if test "x$cc_cv_attribute_internal" = "xyes"; then
7753
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_INTERNAL], 1, [Define this if the compiler supports the internal visibility attribute])
7754
 
                $1
7755
 
        else
7756
 
                true
7757
 
                $2
7758
 
        fi
7759
 
])
7760
 
 
7761
 
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
7762
 
        AC_LANG_PUSH(C++)
7763
 
 
7764
 
        tmp_CXXFLAGS=$CXXFLAGS
7765
 
        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
7766
 
 
7767
 
        AC_CACHE_CHECK([if compiler supports __attribute__((visibility("default")))],
7768
 
                [cc_cv_attribute_visibility],
7769
 
                [AC_COMPILE_IFELSE([
7770
 
                        void __attribute__((visibility("default"))) visibility_function() { }
7771
 
                        ],
7772
 
                        [cc_cv_attribute_visibility=yes],
7773
 
                        [cc_cv_attribute_visibility=no])
7774
 
                ])
7775
 
        
7776
 
        CXXFLAGS=$tmp_CXXFLAGS
7777
 
        AC_LANG_POP(C++)
7778
 
 
7779
 
        if test "x$cc_cv_attribute_visibility" = "xyes"; then
7780
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_VISIBILITY], 1, [Define this if the compiler supports the visibility attributes.])
7781
 
                CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
7782
 
                $1
7783
 
        else
7784
 
                true
7785
 
                $2
7786
 
        fi
7787
 
 
7788
 
])
7789
 
 
7790
 
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
7791
 
        AC_CACHE_CHECK([if compiler supports __attribute__((nonnull()))],
7792
 
                [cc_cv_attribute_nonnull],
7793
 
                [AC_COMPILE_IFELSE([
7794
 
                        void some_function(void *foo, void *bar) __attribute__((nonnull()));
7795
 
                        void some_function(void *foo, void *bar) { }
7796
 
                        ],
7797
 
                        [cc_cv_attribute_nonnull=yes],
7798
 
                        [cc_cv_attribute_nonnull=no])
7799
 
                ])
7800
 
        
7801
 
        if test "x$cc_cv_attribute_nonnull" = "xyes"; then
7802
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_NONNULL], 1, [Define this if the compiler supports the nonnull attribute])
7803
 
                $1
7804
 
        else
7805
 
                true
7806
 
                $2
7807
 
        fi
7808
 
])
7809
 
 
7810
 
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
7811
 
        AC_CACHE_CHECK([if compiler supports __attribute__((unused))],
7812
 
                [cc_cv_attribute_unused],
7813
 
                [AC_COMPILE_IFELSE([
7814
 
                        void some_function(void *foo, __attribute__((unused)) void *bar);
7815
 
                        ],
7816
 
                        [cc_cv_attribute_unused=yes],
7817
 
                        [cc_cv_attribute_unused=no])
7818
 
                ])
7819
 
        
7820
 
        if test "x$cc_cv_attribute_unused" = "xyes"; then
7821
 
                AC_DEFINE([SUPPORT_ATTRIBUTE_UNUSED], 1, [Define this if the compiler supports the unused attribute])
7822
 
                $1
7823
 
        else
7824
 
                true
7825
 
                $2
7826
 
        fi
7827
 
])
7828
 
 
7829
 
AC_DEFUN([CC_FUNC_EXPECT], [
7830
 
        AC_CACHE_CHECK([if compiler has __builtin_expect function],
7831
 
                [cc_cv_func_expect],
7832
 
                [AC_COMPILE_IFELSE([
7833
 
                        int some_function()
7834
 
                        {
7835
 
                                int a = 3;
7836
 
                                return (int)__builtin_expect(a, 3);
7837
 
                        }
7838
 
                        ],
7839
 
                        [cc_cv_func_expect=yes],
7840
 
                        [cc_cv_func_expect=no])
7841
 
                ])
7842
 
        
7843
 
        if test "x$cc_cv_func_expect" = "xyes"; then
7844
 
                AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1, [Define this if the compiler supports __builtin_expect() function])
7845
 
                $1
7846
 
        else
7847
 
                true
7848
 
                $2
7849
 
        fi
7850
 
])
7851
 
 
7852
7240
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
7853
7241
7854
7242
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8007
7395
fi[]dnl
8008
7396
])# PKG_CHECK_MODULES
8009
7397
 
 
7398
m4_include([scripts/attributes.m4])
 
7399
m4_include([scripts/checks.m4])
 
7400
m4_include([scripts/common.m4])