11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
# Do all the work for Automake. -*- Autoconf -*-
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.
19
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
20
# Free Software Foundation, Inc.
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)
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.
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
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...
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
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])
72
# Define the identity of the package.
73
dnl Distinguish between old-style and new-style calls.
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
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
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)
97
# We need awk for the "check" target. The system "awk" is bad on
99
AC_REQUIRE([AC_PROG_AWK])dnl
100
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
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
114
# Copyright 2002 Free Software Foundation, Inc.
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)
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.
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.
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.
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"])
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])])
143
# Helper functions for option handling. -*- Autoconf -*-
145
# Copyright 2001, 2002 Free Software Foundation, Inc.
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)
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.
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
164
# _AM_MANGLE_OPTION(NAME)
165
# -----------------------
166
AC_DEFUN([_AM_MANGLE_OPTION],
167
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
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)])
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)])])
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])])
188
# Check to make sure that the build environment is sane.
191
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
212
AC_DEFUN([AM_SANITY_CHECK],
213
[AC_MSG_CHECKING([whether build environment is sane])
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
223
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
224
if test "$[*]" = "X"; then
226
set X `ls -t $srcdir/configure conftest.file`
229
if test "$[*]" != "X $srcdir/configure conftest.file" \
230
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
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])
240
test "$[2]" = conftest.file
246
AC_MSG_ERROR([newly created file is older than distributed files!
247
Check your system clock])
254
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
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"}
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 "
293
AC_MSG_WARN([`missing' script is too old or missing])
299
# Copyright 2001 Free Software Foundation, Inc.
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)
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.
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
31
[AM_AUTOMAKE_VERSION([1.9.6])])
33
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
35
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
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.
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.
354
# Rely on autoconf to set up CDPATH properly.
357
AC_DEFUN([AM_AUX_DIR_EXPAND], [
79
AC_DEFUN([AM_AUX_DIR_EXPAND],
80
[dnl Rely on autoconf to set up CDPATH properly.
358
82
# expand $ac_aux_dir to an absolute path
359
83
am_aux_dir=`cd $ac_aux_dir && pwd`
364
# Define $install_sh.
366
# Copyright 2001 Free Software Foundation, Inc.
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)
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.
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
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)])
388
# AM_PROG_INSTALL_STRIP
390
# Copyright 2001 Free Software Foundation, Inc.
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)
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.
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
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 -*-
88
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
89
# Free Software Foundation, Inc.
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.
97
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
98
# -------------------------------------
99
# Define a conditional.
100
AC_DEFUN([AM_CONDITIONAL],
102
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
103
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
424
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
425
AC_SUBST([INSTALL_STRIP_PROGRAM])])
427
# serial 4 -*- Autoconf -*-
429
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
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.]])
120
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
121
# Free Software Foundation, Inc.
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.
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,
652
340
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
655
# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
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)
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.
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
343
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
344
# Free Software Foundation, Inc.
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.
352
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
353
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
355
# Do all the work for Automake. -*- Autoconf -*-
357
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
358
# Free Software Foundation, Inc.
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.
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.
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])
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'
401
AC_SUBST([CYGPATH_W])
403
# Define the identity of the package.
404
dnl Distinguish between old-style and new-style calls.
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
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
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)
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
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
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.
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.
459
for _am_header in $config_headers :; do
464
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
467
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
469
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
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.
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)])
483
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
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.
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
501
rmdir .tst 2>/dev/null
502
AC_SUBST([am__leading_dot])])
504
# Check to see how 'make' treats includes. -*- Autoconf -*-
506
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
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.
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'
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])
709
AC_SUBST(am__include)
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
715
# AM_CONDITIONAL -*- Autoconf -*-
717
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
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
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.])
759
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
761
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
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 "/".
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,
795
patsubst([$1], [^\(/\).*], [\1])),
796
patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
797
patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
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])
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])
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])"
828
])# _AM_CONFIG_HEADER
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])])
556
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
558
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
559
# Free Software Foundation, Inc.
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.
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"}
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 "
587
AC_MSG_WARN([`missing' script is too old or missing])
591
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
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.
599
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
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
606
# - it causes special bits like SGID to be ignored,
607
# - it may be too restrictive (some setups expect 775 directories).
609
# Do not use -m 0755 and let people choose whatever they expect by
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
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
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
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 --'
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
641
for d in ./-p ./--version;
643
test -d $d && rmdir $d
645
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
646
if test -f "$ac_aux_dir/mkinstalldirs"; then
647
mkdir_p='$(mkinstalldirs)'
649
mkdir_p='$(install_sh) -d'
652
AC_SUBST([mkdir_p])])
654
# Helper functions for option handling. -*- Autoconf -*-
656
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
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.
664
# _AM_MANGLE_OPTION(NAME)
665
# -----------------------
666
AC_DEFUN([_AM_MANGLE_OPTION],
667
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
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)])
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)])])
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])])
687
# Check to make sure that the build environment is sane. -*- Autoconf -*-
689
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
690
# Free Software Foundation, Inc.
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.
700
AC_DEFUN([AM_SANITY_CHECK],
701
[AC_MSG_CHECKING([whether build environment is sane])
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
711
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
712
if test "$[*]" = "X"; then
714
set X `ls -t $srcdir/configure conftest.file`
717
if test "$[*]" != "X $srcdir/configure conftest.file" \
718
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
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])
728
test "$[2]" = conftest.file
734
AC_MSG_ERROR([newly created file is older than distributed files!
735
Check your system clock])
739
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
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.
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], :)
764
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
765
AC_SUBST([INSTALL_STRIP_PROGRAM])])
767
# Check how to create a tarball. -*- Autoconf -*-
769
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
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.
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'.
782
# Substitute a variable $(am__tar) that is a command
783
# writing to stdout a FORMAT-tarball containing the directory
785
# tardir=directory && $(am__tar) > result.tar
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])
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
807
for _am_tar in tar gnutar gtar;
809
AM_RUN_LOG([$_am_tar --version]) && break
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 -"
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"'
824
am__tar='pax -L -x $1 -w "$$tardir"'
825
am__tar_='pax -L -x $1 -w "$tardir"'
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'
840
# If the value was cached, stop now. We just wanted to have am__tar
842
test -n "${am_cv_prog_tar_$1}" && break
844
# tar/untar a dummy directory, and stop if the command works
847
echo GrepMe > conftest.dir/file
848
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
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
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])])
860
AC_SUBST([am__untar])
837
863
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
7211
7237
AC_MSG_RESULT([$SED])
7214
AC_DEFUN([TORRENT_CHECK_CXXFLAGS], [
7216
AC_MSG_CHECKING([for user-defined CXXFLAGS])
7218
if test -n "$CXXFLAGS"; then
7219
AC_MSG_RESULT([user-defined "$CXXFLAGS"])
7221
CXXFLAGS="-O2 -Wall"
7222
AC_MSG_RESULT([default "$CXXFLAGS"])
7227
AC_DEFUN([TORRENT_ENABLE_DEBUG], [
7228
AC_ARG_ENABLE(debug,
7229
[ --enable-debug enable debug information [[default=yes]]],
7231
if test "$enableval" = "yes"; then
7232
CXXFLAGS="$CXXFLAGS -g -DDEBUG"
7234
CXXFLAGS="$CXXFLAGS -DNDEBUG"
7237
CXXFLAGS="$CXXFLAGS -g -DDEBUG"
7242
AC_DEFUN([TORRENT_ENABLE_WERROR], [
7243
AC_ARG_ENABLE(werror,
7244
[ --enable-werror enable the -Werror and -Wall flag [[default=no]]],
7246
if test "$enableval" = "yes"; then
7247
CXXFLAGS="$CXXFLAGS -Werror -Wall"
7253
AC_DEFUN([TORRENT_ENABLE_EXTRA_DEBUG], [
7254
AC_ARG_ENABLE(extra-debug,
7255
[ --enable-extra-debug enable extra debugging checks. [[default=no]]],
7257
if test "$enableval" = "yes"; then
7258
AC_DEFINE(USE_EXTRA_DEBUG, 1, Enable extra debugging checks.)
7264
AC_DEFUN([TORRENT_OTFD], [
7266
AC_MSG_CHECKING(for proper overloaded template function disambiguation)
7269
[[template <typename T> void f(T&) {}
7270
template <typename T> void f(T*) {}
7271
int main() { int *i = 0; f(*i); f(i); }
7277
AC_MSG_ERROR([your compiler does not properly handle overloaded template function disambiguation])
7284
AC_DEFUN([TORRENT_MINCORE_SIGNEDNESS], [
7286
AC_MSG_CHECKING(signedness of mincore parameter)
7289
[[#include <sys/types.h>
7290
#include <sys/mman.h>
7292
void f() { mincore((char*)0, 0, (unsigned char*)0); }
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)
7301
[[#include <sys/types.h>
7302
#include <sys/mman.h>
7304
void f() { mincore((char*)0, 0, (char*)0); }
7307
AC_DEFINE(USE_MINCORE, 1, Use mincore)
7308
AC_DEFINE(USE_MINCORE_UNSIGNED, 0, use char* in mincore)
7309
AC_MSG_RESULT(signed)
7312
AC_MSG_ERROR([failed, do *not* attempt to use --disable-mincore unless you are running Win32.])
7319
AC_DEFUN([TORRENT_MINCORE], [
7320
AC_ARG_ENABLE(mincore,
7321
[ --disable-mincore disable mincore check [[default=enable]]],
7323
if test "$enableval" = "yes"; then
7324
TORRENT_MINCORE_SIGNEDNESS()
7326
AC_MSG_CHECKING(for mincore)
7327
AC_MSG_RESULT(disabled)
7330
TORRENT_MINCORE_SIGNEDNESS()
7334
AC_DEFUN([TORRENT_CHECK_MADVISE], [
7335
AC_MSG_CHECKING(for madvise)
7338
[[#include <sys/types.h>
7339
#include <sys/mman.h>
7340
void f() { static char test[1024]; madvise((void *)test, sizeof(test), MADV_NORMAL); }
7344
AC_DEFINE(USE_MADVISE, 1, Use madvise)
7350
AC_DEFUN([TORRENT_CHECK_EXECINFO], [
7351
AC_MSG_CHECKING(for execinfo.h)
7354
[[#include <execinfo.h>
7355
int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
7359
AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h)
7365
AC_DEFUN([TORRENT_CHECK_ALIGNED], [
7366
AC_MSG_CHECKING(the byte alignment)
7369
[[#include <inttypes.h>
7371
char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 };
7373
for (i = 1; i < 4; ++i)
7374
if (*(uint32_t*)(buf + i) == 0) return -1;
7379
AC_MSG_RESULT(none needed)
7381
AC_DEFINE(USE_ALIGNED, 1, Require byte alignment)
7382
AC_MSG_RESULT(required)
7387
AC_DEFUN([TORRENT_ENABLE_ALIGNED], [
7388
AC_ARG_ENABLE(aligned,
7389
[ --enable-aligned enable alignment safe code [[default=check]]],
7391
if test "$enableval" = "yes"; then
7392
AC_DEFINE(USE_ALIGNED, 1, Require byte alignment)
7395
TORRENT_CHECK_ALIGNED
7400
AC_DEFUN([TORRENT_DISABLE_IPV6], [
7402
[ --enable-ipv6 disable ipv6 [[default=no]]],
7404
if test "$enableval" = "yes"; then
7405
AC_DEFINE(RAK_USE_INET6, 1, enable ipv6 stuff)
7410
AC_DEFUN([TORRENT_CHECK_XFS], [
7411
AC_MSG_CHECKING(for XFS support)
7414
[[#include <xfs/libxfs.h>
7415
#include <sys/ioctl.h>
7417
struct xfs_flock64 l;
7418
ioctl(0, XFS_IOC_RESVSP64, &l);
7423
AC_DEFINE(USE_XFS, 1, Use XFS filesystem stuff.)
7431
AC_DEFUN([TORRENT_WITHOUT_XFS], [
7433
[ --without-xfs Do not check for XFS filesystem support],
7435
if test "$withval" = "yes"; then
7444
AC_DEFUN([TORRENT_WITH_XFS], [
7446
[ --with-xfs Check for XFS filesystem support],
7448
if test "$withval" = "yes"; then
7455
AC_DEFUN([TORRENT_CHECK_EPOLL], [
7456
AC_MSG_CHECKING(for epoll support)
7459
[[#include <sys/epoll.h>
7461
int fd = epoll_create(100);
7466
AC_DEFINE(USE_EPOLL, 1, Use epoll.)
7474
AC_DEFUN([TORRENT_WITHOUT_EPOLL], [
7476
[ --without-epoll Do not check for epoll support.],
7478
if test "$withval" = "yes"; then
7487
AC_DEFUN([TORRENT_WITH_KQUEUE], [
7489
[ --with-kqueue enable kqueue. [[default=no]]],
7491
if test "$withval" = "yes"; then
7492
AC_DEFINE(USE_KQUEUE, 1, Enable kqueue.)
7498
AC_DEFUN([TORRENT_WITHOUT_VARIABLE_FDSET], [
7499
AC_ARG_WITH(variable-fdset,
7501
[ --without-variable-fdset do not use non-portable variable sized fd_set's.],
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)
7507
AC_DEFINE(USE_VARIABLE_FDSET, 1, defined when we allow the use of fd_set's of any size)
7512
AC_DEFUN([TORRENT_CHECK_POSIX_FALLOCATE], [
7513
AC_MSG_CHECKING(for posix_fallocate)
7516
[[#include <fcntl.h>
7518
posix_fallocate(0, 0, 0);
7523
AC_DEFINE(USE_POSIX_FALLOCATE, 1, posix_fallocate supported.)
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.],
7535
if test "$withval" = "yes"; then
7536
TORRENT_CHECK_POSIX_FALLOCATE
7541
AC_DEFUN([TORRENT_WITHOUT_NCURSESW], [
7542
AC_ARG_WITH(ncursesw,
7543
[ --without-ncursesw Don't try to use wide char ncurses.],
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)
7551
AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
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)
7561
AC_DEFUN([TORRENT_CHECK_STATVFS], [
7562
AC_CHECK_HEADERS(sys/vfs.h sys/statvfs.h sys/statfs.h)
7564
AC_MSG_CHECKING(for statvfs)
7569
#include <sys/vfs.h>
7571
#if HAVE_SYS_STATVFS_H
7572
#include <sys/statvfs.h>
7574
#if HAVE_SYS_STATFS_H
7575
#include <sys/statfs.h>
7578
struct statvfs s; fsblkcnt_t c;
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)
7598
AC_DEFUN([TORRENT_CHECK_STATFS], [
7599
AC_CHECK_HEADERS(sys/statfs.h sys/param.h sys/mount.h)
7601
AC_MSG_CHECKING(for statfs)
7605
#if HAVE_SYS_STATFS_H
7606
#include <sys/statfs.h>
7608
#if HAVE_SYS_PARAM_H
7609
#include <sys/param.h>
7611
#if HAVE_SYS_MOUNT_H
7612
#include <sys/mount.h>
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)
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)
7643
AC_DEFUN([TORRENT_WITHOUT_STATVFS], [
7644
AC_ARG_WITH(statvfs,
7645
[ --without-statvfs Don't try to use statvfs to find free diskspace.],
7647
if test "$withval" = "yes"; then
7648
TORRENT_CHECK_STATVFS
7654
TORRENT_CHECK_STATVFS
7658
AC_DEFUN([TORRENT_WITHOUT_STATFS], [
7660
[ --without-statfs Don't try to use statfs to find free diskspace.],
7662
if test "$have_stat_vfs" = "no"; then
7663
if test "$withval" = "yes"; then
7664
TORRENT_CHECK_STATFS
7666
TORRENT_DISABLED_STATFS
7671
if test "$have_stat_vfs" = "no"; then
7672
TORRENT_CHECK_STATFS
7673
if test "$have_stat_vfs" = "no"; then
7674
TORRENT_DISABLED_STATFS
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.]),
7684
if test ! -z $withval -a "$withval" != "yes" -a "$withval" != "no"; then
7685
AC_DEFINE_UNQUOTED(DEFAULT_ADDRESS_SPACE_SIZE, [$withval])
7687
AC_MSG_ERROR(--with-address-space requires a parameter.)
7691
AC_CHECK_SIZEOF(long)
7693
if test $ac_cv_sizeof_long = 8; then
7694
AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 4096, Default address space size.)
7696
AC_DEFINE(DEFAULT_ADDRESS_SPACE_SIZE, 1024, Default address space size.)
7701
# Functions to check for attributes support in compiler
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));
7710
[cc_cv_attribute_constructor=yes],
7711
[cc_cv_attribute_constructor=no])
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])
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, ...) { }
7729
[cc_cv_attribute_format=yes],
7730
[cc_cv_attribute_format=no])
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])
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() { }
7748
[cc_cv_attribute_internal=yes],
7749
[cc_cv_attribute_internal=no])
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])
7761
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
7764
tmp_CXXFLAGS=$CXXFLAGS
7765
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
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() { }
7772
[cc_cv_attribute_visibility=yes],
7773
[cc_cv_attribute_visibility=no])
7776
CXXFLAGS=$tmp_CXXFLAGS
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"
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) { }
7797
[cc_cv_attribute_nonnull=yes],
7798
[cc_cv_attribute_nonnull=no])
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])
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);
7816
[cc_cv_attribute_unused=yes],
7817
[cc_cv_attribute_unused=no])
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])
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([
7836
return (int)__builtin_expect(a, 3);
7839
[cc_cv_func_expect=yes],
7840
[cc_cv_func_expect=no])
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])
7852
7240
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
7854
7242
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.