~ubuntu-branches/debian/sid/x11-apps/sid

« back to all changes in this revision

Viewing changes to xman/aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Julien Cristau
  • Date: 2013-12-25 18:39:25 UTC
  • Revision ID: package-import@ubuntu.com-20131225183925-kh1rc0smebkuyxf7
Tags: 7.7+2
* xclipboard 1.1.3
* xclock 1.0.7
* xman 1.1.3
* Use dh.
* Disable silent build rules.
* Remove Cyril from Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
 
 
3
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
1
# generated automatically by aclocal 1.14 -*- Autoconf -*-
 
2
 
 
3
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
4
 
5
5
# This file is free software; the Free Software Foundation
6
6
# gives unlimited permission to copy and/or distribute it,
7
7
# with or without modifications, as long as this notice is preserved.
11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
13
13
 
 
14
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
14
15
m4_ifndef([AC_AUTOCONF_VERSION],
15
16
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
17
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17
18
[m4_warning([this file was generated for autoconf 2.68.
18
19
You have another version of autoconf.  It may work, but is not guaranteed to.
19
20
If you have problems, you may need to regenerate the build system entirely.
20
 
To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
21
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22
 
22
 
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
23
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
23
24
#
24
25
# This file is free software; the Free Software Foundation
25
26
# gives unlimited permission to copy and/or distribute it,
31
32
# generated from the m4 files accompanying Automake X.Y.
32
33
# (This private macro should not be called outside this file.)
33
34
AC_DEFUN([AM_AUTOMAKE_VERSION],
34
 
[am__api_version='1.11'
 
35
[am__api_version='1.14'
35
36
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36
37
dnl require some minimum version.  Point them to the right macro.
37
 
m4_if([$1], [1.11.1], [],
 
38
m4_if([$1], [1.14], [],
38
39
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39
40
])
40
41
 
50
51
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51
52
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52
53
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53
 
[AM_AUTOMAKE_VERSION([1.11.1])dnl
 
54
[AM_AUTOMAKE_VERSION([1.14])dnl
54
55
m4_ifndef([AC_AUTOCONF_VERSION],
55
56
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56
57
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57
58
 
58
59
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59
60
 
60
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
61
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
61
62
#
62
63
# This file is free software; the Free Software Foundation
63
64
# gives unlimited permission to copy and/or distribute it,
64
65
# with or without modifications, as long as this notice is preserved.
65
66
 
66
67
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67
 
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68
 
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
 
68
# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
 
69
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
69
70
#
70
71
# Of course, Automake must honor this variable whenever it calls a
71
72
# tool from the auxiliary directory.  The problem is that $srcdir (and
84
85
#
85
86
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86
87
# are both prefixed by $srcdir.  In an in-source build this is usually
87
 
# harmless because $srcdir is `.', but things will broke when you
 
88
# harmless because $srcdir is '.', but things will broke when you
88
89
# start a VPATH build or use an absolute $srcdir.
89
90
#
90
91
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
110
111
 
111
112
# AM_CONDITIONAL                                            -*- Autoconf -*-
112
113
 
113
 
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114
 
# Free Software Foundation, Inc.
 
114
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115
115
#
116
116
# This file is free software; the Free Software Foundation
117
117
# gives unlimited permission to copy and/or distribute it,
118
118
# with or without modifications, as long as this notice is preserved.
119
119
 
120
 
# serial 9
121
 
 
122
120
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123
121
# -------------------------------------
124
122
# Define a conditional.
125
123
AC_DEFUN([AM_CONDITIONAL],
126
 
[AC_PREREQ(2.52)dnl
127
 
 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128
 
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 
124
[AC_PREREQ([2.52])dnl
 
125
 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
 
126
       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129
127
AC_SUBST([$1_TRUE])dnl
130
128
AC_SUBST([$1_FALSE])dnl
131
129
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
144
142
Usually this means the macro was only invoked conditionally.]])
145
143
fi])])
146
144
 
147
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148
 
# Free Software Foundation, Inc.
 
145
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
149
146
#
150
147
# This file is free software; the Free Software Foundation
151
148
# gives unlimited permission to copy and/or distribute it,
152
149
# with or without modifications, as long as this notice is preserved.
153
150
 
154
 
# serial 10
155
151
 
156
 
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 
152
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
157
153
# written in clear, in which case automake, when reading aclocal.m4,
158
154
# will think it sees a *use*, and therefore will trigger all it's
159
155
# C support machinery.  Also note that it means that autoscan, seeing
163
159
# _AM_DEPENDENCIES(NAME)
164
160
# ----------------------
165
161
# See how the compiler implements dependency checking.
166
 
# NAME is "CC", "CXX", "GCJ", or "OBJC".
 
162
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
167
163
# We try a few techniques and use that to set a single cache variable.
168
164
#
169
165
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
176
172
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
177
173
AC_REQUIRE([AM_DEP_TRACK])dnl
178
174
 
179
 
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180
 
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181
 
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182
 
       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183
 
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184
 
                   [depcc="$$1"   am_compiler_list=])
 
175
m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
 
176
      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
 
177
      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
 
178
      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
 
179
      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
 
180
      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
 
181
                    [depcc="$$1"   am_compiler_list=])
185
182
 
186
183
AC_CACHE_CHECK([dependency style of $depcc],
187
184
               [am_cv_$1_dependencies_compiler_type],
189
186
  # We make a subdir and do the tests there.  Otherwise we can end up
190
187
  # making bogus files that we don't know about and never remove.  For
191
188
  # instance it was reported that on HP-UX the gcc test will end up
192
 
  # making a dummy file named `D' -- because `-MD' means `put the output
193
 
  # in D'.
 
189
  # making a dummy file named 'D' -- because '-MD' means "put the output
 
190
  # in D".
 
191
  rm -rf conftest.dir
194
192
  mkdir conftest.dir
195
193
  # Copy depcomp to subdir because otherwise we won't find it if we're
196
194
  # using a relative directory.
229
227
    : > sub/conftest.c
230
228
    for i in 1 2 3 4 5 6; do
231
229
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232
 
      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233
 
      # Solaris 8's {/usr,}/bin/sh.
234
 
      touch sub/conftst$i.h
 
230
      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
 
231
      # Solaris 10 /bin/sh.
 
232
      echo '/* dummy */' > sub/conftst$i.h
235
233
    done
236
234
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237
235
 
238
 
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 
236
    # We check with '-c' and '-o' for the sake of the "dashmstdout"
239
237
    # mode.  It turns out that the SunPro C++ compiler does not properly
240
 
    # handle `-M -o', and we need to detect this.  Also, some Intel
241
 
    # versions had trouble with output in subdirs
 
238
    # handle '-M -o', and we need to detect this.  Also, some Intel
 
239
    # versions had trouble with output in subdirs.
242
240
    am__obj=sub/conftest.${OBJEXT-o}
243
241
    am__minus_obj="-o $am__obj"
244
242
    case $depmode in
247
245
      test "$am__universal" = false || continue
248
246
      ;;
249
247
    nosideeffect)
250
 
      # after this tag, mechanisms are not by side-effect, so they'll
251
 
      # only be used when explicitly requested
 
248
      # After this tag, mechanisms are not by side-effect, so they'll
 
249
      # only be used when explicitly requested.
252
250
      if test "x$enable_dependency_tracking" = xyes; then
253
251
        continue
254
252
      else
255
253
        break
256
254
      fi
257
255
      ;;
258
 
    msvisualcpp | msvcmsys)
259
 
      # This compiler won't grok `-c -o', but also, the minuso test has
 
256
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
 
257
      # This compiler won't grok '-c -o', but also, the minuso test has
260
258
      # not run yet.  These depmodes are late enough in the game, and
261
259
      # so weak that their functioning should not be impacted.
262
260
      am__obj=conftest.${OBJEXT-o}
304
302
# AM_SET_DEPDIR
305
303
# -------------
306
304
# Choose a directory name for dependency files.
307
 
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
 
305
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
308
306
AC_DEFUN([AM_SET_DEPDIR],
309
307
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310
308
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
314
312
# AM_DEP_TRACK
315
313
# ------------
316
314
AC_DEFUN([AM_DEP_TRACK],
317
 
[AC_ARG_ENABLE(dependency-tracking,
318
 
[  --disable-dependency-tracking  speeds up one-time build
319
 
  --enable-dependency-tracking   do not reject slow dependency extractors])
 
315
[AC_ARG_ENABLE([dependency-tracking], [dnl
 
316
AS_HELP_STRING(
 
317
  [--enable-dependency-tracking],
 
318
  [do not reject slow dependency extractors])
 
319
AS_HELP_STRING(
 
320
  [--disable-dependency-tracking],
 
321
  [speeds up one-time build])])
320
322
if test "x$enable_dependency_tracking" != xno; then
321
323
  am_depcomp="$ac_aux_dir/depcomp"
322
324
  AMDEPBACKSLASH='\'
 
325
  am__nodep='_no'
323
326
fi
324
327
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325
328
AC_SUBST([AMDEPBACKSLASH])dnl
326
329
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
330
AC_SUBST([am__nodep])dnl
 
331
_AM_SUBST_NOTMAKE([am__nodep])dnl
327
332
])
328
333
 
329
334
# Generate code to set up dependency tracking.              -*- Autoconf -*-
330
335
 
331
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332
 
# Free Software Foundation, Inc.
 
336
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
333
337
#
334
338
# This file is free software; the Free Software Foundation
335
339
# gives unlimited permission to copy and/or distribute it,
336
340
# with or without modifications, as long as this notice is preserved.
337
341
 
338
 
#serial 5
339
342
 
340
343
# _AM_OUTPUT_DEPENDENCY_COMMANDS
341
344
# ------------------------------
342
345
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343
346
[{
344
 
  # Autoconf 2.62 quotes --file arguments for eval, but not when files
 
347
  # Older Autoconf quotes --file arguments for eval, but not when files
345
348
  # are listed without --file.  Let's play safe and only enable the eval
346
349
  # if we detect the quoting.
347
350
  case $CONFIG_FILES in
354
357
    # Strip MF so we end up with the name of the file.
355
358
    mf=`echo "$mf" | sed -e 's/:.*$//'`
356
359
    # Check whether this is an Automake generated Makefile or not.
357
 
    # We used to match only the files named `Makefile.in', but
 
360
    # We used to match only the files named 'Makefile.in', but
358
361
    # some people rename them; so instead we look at the file content.
359
362
    # Grep'ing the first line is not enough: some people post-process
360
363
    # each Makefile.in and add a new line on top of each file to say so.
366
369
      continue
367
370
    fi
368
371
    # Extract the definition of DEPDIR, am__include, and am__quote
369
 
    # from the Makefile without running `make'.
 
372
    # from the Makefile without running 'make'.
370
373
    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371
374
    test -z "$DEPDIR" && continue
372
375
    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373
 
    test -z "am__include" && continue
 
376
    test -z "$am__include" && continue
374
377
    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375
 
    # When using ansi2knr, U may be empty or an underscore; expand it
376
 
    U=`sed -n 's/^U = //p' < "$mf"`
377
378
    # Find all dependency output files, they are included files with
378
379
    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379
380
    # simplest approach to changing $(DEPDIR) to its actual value in the
380
381
    # expansion.
381
382
    for file in `sed -n "
382
383
      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383
 
         sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
 
384
         sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
384
385
      # Make sure the directory exists.
385
386
      test -f "$dirpart/$file" && continue
386
387
      fdir=`AS_DIRNAME(["$file"])`
398
399
# This macro should only be invoked once -- use via AC_REQUIRE.
399
400
#
400
401
# This code is only required when automatic dependency tracking
401
 
# is enabled.  FIXME.  This creates each `.P' file that we will
 
402
# is enabled.  FIXME.  This creates each '.P' file that we will
402
403
# need in order to bootstrap the dependency handling code.
403
404
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404
405
[AC_CONFIG_COMMANDS([depfiles],
408
409
 
409
410
# Do all the work for Automake.                             -*- Autoconf -*-
410
411
 
411
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412
 
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 
412
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
413
413
#
414
414
# This file is free software; the Free Software Foundation
415
415
# gives unlimited permission to copy and/or distribute it,
416
416
# with or without modifications, as long as this notice is preserved.
417
417
 
418
 
# serial 16
419
 
 
420
418
# This macro actually does too much.  Some checks are only needed if
421
419
# your package does certain things.  But this isn't really a big deal.
422
420
 
 
421
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
 
422
m4_define([AC_PROG_CC],
 
423
m4_defn([AC_PROG_CC])
 
424
[_AM_PROG_CC_C_O
 
425
])
 
426
 
423
427
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424
428
# AM_INIT_AUTOMAKE([OPTIONS])
425
429
# -----------------------------------------------
432
436
# arguments mandatory, and then we can depend on a new Autoconf
433
437
# release and drop the old call support.
434
438
AC_DEFUN([AM_INIT_AUTOMAKE],
435
 
[AC_PREREQ([2.62])dnl
 
439
[AC_PREREQ([2.65])dnl
436
440
dnl Autoconf wants to disallow AM_ names.  We explicitly allow
437
441
dnl the ones we care about.
438
442
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
461
465
# Define the identity of the package.
462
466
dnl Distinguish between old-style and new-style calls.
463
467
m4_ifval([$2],
464
 
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 
468
[AC_DIAGNOSE([obsolete],
 
469
             [$0: two- and three-arguments forms are deprecated.])
 
470
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465
471
 AC_SUBST([PACKAGE], [$1])dnl
466
472
 AC_SUBST([VERSION], [$2])],
467
473
[_AM_SET_OPTIONS([$1])dnl
468
474
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469
 
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
 
475
m4_if(
 
476
  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
 
477
  [ok:ok],,
470
478
  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471
479
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472
480
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473
481
 
474
482
_AM_IF_OPTION([no-define],,
475
 
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476
 
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
483
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
 
484
 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
477
485
 
478
486
# Some tools Automake needs.
479
487
AC_REQUIRE([AM_SANITY_CHECK])dnl
480
488
AC_REQUIRE([AC_ARG_PROGRAM])dnl
481
 
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482
 
AM_MISSING_PROG(AUTOCONF, autoconf)
483
 
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484
 
AM_MISSING_PROG(AUTOHEADER, autoheader)
485
 
AM_MISSING_PROG(MAKEINFO, makeinfo)
 
489
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
 
490
AM_MISSING_PROG([AUTOCONF], [autoconf])
 
491
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
 
492
AM_MISSING_PROG([AUTOHEADER], [autoheader])
 
493
AM_MISSING_PROG([MAKEINFO], [makeinfo])
486
494
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487
495
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488
 
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 
496
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 
497
# For better backward compatibility.  To be removed once Automake 1.9.x
 
498
# dies out for good.  For more background, see:
 
499
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 
500
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 
501
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
489
502
# We need awk for the "check" target.  The system "awk" is bad on
490
503
# some platforms.
491
504
AC_REQUIRE([AC_PROG_AWK])dnl
496
509
                             [_AM_PROG_TAR([v7])])])
497
510
_AM_IF_OPTION([no-dependencies],,
498
511
[AC_PROVIDE_IFELSE([AC_PROG_CC],
499
 
                  [_AM_DEPENDENCIES(CC)],
500
 
                  [define([AC_PROG_CC],
501
 
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 
512
                  [_AM_DEPENDENCIES([CC])],
 
513
                  [m4_define([AC_PROG_CC],
 
514
                             m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
502
515
AC_PROVIDE_IFELSE([AC_PROG_CXX],
503
 
                  [_AM_DEPENDENCIES(CXX)],
504
 
                  [define([AC_PROG_CXX],
505
 
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
516
                  [_AM_DEPENDENCIES([CXX])],
 
517
                  [m4_define([AC_PROG_CXX],
 
518
                             m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
506
519
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
507
 
                  [_AM_DEPENDENCIES(OBJC)],
508
 
                  [define([AC_PROG_OBJC],
509
 
                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 
520
                  [_AM_DEPENDENCIES([OBJC])],
 
521
                  [m4_define([AC_PROG_OBJC],
 
522
                             m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
 
523
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
 
524
                  [_AM_DEPENDENCIES([OBJCXX])],
 
525
                  [m4_define([AC_PROG_OBJCXX],
 
526
                             m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
510
527
])
511
 
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512
 
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513
 
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514
 
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
 
528
AC_REQUIRE([AM_SILENT_RULES])dnl
 
529
dnl The testsuite driver may need to know about EXEEXT, so add the
 
530
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
 
531
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
515
532
AC_CONFIG_COMMANDS_PRE(dnl
516
533
[m4_provide_if([_AM_COMPILER_EXEEXT],
517
534
  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518
 
])
519
 
 
520
 
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 
535
 
 
536
# POSIX will say in a future version that running "rm -f" with no argument
 
537
# is OK; and we want to be able to make that assumption in our Makefile
 
538
# recipes.  So use an aggressive probe to check that the usage we want is
 
539
# actually supported "in the wild" to an acceptable degree.
 
540
# See automake bug#10828.
 
541
# To make any issue more visible, cause the running configure to be aborted
 
542
# by default if the 'rm' program in use doesn't match our expectations; the
 
543
# user can still override this though.
 
544
if rm -f && rm -fr && rm -rf; then : OK; else
 
545
  cat >&2 <<'END'
 
546
Oops!
 
547
 
 
548
Your 'rm' program seems unable to run without file operands specified
 
549
on the command line, even when the '-f' option is present.  This is contrary
 
550
to the behaviour of most rm programs out there, and not conforming with
 
551
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
 
552
 
 
553
Please tell bug-automake@gnu.org about your system, including the value
 
554
of your $PATH and any error possibly output before this message.  This
 
555
can help us improve future automake versions.
 
556
 
 
557
END
 
558
  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
 
559
    echo 'Configuration will proceed anyway, since you have set the' >&2
 
560
    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
 
561
    echo >&2
 
562
  else
 
563
    cat >&2 <<'END'
 
564
Aborting the configuration process, to ensure you take notice of the issue.
 
565
 
 
566
You can download and install GNU coreutils to get an 'rm' implementation
 
567
that behaves properly: <http://www.gnu.org/software/coreutils/>.
 
568
 
 
569
If you want to complete the configuration process using your problematic
 
570
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
 
571
to "yes", and re-run configure.
 
572
 
 
573
END
 
574
    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
 
575
  fi
 
576
fi])
 
577
 
 
578
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521
579
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522
580
dnl mangled by Autoconf and run in a shell conditional statement.
523
581
m4_define([_AC_COMPILER_EXEEXT],
524
582
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525
583
 
526
 
 
527
584
# When config.status generates a header, we must update the stamp-h file.
528
585
# This file resides in the same directory as the config header
529
586
# that is generated.  The stamp files are numbered to have different names.
545
602
done
546
603
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547
604
 
548
 
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 
605
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
549
606
#
550
607
# This file is free software; the Free Software Foundation
551
608
# gives unlimited permission to copy and/or distribute it,
564
621
    install_sh="\${SHELL} $am_aux_dir/install-sh"
565
622
  esac
566
623
fi
567
 
AC_SUBST(install_sh)])
 
624
AC_SUBST([install_sh])])
568
625
 
569
 
# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
 
626
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
570
627
#
571
628
# This file is free software; the Free Software Foundation
572
629
# gives unlimited permission to copy and/or distribute it,
573
630
# with or without modifications, as long as this notice is preserved.
574
631
 
575
 
# serial 2
576
 
 
577
632
# Check whether the underlying file-system supports filenames
578
633
# with a leading dot.  For instance MS-DOS doesn't.
579
634
AC_DEFUN([AM_SET_LEADING_DOT],
590
645
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591
646
# From Jim Meyering
592
647
 
593
 
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594
 
# Free Software Foundation, Inc.
 
648
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
595
649
#
596
650
# This file is free software; the Free Software Foundation
597
651
# gives unlimited permission to copy and/or distribute it,
598
652
# with or without modifications, as long as this notice is preserved.
599
653
 
600
 
# serial 5
601
 
 
602
654
# AM_MAINTAINER_MODE([DEFAULT-MODE])
603
655
# ----------------------------------
604
656
# Control maintainer-specific portions of Makefiles.
605
 
# Default is to disable them, unless `enable' is passed literally.
606
 
# For symmetry, `disable' may be passed as well.  Anyway, the user
 
657
# Default is to disable them, unless 'enable' is passed literally.
 
658
# For symmetry, 'disable' may be passed as well.  Anyway, the user
607
659
# can override the default with the --enable/--disable switch.
608
660
AC_DEFUN([AM_MAINTAINER_MODE],
609
661
[m4_case(m4_default([$1], [disable]),
611
663
       [disable], [m4_define([am_maintainer_other], [enable])],
612
664
       [m4_define([am_maintainer_other], [enable])
613
665
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614
 
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
666
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
615
667
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616
668
  AC_ARG_ENABLE([maintainer-mode],
617
 
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618
 
                          (and sometimes confusing) to the casual installer],
619
 
      [USE_MAINTAINER_MODE=$enableval],
620
 
      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
 
669
    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
 
670
      am_maintainer_other[ make rules and dependencies not useful
 
671
      (and sometimes confusing) to the casual installer])],
 
672
    [USE_MAINTAINER_MODE=$enableval],
 
673
    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621
674
  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622
675
  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623
676
  MAINT=$MAINTAINER_MODE_TRUE
625
678
]
626
679
)
627
680
 
628
 
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629
 
 
630
681
# Check to see how 'make' treats includes.                  -*- Autoconf -*-
631
682
 
632
 
# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
 
683
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
633
684
#
634
685
# This file is free software; the Free Software Foundation
635
686
# gives unlimited permission to copy and/or distribute it,
636
687
# with or without modifications, as long as this notice is preserved.
637
688
 
638
 
# serial 4
639
 
 
640
689
# AM_MAKE_INCLUDE()
641
690
# -----------------
642
691
# Check to see how make treats includes.
654
703
_am_result=none
655
704
# First try GNU make style include.
656
705
echo "include confinc" > confmf
657
 
# Ignore all kinds of additional output from `make'.
 
706
# Ignore all kinds of additional output from 'make'.
658
707
case `$am_make -s -f confmf 2> /dev/null` in #(
659
708
*the\ am__doit\ target*)
660
709
  am__include=include
681
730
 
682
731
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683
732
 
684
 
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685
 
# Free Software Foundation, Inc.
 
733
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
686
734
#
687
735
# This file is free software; the Free Software Foundation
688
736
# gives unlimited permission to copy and/or distribute it,
689
737
# with or without modifications, as long as this notice is preserved.
690
738
 
691
 
# serial 6
692
 
 
693
739
# AM_MISSING_PROG(NAME, PROGRAM)
694
740
# ------------------------------
695
741
AC_DEFUN([AM_MISSING_PROG],
697
743
$1=${$1-"${am_missing_run}$2"}
698
744
AC_SUBST($1)])
699
745
 
700
 
 
701
746
# AM_MISSING_HAS_RUN
702
747
# ------------------
703
 
# Define MISSING if not defined so far and test if it supports --run.
704
 
# If it does, set am_missing_run to use it, otherwise, to nothing.
 
748
# Define MISSING if not defined so far and test if it is modern enough.
 
749
# If it is, set am_missing_run to use it, otherwise, to nothing.
705
750
AC_DEFUN([AM_MISSING_HAS_RUN],
706
751
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707
752
AC_REQUIRE_AUX_FILE([missing])dnl
714
759
  esac
715
760
fi
716
761
# Use eval to expand $SHELL
717
 
if eval "$MISSING --run true"; then
718
 
  am_missing_run="$MISSING --run "
 
762
if eval "$MISSING --is-lightweight"; then
 
763
  am_missing_run="$MISSING "
719
764
else
720
765
  am_missing_run=
721
 
  AC_MSG_WARN([`missing' script is too old or missing])
 
766
  AC_MSG_WARN(['missing' script is too old or missing])
722
767
fi
723
768
])
724
769
 
725
 
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726
 
#
727
 
# This file is free software; the Free Software Foundation
728
 
# gives unlimited permission to copy and/or distribute it,
729
 
# with or without modifications, as long as this notice is preserved.
730
 
 
731
 
# AM_PROG_MKDIR_P
732
 
# ---------------
733
 
# Check for `mkdir -p'.
734
 
AC_DEFUN([AM_PROG_MKDIR_P],
735
 
[AC_PREREQ([2.60])dnl
736
 
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
737
 
dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738
 
dnl while keeping a definition of mkdir_p for backward compatibility.
739
 
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740
 
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741
 
dnl Makefile.ins that do not define MKDIR_P, so we do our own
742
 
dnl adjustment using top_builddir (which is defined more often than
743
 
dnl MKDIR_P).
744
 
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745
 
case $mkdir_p in
746
 
  [[\\/$]]* | ?:[[\\/]]*) ;;
747
 
  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748
 
esac
749
 
])
750
 
 
751
770
# Helper functions for option handling.                     -*- Autoconf -*-
752
771
 
753
 
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 
772
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
754
773
#
755
774
# This file is free software; the Free Software Foundation
756
775
# gives unlimited permission to copy and/or distribute it,
757
776
# with or without modifications, as long as this notice is preserved.
758
777
 
759
 
# serial 4
760
 
 
761
778
# _AM_MANGLE_OPTION(NAME)
762
779
# -----------------------
763
780
AC_DEFUN([_AM_MANGLE_OPTION],
764
781
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765
782
 
766
783
# _AM_SET_OPTION(NAME)
767
 
# ------------------------------
 
784
# --------------------
768
785
# Set option NAME.  Presently that only means defining a flag for this option.
769
786
AC_DEFUN([_AM_SET_OPTION],
770
 
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
787
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
771
788
 
772
789
# _AM_SET_OPTIONS(OPTIONS)
773
 
# ----------------------------------
 
790
# ------------------------
774
791
# OPTIONS is a space-separated list of Automake options.
775
792
AC_DEFUN([_AM_SET_OPTIONS],
776
793
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
781
798
AC_DEFUN([_AM_IF_OPTION],
782
799
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783
800
 
 
801
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
802
#
 
803
# This file is free software; the Free Software Foundation
 
804
# gives unlimited permission to copy and/or distribute it,
 
805
# with or without modifications, as long as this notice is preserved.
 
806
 
 
807
# _AM_PROG_CC_C_O
 
808
# ---------------
 
809
# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
 
810
# to automatically call this.
 
811
AC_DEFUN([_AM_PROG_CC_C_O],
 
812
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
813
AC_REQUIRE_AUX_FILE([compile])dnl
 
814
AC_LANG_PUSH([C])dnl
 
815
AC_CACHE_CHECK(
 
816
  [whether $CC understands -c and -o together],
 
817
  [am_cv_prog_cc_c_o],
 
818
  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
 
819
  # Make sure it works both with $CC and with simple cc.
 
820
  # Following AC_PROG_CC_C_O, we do the test twice because some
 
821
  # compilers refuse to overwrite an existing .o file with -o,
 
822
  # though they will create one.
 
823
  am_cv_prog_cc_c_o=yes
 
824
  for am_i in 1 2; do
 
825
    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
 
826
         && test -f conftest2.$ac_objext; then
 
827
      : OK
 
828
    else
 
829
      am_cv_prog_cc_c_o=no
 
830
      break
 
831
    fi
 
832
  done
 
833
  rm -f core conftest*
 
834
  unset am_i])
 
835
if test "$am_cv_prog_cc_c_o" != yes; then
 
836
   # Losing compiler, so override with the script.
 
837
   # FIXME: It is wrong to rewrite CC.
 
838
   # But if we don't then we get into trouble of one sort or another.
 
839
   # A longer-term fix would be to have automake use am__CC in this case,
 
840
   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
 
841
   CC="$am_aux_dir/compile $CC"
 
842
fi
 
843
AC_LANG_POP([C])])
 
844
 
 
845
# For backward compatibility.
 
846
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
847
 
 
848
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 
849
#
 
850
# This file is free software; the Free Software Foundation
 
851
# gives unlimited permission to copy and/or distribute it,
 
852
# with or without modifications, as long as this notice is preserved.
 
853
 
 
854
# AM_RUN_LOG(COMMAND)
 
855
# -------------------
 
856
# Run COMMAND, save the exit status in ac_status, and log it.
 
857
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
 
858
AC_DEFUN([AM_RUN_LOG],
 
859
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
 
860
   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
 
861
   ac_status=$?
 
862
   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
863
   (exit $ac_status); }])
 
864
 
784
865
# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785
866
 
786
 
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787
 
# Free Software Foundation, Inc.
 
867
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
788
868
#
789
869
# This file is free software; the Free Software Foundation
790
870
# gives unlimited permission to copy and/or distribute it,
791
871
# with or without modifications, as long as this notice is preserved.
792
872
 
793
 
# serial 5
794
 
 
795
873
# AM_SANITY_CHECK
796
874
# ---------------
797
875
AC_DEFUN([AM_SANITY_CHECK],
798
876
[AC_MSG_CHECKING([whether build environment is sane])
799
 
# Just in case
800
 
sleep 1
801
 
echo timestamp > conftest.file
802
877
# Reject unsafe characters in $srcdir or the absolute working directory
803
878
# name.  Accept space and tab only in the latter.
804
879
am_lf='
809
884
esac
810
885
case $srcdir in
811
886
  *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
812
 
    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
 
887
    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
813
888
esac
814
889
 
815
 
# Do `set' in a subshell so we don't clobber the current shell's
 
890
# Do 'set' in a subshell so we don't clobber the current shell's
816
891
# arguments.  Must try -L first in case configure is actually a
817
892
# symlink; some systems play weird games with the mod time of symlinks
818
893
# (eg FreeBSD returns the mod time of the symlink's containing
819
894
# directory).
820
895
if (
821
 
   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822
 
   if test "$[*]" = "X"; then
823
 
      # -L didn't work.
824
 
      set X `ls -t "$srcdir/configure" conftest.file`
825
 
   fi
826
 
   rm -f conftest.file
827
 
   if test "$[*]" != "X $srcdir/configure conftest.file" \
828
 
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829
 
 
830
 
      # If neither matched, then we have a broken ls.  This can happen
831
 
      # if, for instance, CONFIG_SHELL is bash and it inherits a
832
 
      # broken ls alias from the environment.  This has actually
833
 
      # happened.  Such a system could not be considered "sane".
834
 
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835
 
alias in your environment])
836
 
   fi
837
 
 
 
896
   am_has_slept=no
 
897
   for am_try in 1 2; do
 
898
     echo "timestamp, slept: $am_has_slept" > conftest.file
 
899
     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
 
900
     if test "$[*]" = "X"; then
 
901
        # -L didn't work.
 
902
        set X `ls -t "$srcdir/configure" conftest.file`
 
903
     fi
 
904
     if test "$[*]" != "X $srcdir/configure conftest.file" \
 
905
        && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
906
 
 
907
        # If neither matched, then we have a broken ls.  This can happen
 
908
        # if, for instance, CONFIG_SHELL is bash and it inherits a
 
909
        # broken ls alias from the environment.  This has actually
 
910
        # happened.  Such a system could not be considered "sane".
 
911
        AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
 
912
  alias in your environment])
 
913
     fi
 
914
     if test "$[2]" = conftest.file || test $am_try -eq 2; then
 
915
       break
 
916
     fi
 
917
     # Just in case.
 
918
     sleep 1
 
919
     am_has_slept=yes
 
920
   done
838
921
   test "$[2]" = conftest.file
839
922
   )
840
923
then
844
927
   AC_MSG_ERROR([newly created file is older than distributed files!
845
928
Check your system clock])
846
929
fi
847
 
AC_MSG_RESULT(yes)])
 
930
AC_MSG_RESULT([yes])
 
931
# If we didn't sleep, we still need to ensure time stamps of config.status and
 
932
# generated files are strictly newer.
 
933
am_sleep_pid=
 
934
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
 
935
  ( sleep 1 ) &
 
936
  am_sleep_pid=$!
 
937
fi
 
938
AC_CONFIG_COMMANDS_PRE(
 
939
  [AC_MSG_CHECKING([that generated files are newer than configure])
 
940
   if test -n "$am_sleep_pid"; then
 
941
     # Hide warnings about reused PIDs.
 
942
     wait $am_sleep_pid 2>/dev/null
 
943
   fi
 
944
   AC_MSG_RESULT([done])])
 
945
rm -f conftest.file
 
946
])
848
947
 
849
 
# Copyright (C) 2009  Free Software Foundation, Inc.
 
948
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
850
949
#
851
950
# This file is free software; the Free Software Foundation
852
951
# gives unlimited permission to copy and/or distribute it,
853
952
# with or without modifications, as long as this notice is preserved.
854
953
 
855
 
# serial 1
856
 
 
857
954
# AM_SILENT_RULES([DEFAULT])
858
955
# --------------------------
859
956
# Enable less verbose build rules; with the default set to DEFAULT
860
 
# (`yes' being less verbose, `no' or empty being verbose).
 
957
# ("yes" being less verbose, "no" or empty being verbose).
861
958
AC_DEFUN([AM_SILENT_RULES],
862
 
[AC_ARG_ENABLE([silent-rules],
863
 
[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864
 
  --disable-silent-rules         verbose build output (undo: `make V=0')])
865
 
case $enable_silent_rules in
866
 
yes) AM_DEFAULT_VERBOSITY=0;;
867
 
no)  AM_DEFAULT_VERBOSITY=1;;
868
 
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 
959
[AC_ARG_ENABLE([silent-rules], [dnl
 
960
AS_HELP_STRING(
 
961
  [--enable-silent-rules],
 
962
  [less verbose build output (undo: "make V=1")])
 
963
AS_HELP_STRING(
 
964
  [--disable-silent-rules],
 
965
  [verbose build output (undo: "make V=0")])dnl
 
966
])
 
967
case $enable_silent_rules in @%:@ (((
 
968
  yes) AM_DEFAULT_VERBOSITY=0;;
 
969
   no) AM_DEFAULT_VERBOSITY=1;;
 
970
    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869
971
esac
 
972
dnl
 
973
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
 
974
dnl do not support nested variable expansions.
 
975
dnl See automake bug#9928 and bug#10237.
 
976
am_make=${MAKE-make}
 
977
AC_CACHE_CHECK([whether $am_make supports nested variables],
 
978
   [am_cv_make_support_nested_variables],
 
979
   [if AS_ECHO([['TRUE=$(BAR$(V))
 
980
BAR0=false
 
981
BAR1=true
 
982
V=1
 
983
am__doit:
 
984
        @$(TRUE)
 
985
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
 
986
  am_cv_make_support_nested_variables=yes
 
987
else
 
988
  am_cv_make_support_nested_variables=no
 
989
fi])
 
990
if test $am_cv_make_support_nested_variables = yes; then
 
991
  dnl Using '$V' instead of '$(V)' breaks IRIX make.
 
992
  AM_V='$(V)'
 
993
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
 
994
else
 
995
  AM_V=$AM_DEFAULT_VERBOSITY
 
996
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
 
997
fi
 
998
AC_SUBST([AM_V])dnl
 
999
AM_SUBST_NOTMAKE([AM_V])dnl
 
1000
AC_SUBST([AM_DEFAULT_V])dnl
 
1001
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
870
1002
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871
1003
AM_BACKSLASH='\'
872
1004
AC_SUBST([AM_BACKSLASH])dnl
873
1005
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874
1006
])
875
1007
 
876
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
1008
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
877
1009
#
878
1010
# This file is free software; the Free Software Foundation
879
1011
# gives unlimited permission to copy and/or distribute it,
881
1013
 
882
1014
# AM_PROG_INSTALL_STRIP
883
1015
# ---------------------
884
 
# One issue with vendor `install' (even GNU) is that you can't
 
1016
# One issue with vendor 'install' (even GNU) is that you can't
885
1017
# specify the program used to strip binaries.  This is especially
886
1018
# annoying in cross-compiling environments, where the build's strip
887
1019
# is unlikely to handle the host's binaries.
888
1020
# Fortunately install-sh will honor a STRIPPROG variable, so we
889
 
# always use install-sh in `make install-strip', and initialize
 
1021
# always use install-sh in "make install-strip", and initialize
890
1022
# STRIPPROG with the value of the STRIP variable (set by the user).
891
1023
AC_DEFUN([AM_PROG_INSTALL_STRIP],
892
1024
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893
 
# Installed binaries are usually stripped using `strip' when the user
894
 
# run `make install-strip'.  However `strip' might not be the right
 
1025
# Installed binaries are usually stripped using 'strip' when the user
 
1026
# run "make install-strip".  However 'strip' might not be the right
895
1027
# tool to use in cross-compilation environments, therefore Automake
896
 
# will honor the `STRIP' environment variable to overrule this program.
897
 
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
 
1028
# will honor the 'STRIP' environment variable to overrule this program.
 
1029
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
898
1030
if test "$cross_compiling" != no; then
899
1031
  AC_CHECK_TOOL([STRIP], [strip], :)
900
1032
fi
901
1033
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902
1034
AC_SUBST([INSTALL_STRIP_PROGRAM])])
903
1035
 
904
 
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 
1036
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
905
1037
#
906
1038
# This file is free software; the Free Software Foundation
907
1039
# gives unlimited permission to copy and/or distribute it,
908
1040
# with or without modifications, as long as this notice is preserved.
909
1041
 
910
 
# serial 2
911
 
 
912
1042
# _AM_SUBST_NOTMAKE(VARIABLE)
913
1043
# ---------------------------
914
1044
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
916
1046
AC_DEFUN([_AM_SUBST_NOTMAKE])
917
1047
 
918
1048
# AM_SUBST_NOTMAKE(VARIABLE)
919
 
# ---------------------------
 
1049
# --------------------------
920
1050
# Public sister of _AM_SUBST_NOTMAKE.
921
1051
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922
1052
 
923
1053
# Check how to create a tarball.                            -*- Autoconf -*-
924
1054
 
925
 
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
1055
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
926
1056
#
927
1057
# This file is free software; the Free Software Foundation
928
1058
# gives unlimited permission to copy and/or distribute it,
929
1059
# with or without modifications, as long as this notice is preserved.
930
1060
 
931
 
# serial 2
932
 
 
933
1061
# _AM_PROG_TAR(FORMAT)
934
1062
# --------------------
935
1063
# Check how to create a tarball in format FORMAT.
936
 
# FORMAT should be one of `v7', `ustar', or `pax'.
 
1064
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
937
1065
#
938
1066
# Substitute a variable $(am__tar) that is a command
939
1067
# writing to stdout a FORMAT-tarball containing the directory
943
1071
# Substitute a variable $(am__untar) that extract such
944
1072
# a tarball read from stdin.
945
1073
#     $(am__untar) < result.tar
 
1074
#
946
1075
AC_DEFUN([_AM_PROG_TAR],
947
 
[# Always define AMTAR for backward compatibility.
948
 
AM_MISSING_PROG([AMTAR], [tar])
 
1076
[# Always define AMTAR for backward compatibility.  Yes, it's still used
 
1077
# in the wild :-(  We should find a proper way to deprecate it ...
 
1078
AC_SUBST([AMTAR], ['$${TAR-tar}'])
 
1079
 
 
1080
# We'll loop over all known methods to create a tar archive until one works.
 
1081
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 
1082
 
949
1083
m4_if([$1], [v7],
950
 
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951
 
     [m4_case([$1], [ustar],, [pax],,
952
 
              [m4_fatal([Unknown tar format])])
953
 
AC_MSG_CHECKING([how to create a $1 tar archive])
954
 
# Loop over all known methods to create a tar archive until one works.
955
 
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956
 
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957
 
# Do not fold the above two line into one, because Tru64 sh and
958
 
# Solaris sh will not grok spaces in the rhs of `-'.
959
 
for _am_tool in $_am_tools
960
 
do
961
 
  case $_am_tool in
962
 
  gnutar)
963
 
    for _am_tar in tar gnutar gtar;
964
 
    do
965
 
      AM_RUN_LOG([$_am_tar --version]) && break
966
 
    done
967
 
    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968
 
    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969
 
    am__untar="$_am_tar -xf -"
970
 
    ;;
971
 
  plaintar)
972
 
    # Must skip GNU tar: if it does not support --format= it doesn't create
973
 
    # ustar tarball either.
974
 
    (tar --version) >/dev/null 2>&1 && continue
975
 
    am__tar='tar chf - "$$tardir"'
976
 
    am__tar_='tar chf - "$tardir"'
977
 
    am__untar='tar xf -'
978
 
    ;;
979
 
  pax)
980
 
    am__tar='pax -L -x $1 -w "$$tardir"'
981
 
    am__tar_='pax -L -x $1 -w "$tardir"'
982
 
    am__untar='pax -r'
983
 
    ;;
984
 
  cpio)
985
 
    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986
 
    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987
 
    am__untar='cpio -i -H $1 -d'
988
 
    ;;
989
 
  none)
990
 
    am__tar=false
991
 
    am__tar_=false
992
 
    am__untar=false
993
 
    ;;
994
 
  esac
995
 
 
996
 
  # If the value was cached, stop now.  We just wanted to have am__tar
997
 
  # and am__untar set.
998
 
  test -n "${am_cv_prog_tar_$1}" && break
999
 
 
1000
 
  # tar/untar a dummy directory, and stop if the command works
1001
 
  rm -rf conftest.dir
1002
 
  mkdir conftest.dir
1003
 
  echo GrepMe > conftest.dir/file
1004
 
  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005
 
  rm -rf conftest.dir
1006
 
  if test -s conftest.tar; then
1007
 
    AM_RUN_LOG([$am__untar <conftest.tar])
1008
 
    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009
 
  fi
1010
 
done
1011
 
rm -rf conftest.dir
1012
 
 
1013
 
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014
 
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
 
1084
  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
 
1085
 
 
1086
  [m4_case([$1],
 
1087
    [ustar],
 
1088
     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
 
1089
      # There is notably a 21 bits limit for the UID and the GID.  In fact,
 
1090
      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
 
1091
      # and bug#13588).
 
1092
      am_max_uid=2097151 # 2^21 - 1
 
1093
      am_max_gid=$am_max_uid
 
1094
      # The $UID and $GID variables are not portable, so we need to resort
 
1095
      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
 
1096
      # below are definitely unexpected, so allow the users to see them
 
1097
      # (that is, avoid stderr redirection).
 
1098
      am_uid=`id -u || echo unknown`
 
1099
      am_gid=`id -g || echo unknown`
 
1100
      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
 
1101
      if test $am_uid -le $am_max_uid; then
 
1102
         AC_MSG_RESULT([yes])
 
1103
      else
 
1104
         AC_MSG_RESULT([no])
 
1105
         _am_tools=none
 
1106
      fi
 
1107
      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
 
1108
      if test $am_gid -le $am_max_gid; then
 
1109
         AC_MSG_RESULT([yes])
 
1110
      else
 
1111
        AC_MSG_RESULT([no])
 
1112
        _am_tools=none
 
1113
      fi],
 
1114
 
 
1115
  [pax],
 
1116
    [],
 
1117
 
 
1118
  [m4_fatal([Unknown tar format])])
 
1119
 
 
1120
  AC_MSG_CHECKING([how to create a $1 tar archive])
 
1121
 
 
1122
  # Go ahead even if we have the value already cached.  We do so because we
 
1123
  # need to set the values for the 'am__tar' and 'am__untar' variables.
 
1124
  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 
1125
 
 
1126
  for _am_tool in $_am_tools; do
 
1127
    case $_am_tool in
 
1128
    gnutar)
 
1129
      for _am_tar in tar gnutar gtar; do
 
1130
        AM_RUN_LOG([$_am_tar --version]) && break
 
1131
      done
 
1132
      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
 
1133
      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
 
1134
      am__untar="$_am_tar -xf -"
 
1135
      ;;
 
1136
    plaintar)
 
1137
      # Must skip GNU tar: if it does not support --format= it doesn't create
 
1138
      # ustar tarball either.
 
1139
      (tar --version) >/dev/null 2>&1 && continue
 
1140
      am__tar='tar chf - "$$tardir"'
 
1141
      am__tar_='tar chf - "$tardir"'
 
1142
      am__untar='tar xf -'
 
1143
      ;;
 
1144
    pax)
 
1145
      am__tar='pax -L -x $1 -w "$$tardir"'
 
1146
      am__tar_='pax -L -x $1 -w "$tardir"'
 
1147
      am__untar='pax -r'
 
1148
      ;;
 
1149
    cpio)
 
1150
      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
 
1151
      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
 
1152
      am__untar='cpio -i -H $1 -d'
 
1153
      ;;
 
1154
    none)
 
1155
      am__tar=false
 
1156
      am__tar_=false
 
1157
      am__untar=false
 
1158
      ;;
 
1159
    esac
 
1160
 
 
1161
    # If the value was cached, stop now.  We just wanted to have am__tar
 
1162
    # and am__untar set.
 
1163
    test -n "${am_cv_prog_tar_$1}" && break
 
1164
 
 
1165
    # tar/untar a dummy directory, and stop if the command works.
 
1166
    rm -rf conftest.dir
 
1167
    mkdir conftest.dir
 
1168
    echo GrepMe > conftest.dir/file
 
1169
    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
 
1170
    rm -rf conftest.dir
 
1171
    if test -s conftest.tar; then
 
1172
      AM_RUN_LOG([$am__untar <conftest.tar])
 
1173
      AM_RUN_LOG([cat conftest.dir/file])
 
1174
      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
 
1175
    fi
 
1176
  done
 
1177
  rm -rf conftest.dir
 
1178
 
 
1179
  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
 
1180
  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
 
1181
 
1015
1182
AC_SUBST([am__tar])
1016
1183
AC_SUBST([am__untar])
1017
1184
]) # _AM_PROG_TAR
1018
1185
 
 
1186
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1187
 
1188
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1189
#
 
1190
# This program is free software; you can redistribute it and/or modify
 
1191
# it under the terms of the GNU General Public License as published by
 
1192
# the Free Software Foundation; either version 2 of the License, or
 
1193
# (at your option) any later version.
 
1194
#
 
1195
# This program is distributed in the hope that it will be useful, but
 
1196
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1197
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1198
# General Public License for more details.
 
1199
#
 
1200
# You should have received a copy of the GNU General Public License
 
1201
# along with this program; if not, write to the Free Software
 
1202
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1203
#
 
1204
# As a special exception to the GNU General Public License, if you
 
1205
# distribute this file as part of a program that contains a
 
1206
# configuration script generated by Autoconf, you may include it under
 
1207
# the same distribution terms that you use for the rest of that program.
 
1208
 
 
1209
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1210
# ----------------------------------
 
1211
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1212
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1213
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
1214
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
1215
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1216
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1217
fi
 
1218
if test -n "$PKG_CONFIG"; then
 
1219
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1220
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1221
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1222
                AC_MSG_RESULT([yes])
 
1223
        else
 
1224
                AC_MSG_RESULT([no])
 
1225
                PKG_CONFIG=""
 
1226
        fi
 
1227
                
 
1228
fi[]dnl
 
1229
])# PKG_PROG_PKG_CONFIG
 
1230
 
 
1231
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1232
#
 
1233
# Check to see whether a particular set of modules exists.  Similar
 
1234
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1235
#
 
1236
#
 
1237
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
 
1238
# this or PKG_CHECK_MODULES is called, or make sure to call
 
1239
# PKG_CHECK_EXISTS manually
 
1240
# --------------------------------------------------------------
 
1241
AC_DEFUN([PKG_CHECK_EXISTS],
 
1242
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1243
if test -n "$PKG_CONFIG" && \
 
1244
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1245
  m4_ifval([$2], [$2], [:])
 
1246
m4_ifvaln([$3], [else
 
1247
  $3])dnl
 
1248
fi])
 
1249
 
 
1250
 
 
1251
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1252
# ---------------------------------------------
 
1253
m4_define([_PKG_CONFIG],
 
1254
[if test -n "$$1"; then
 
1255
    pkg_cv_[]$1="$$1"
 
1256
 elif test -n "$PKG_CONFIG"; then
 
1257
    PKG_CHECK_EXISTS([$3],
 
1258
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
1259
                     [pkg_failed=yes])
 
1260
 else
 
1261
    pkg_failed=untried
 
1262
fi[]dnl
 
1263
])# _PKG_CONFIG
 
1264
 
 
1265
# _PKG_SHORT_ERRORS_SUPPORTED
 
1266
# -----------------------------
 
1267
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1268
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1269
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1270
        _pkg_short_errors_supported=yes
 
1271
else
 
1272
        _pkg_short_errors_supported=no
 
1273
fi[]dnl
 
1274
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1275
 
 
1276
 
 
1277
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1278
# [ACTION-IF-NOT-FOUND])
 
1279
#
 
1280
#
 
1281
# Note that if there is a possibility the first call to
 
1282
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1283
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1284
#
 
1285
#
 
1286
# --------------------------------------------------------------
 
1287
AC_DEFUN([PKG_CHECK_MODULES],
 
1288
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1289
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1290
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1291
 
 
1292
pkg_failed=no
 
1293
AC_MSG_CHECKING([for $1])
 
1294
 
 
1295
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1296
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1297
 
 
1298
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1299
and $1[]_LIBS to avoid the need to call pkg-config.
 
1300
See the pkg-config man page for more details.])
 
1301
 
 
1302
if test $pkg_failed = yes; then
 
1303
        _PKG_SHORT_ERRORS_SUPPORTED
 
1304
        if test $_pkg_short_errors_supported = yes; then
 
1305
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
1306
        else 
 
1307
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
1308
        fi
 
1309
        # Put the nasty error message in config.log where it belongs
 
1310
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1311
 
 
1312
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
1313
[Package requirements ($2) were not met:
 
1314
 
 
1315
$$1_PKG_ERRORS
 
1316
 
 
1317
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1318
installed software in a non-standard prefix.
 
1319
 
 
1320
_PKG_TEXT
 
1321
])],
 
1322
                [AC_MSG_RESULT([no])
 
1323
                $4])
 
1324
elif test $pkg_failed = untried; then
 
1325
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
1326
[The pkg-config script could not be found or is too old.  Make sure it
 
1327
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1328
path to pkg-config.
 
1329
 
 
1330
_PKG_TEXT
 
1331
 
 
1332
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
 
1333
                [$4])
 
1334
else
 
1335
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1336
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1337
        AC_MSG_RESULT([yes])
 
1338
        ifelse([$3], , :, [$3])
 
1339
fi[]dnl
 
1340
])# PKG_CHECK_MODULES
 
1341
 
1019
1342
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020
1343
dnl
1021
1344
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1055
1378
# See the "minimum version" comment for each macro you use to see what 
1056
1379
# version you require.
1057
1380
m4_defun([XORG_MACROS_VERSION],[
1058
 
m4_define([vers_have], [1.15.0])
 
1381
m4_define([vers_have], [1.17])
1059
1382
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060
1383
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061
1384
m4_if(m4_cmp(maj_have, maj_needed), 0,,
2063
2386
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2064
2387
AC_BEFORE([$0], [XORG_WITH_GLIB])
2065
2388
AC_BEFORE([$0], [XORG_LD_WRAP])
 
2389
AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2066
2390
m4_define([_defopt], m4_default([$1], [auto]))
2067
2391
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2068
2392
        [Enable building unit test cases (default: ]_defopt[)]),
2073
2397
AC_MSG_RESULT([$enable_unit_tests])
2074
2398
]) # XORG_ENABLE_UNIT_TESTS
2075
2399
 
 
2400
# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
 
2401
# ------------------------------------------------------
 
2402
# Minimum version: 1.17.0
 
2403
#
 
2404
# This macro enables a builder to enable/disable integration testing
 
2405
# It makes no assumption about the test cases' implementation
 
2406
# Test cases may or may not use Automake "Support for test suites"
 
2407
#
 
2408
# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
 
2409
# usually requires less dependencies and may be built and run under less
 
2410
# stringent environments than integration tests.
 
2411
#
 
2412
# Interface to module:
 
2413
# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
 
2414
# enable_integration_tests:   used in configure.ac for additional configuration
 
2415
# --enable-integration-tests: 'yes' user instructs the module to build tests
 
2416
#                             'no' user instructs the module not to build tests
 
2417
# parm1:                      specify the default value, yes or no.
 
2418
#
 
2419
AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
 
2420
AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
 
2421
m4_define([_defopt], m4_default([$1], [auto]))
 
2422
AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
 
2423
        [Enable building integration test cases (default: ]_defopt[)]),
 
2424
        [enable_integration_tests=$enableval],
 
2425
        [enable_integration_tests=]_defopt)
 
2426
m4_undefine([_defopt])
 
2427
AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
 
2428
        [test "x$enable_integration_tests" != xno])
 
2429
AC_MSG_CHECKING([whether to build unit test cases])
 
2430
AC_MSG_RESULT([$enable_integration_tests])
 
2431
]) # XORG_ENABLE_INTEGRATION_TESTS
 
2432
 
2076
2433
# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2077
2434
# ----------------------------------------
2078
2435
# Minimum version: 1.13.0
2083
2440
# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2084
2441
# Otherwise the value of $enable_unit_tests is blank.
2085
2442
#
 
2443
# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
 
2444
# test support usually requires less dependencies and may be built and run under
 
2445
# less stringent environments than integration tests.
 
2446
#
2086
2447
# Interface to module:
2087
2448
# HAVE_GLIB: used in makefiles to conditionally build targets
2088
2449
# with_glib: used in configure.ac to know if GLib has been found
2134
2495
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2135
2496
]) # XORG_WITH_GLIB
2136
2497
 
2137
 
# XORG_LD_WRAP
2138
 
# ------------
 
2498
# XORG_LD_WRAP([required|optional])
 
2499
# ---------------------------------
2139
2500
# Minimum version: 1.13.0
2140
2501
#
2141
2502
# Check if linker supports -wrap, passed via compiler flags
2143
2504
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2144
2505
# Otherwise the value of $enable_unit_tests is blank.
2145
2506
#
 
2507
# Argument added in 1.16.0 - default is "required", to match existing behavior
 
2508
# of returning an error if enable_unit_tests is yes, and ld -wrap is not
 
2509
# available, an argument of "optional" allows use when some unit tests require
 
2510
# ld -wrap and others do not.
 
2511
#
2146
2512
AC_DEFUN([XORG_LD_WRAP],[
2147
 
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
 
2513
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
 
2514
    [AC_LANG_PROGRAM([#include <stdlib.h>
 
2515
                      void __wrap_exit(int status) { return; }],
 
2516
                     [exit(0);])])
2148
2517
# Not having ld wrap when unit testing has been explicitly requested is an error
2149
 
if test "x$enable_unit_tests" = x"yes"; then
 
2518
if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2150
2519
  if test "x$have_ld_wrap" = x"no"; then
2151
2520
    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2152
2521
  fi
2159
2528
# -----------------------
2160
2529
# SYNOPSIS
2161
2530
#
2162
 
#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
 
2531
#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2163
2532
#
2164
2533
# DESCRIPTION
2165
2534
#
2169
2538
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2170
2539
#   success/failure.
2171
2540
#
 
2541
#   PROGRAM-SOURCE is the program source to link with, if needed
 
2542
#
2172
2543
#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2173
2544
#
2174
2545
# LICENSE
2209
2580
  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2210
2581
      ax_save_FLAGS=$LDFLAGS
2211
2582
      LDFLAGS="$1"
2212
 
      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
 
2583
      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2213
2584
        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2214
2585
        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2215
2586
      LDFLAGS=$ax_save_FLAGS])],
2228
2599
fi
2229
2600
]) # XORG_CHECK_LINKER_FLAGS
2230
2601
 
 
2602
# XORG_MEMORY_CHECK_FLAGS
 
2603
# -----------------------
 
2604
# Minimum version: 1.16.0
 
2605
#
 
2606
# This macro attempts to find appropriate memory checking functionality
 
2607
# for various platforms which unit testing code may use to catch various
 
2608
# forms of memory allocation and access errors in testing.
 
2609
#
 
2610
# Interface to module:
 
2611
# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
 
2612
#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
 
2613
#
 
2614
# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
 
2615
#
 
2616
AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
 
2617
 
 
2618
AC_REQUIRE([AC_CANONICAL_HOST])
 
2619
AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
 
2620
           [Environment variables to enable memory checking in tests])
 
2621
 
 
2622
# Check for different types of support on different platforms
 
2623
case $host_os in
 
2624
    solaris*)
 
2625
        AC_CHECK_LIB([umem], [umem_alloc],
 
2626
            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
 
2627
        ;;
 
2628
    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
 
2629
        # both directly and inverted, so should not be 0 or 255.
 
2630
        malloc_debug_env='MALLOC_PERTURB_=15'
 
2631
        ;;
 
2632
    darwin*)
 
2633
        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
 
2634
        ;;
 
2635
    *bsd*)
 
2636
        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
 
2637
        ;;
 
2638
esac
 
2639
 
 
2640
# User supplied flags override default flags
 
2641
if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
 
2642
    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
 
2643
fi
 
2644
 
 
2645
AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
 
2646
]) # XORG_WITH_LINT
 
2647
 
2231
2648
# XORG_CHECK_MALLOC_ZERO
2232
2649
# ----------------------
2233
2650
# Minimum version: 1.0.0
2385
2802
#
2386
2803
# Checks for various brands of compilers and sets flags as appropriate:
2387
2804
#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
 
2805
#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2388
2806
#   clang compiler - sets CLANGCC to "yes"
2389
2807
#   Intel compiler - sets INTELCC to "yes"
2390
2808
#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2391
2809
#
2392
2810
AC_DEFUN([XORG_COMPILER_BRAND], [
2393
 
AC_REQUIRE([AC_PROG_CC_C99])
 
2811
AC_LANG_CASE(
 
2812
        [C], [
 
2813
                AC_REQUIRE([AC_PROG_CC_C99])
 
2814
        ],
 
2815
        [C++], [
 
2816
                AC_REQUIRE([AC_PROG_CXX])
 
2817
        ]
 
2818
)
2394
2819
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2395
2820
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2396
2821
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2397
2822
]) # XORG_COMPILER_BRAND
2398
2823
 
 
2824
# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
 
2825
# ---------------
 
2826
# Minimum version: 1.16.0
 
2827
#
 
2828
# Test if the compiler works when passed the given flag as a command line argument.
 
2829
# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
 
2830
# next flag in the list until there are no more options.
 
2831
#
 
2832
# Note that this does not guarantee that the compiler supports the flag as some
 
2833
# compilers will simply ignore arguments that they do not understand, but we do
 
2834
# attempt to weed out false positives by using -Werror=unknown-warning-option and
 
2835
# -Werror=unused-command-line-argument
 
2836
#
 
2837
AC_DEFUN([XORG_TESTSET_CFLAG], [
 
2838
m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
 
2839
m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
 
2840
 
 
2841
AC_LANG_COMPILER_REQUIRE
 
2842
 
 
2843
AC_LANG_CASE(
 
2844
        [C], [
 
2845
                AC_REQUIRE([AC_PROG_CC_C99])
 
2846
                define([PREFIX], [C])
 
2847
                define([CACHE_PREFIX], [cc])
 
2848
                define([COMPILER], [$CC])
 
2849
        ],
 
2850
        [C++], [
 
2851
                define([PREFIX], [CXX])
 
2852
                define([CACHE_PREFIX], [cxx])
 
2853
                define([COMPILER], [$CXX])
 
2854
        ]
 
2855
)
 
2856
 
 
2857
[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
 
2858
 
 
2859
if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
 
2860
        PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
 
2861
        AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
 
2862
                        [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
 
2863
                        AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
 
2864
                                          [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
 
2865
                                          [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
 
2866
        [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
 
2867
        PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
 
2868
fi
 
2869
 
 
2870
if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
 
2871
        if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
 
2872
                PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
 
2873
        fi
 
2874
        PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
 
2875
        AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
 
2876
                        [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
 
2877
                        AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
 
2878
                                          [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
 
2879
                                          [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
 
2880
        [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
 
2881
        PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
 
2882
fi
 
2883
 
 
2884
found="no"
 
2885
m4_foreach([flag], m4_cdr($@), [
 
2886
        if test $found = "no" ; then
 
2887
                if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
 
2888
                        PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
 
2889
                fi
 
2890
 
 
2891
                if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
 
2892
                        PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
 
2893
                fi
 
2894
 
 
2895
                PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
 
2896
 
 
2897
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
 
2898
                AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
 
2899
                cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
 
2900
                AC_CACHE_VAL($cacheid,
 
2901
                             [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
 
2902
                                             [eval $cacheid=yes],
 
2903
                                             [eval $cacheid=no])])
 
2904
 
 
2905
                PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
 
2906
 
 
2907
                eval supported=\$$cacheid
 
2908
                AC_MSG_RESULT([$supported])
 
2909
                if test "$supported" = "yes" ; then
 
2910
                        $1="$$1 ]flag["
 
2911
                        found="yes"
 
2912
                fi
 
2913
        fi
 
2914
])
 
2915
]) # XORG_TESTSET_CFLAG
 
2916
 
 
2917
# XORG_COMPILER_FLAGS
 
2918
# ---------------
 
2919
# Minimum version: 1.16.0
 
2920
#
 
2921
# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
 
2922
# arguments supported by the selected compiler which do NOT alter the generated
 
2923
# code.  These arguments will cause the compiler to print various warnings
 
2924
# during compilation AND turn a conservative set of warnings into errors.
 
2925
#
 
2926
# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
 
2927
# future versions of util-macros as options are added to new compilers.
 
2928
#
 
2929
AC_DEFUN([XORG_COMPILER_FLAGS], [
 
2930
AC_REQUIRE([XORG_COMPILER_BRAND])
 
2931
 
 
2932
AC_ARG_ENABLE(selective-werror,
 
2933
              AS_HELP_STRING([--disable-selective-werror],
 
2934
                             [Turn off selective compiler errors. (default: enabled)]),
 
2935
              [SELECTIVE_WERROR=$enableval],
 
2936
              [SELECTIVE_WERROR=yes])
 
2937
 
 
2938
AC_LANG_CASE(
 
2939
        [C], [
 
2940
                define([PREFIX], [C])
 
2941
        ],
 
2942
        [C++], [
 
2943
                define([PREFIX], [CXX])
 
2944
        ]
 
2945
)
 
2946
# -v is too short to test reliably with XORG_TESTSET_CFLAG
 
2947
if test "x$SUNCC" = "xyes"; then
 
2948
    [BASE_]PREFIX[FLAGS]="-v"
 
2949
else
 
2950
    [BASE_]PREFIX[FLAGS]=""
 
2951
fi
 
2952
 
 
2953
# This chunk of warnings were those that existed in the legacy CWARNFLAGS
 
2954
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
 
2955
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
 
2956
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
 
2957
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
 
2958
 
 
2959
AC_LANG_CASE(
 
2960
        [C], [
 
2961
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
 
2962
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
 
2963
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
 
2964
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
 
2965
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
 
2966
                XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
 
2967
        ]
 
2968
)
 
2969
 
 
2970
# This chunk adds additional warnings that could catch undesired effects.
 
2971
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
 
2972
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
 
2973
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
 
2974
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
 
2975
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
 
2976
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
 
2977
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
 
2978
 
 
2979
# These are currently disabled because they are noisy.  They will be enabled
 
2980
# in the future once the codebase is sufficiently modernized to silence
 
2981
# them.  For now, I don't want them to drown out the other warnings.
 
2982
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
 
2983
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
 
2984
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
 
2985
 
 
2986
# Turn some warnings into errors, so we don't accidently get successful builds
 
2987
# when there are problems that should be fixed.
 
2988
 
 
2989
if test "x$SELECTIVE_WERROR" = "xyes" ; then
 
2990
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
 
2991
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
 
2992
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
 
2993
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
 
2994
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
 
2995
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
 
2996
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
 
2997
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
 
2998
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
 
2999
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
 
3000
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
 
3001
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
 
3002
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
 
3003
else
 
3004
AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
 
3005
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
 
3006
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
 
3007
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
 
3008
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
 
3009
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
 
3010
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
 
3011
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
 
3012
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
 
3013
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
 
3014
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
 
3015
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
 
3016
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
 
3017
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
 
3018
fi
 
3019
 
 
3020
AC_SUBST([BASE_]PREFIX[FLAGS])
 
3021
]) # XORG_COMPILER_FLAGS
 
3022
 
2399
3023
# XORG_CWARNFLAGS
2400
3024
# ---------------
2401
3025
# Minimum version: 1.2.0
 
3026
# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2402
3027
#
2403
3028
# Defines CWARNFLAGS to enable C compiler warnings.
2404
3029
#
 
3030
# This function is deprecated because it defines -fno-strict-aliasing
 
3031
# which alters the code generated by the compiler.  If -fno-strict-aliasing
 
3032
# is needed, then it should be added explicitly in the module when
 
3033
# it is updated to use BASE_CFLAGS.
 
3034
#
2405
3035
AC_DEFUN([XORG_CWARNFLAGS], [
2406
 
AC_REQUIRE([AC_PROG_CC_C99])
 
3036
AC_REQUIRE([XORG_COMPILER_FLAGS])
2407
3037
AC_REQUIRE([XORG_COMPILER_BRAND])
2408
 
if  test "x$GCC" = xyes ; then
2409
 
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2410
 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2411
 
-Wbad-function-cast -Wformat=2"
2412
 
    case `$CC -dumpversion` in
2413
 
    3.4.* | 4.*)
2414
 
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2415
 
        ;;
2416
 
    esac
2417
 
else
2418
 
    if test "x$SUNCC" = "xyes"; then
2419
 
        CWARNFLAGS="-v"
2420
 
    fi
2421
 
fi
2422
 
AC_SUBST(CWARNFLAGS)
 
3038
AC_LANG_CASE(
 
3039
        [C], [
 
3040
                CWARNFLAGS="$BASE_CFLAGS"
 
3041
                if  test "x$GCC" = xyes ; then
 
3042
                    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
 
3043
                fi
 
3044
                AC_SUBST(CWARNFLAGS)
 
3045
        ]
 
3046
)
2423
3047
]) # XORG_CWARNFLAGS
2424
3048
 
2425
3049
# XORG_STRICT_OPTION
2429
3053
# Add configure option to enable strict compilation flags, such as treating
2430
3054
# warnings as fatal errors.
2431
3055
# If --enable-strict-compilation is passed to configure, adds strict flags to
2432
 
# $CWARNFLAGS.
 
3056
# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2433
3057
#
2434
3058
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2435
3059
# when strict compilation is unconditionally desired.
2436
3060
AC_DEFUN([XORG_STRICT_OPTION], [
2437
 
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2438
 
AC_REQUIRE([AC_PROG_CC_C99])
2439
 
AC_REQUIRE([XORG_COMPILER_BRAND])
2440
3061
AC_REQUIRE([XORG_CWARNFLAGS])
 
3062
AC_REQUIRE([XORG_COMPILER_FLAGS])
2441
3063
 
2442
3064
AC_ARG_ENABLE(strict-compilation,
2443
3065
                          AS_HELP_STRING([--enable-strict-compilation],
2444
3066
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
2445
3067
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2446
 
if test "x$GCC" = xyes ; then
2447
 
    STRICT_CFLAGS="-pedantic -Werror"
2448
 
    # Add -Werror=attributes if supported (gcc 4.2 & later)
2449
 
    AC_MSG_CHECKING([if $CC supports -Werror=attributes])
2450
 
    save_CFLAGS="$CFLAGS"
2451
 
    CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
2452
 
    AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
2453
 
                      [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
2454
 
                       AC_MSG_RESULT([yes])],
2455
 
                      [AC_MSG_RESULT([no])])
2456
 
    CFLAGS="$save_CFLAGS"
2457
 
elif test "x$SUNCC" = "xyes"; then
2458
 
    STRICT_CFLAGS="-errwarn"
2459
 
elif test "x$INTELCC" = "xyes"; then
2460
 
    STRICT_CFLAGS="-Werror"
2461
 
fi
 
3068
 
 
3069
AC_LANG_CASE(
 
3070
        [C], [
 
3071
                define([PREFIX], [C])
 
3072
        ],
 
3073
        [C++], [
 
3074
                define([PREFIX], [CXX])
 
3075
        ]
 
3076
)
 
3077
 
 
3078
[STRICT_]PREFIX[FLAGS]=""
 
3079
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
 
3080
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
 
3081
 
 
3082
# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
 
3083
# activate it with -Werror, so we add it here explicitly.
 
3084
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
 
3085
 
2462
3086
if test "x$STRICT_COMPILE" = "xyes"; then
2463
 
    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
 
3087
    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
 
3088
    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2464
3089
fi
2465
 
AC_SUBST([STRICT_CFLAGS])
2466
 
AC_SUBST([CWARNFLAGS])
 
3090
AC_SUBST([STRICT_]PREFIX[FLAGS])
 
3091
AC_SUBST([BASE_]PREFIX[FLAGS])
 
3092
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2467
3093
]) # XORG_STRICT_OPTION
2468
3094
 
2469
3095
# XORG_DEFAULT_OPTIONS
2474
3100
#
2475
3101
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2476
3102
AC_REQUIRE([AC_PROG_INSTALL])
 
3103
XORG_COMPILER_FLAGS
2477
3104
XORG_CWARNFLAGS
2478
3105
XORG_STRICT_OPTION
2479
3106
XORG_RELEASE_VERSION
2565
3192
AC_SUBST([CHANGELOG_CMD])
2566
3193
]) # XORG_CHANGELOG
2567
3194
 
2568
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2569
 
2570
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2571
 
#
2572
 
# This program is free software; you can redistribute it and/or modify
2573
 
# it under the terms of the GNU General Public License as published by
2574
 
# the Free Software Foundation; either version 2 of the License, or
2575
 
# (at your option) any later version.
2576
 
#
2577
 
# This program is distributed in the hope that it will be useful, but
2578
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
2579
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2580
 
# General Public License for more details.
2581
 
#
2582
 
# You should have received a copy of the GNU General Public License
2583
 
# along with this program; if not, write to the Free Software
2584
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2585
 
#
2586
 
# As a special exception to the GNU General Public License, if you
2587
 
# distribute this file as part of a program that contains a
2588
 
# configuration script generated by Autoconf, you may include it under
2589
 
# the same distribution terms that you use for the rest of that program.
2590
 
 
2591
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2592
 
# ----------------------------------
2593
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
2594
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2595
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2596
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2597
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2598
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2599
 
fi
2600
 
if test -n "$PKG_CONFIG"; then
2601
 
        _pkg_min_version=m4_default([$1], [0.9.0])
2602
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2603
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2604
 
                AC_MSG_RESULT([yes])
2605
 
        else
2606
 
                AC_MSG_RESULT([no])
2607
 
                PKG_CONFIG=""
2608
 
        fi
2609
 
                
2610
 
fi[]dnl
2611
 
])# PKG_PROG_PKG_CONFIG
2612
 
 
2613
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2614
 
#
2615
 
# Check to see whether a particular set of modules exists.  Similar
2616
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2617
 
#
2618
 
#
2619
 
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2620
 
# this or PKG_CHECK_MODULES is called, or make sure to call
2621
 
# PKG_CHECK_EXISTS manually
2622
 
# --------------------------------------------------------------
2623
 
AC_DEFUN([PKG_CHECK_EXISTS],
2624
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2625
 
if test -n "$PKG_CONFIG" && \
2626
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2627
 
  m4_ifval([$2], [$2], [:])
2628
 
m4_ifvaln([$3], [else
2629
 
  $3])dnl
2630
 
fi])
2631
 
 
2632
 
 
2633
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2634
 
# ---------------------------------------------
2635
 
m4_define([_PKG_CONFIG],
2636
 
[if test -n "$$1"; then
2637
 
    pkg_cv_[]$1="$$1"
2638
 
 elif test -n "$PKG_CONFIG"; then
2639
 
    PKG_CHECK_EXISTS([$3],
2640
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2641
 
                     [pkg_failed=yes])
2642
 
 else
2643
 
    pkg_failed=untried
2644
 
fi[]dnl
2645
 
])# _PKG_CONFIG
2646
 
 
2647
 
# _PKG_SHORT_ERRORS_SUPPORTED
2648
 
# -----------------------------
2649
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2650
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2651
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2652
 
        _pkg_short_errors_supported=yes
2653
 
else
2654
 
        _pkg_short_errors_supported=no
2655
 
fi[]dnl
2656
 
])# _PKG_SHORT_ERRORS_SUPPORTED
2657
 
 
2658
 
 
2659
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2660
 
# [ACTION-IF-NOT-FOUND])
2661
 
#
2662
 
#
2663
 
# Note that if there is a possibility the first call to
2664
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
2665
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2666
 
#
2667
 
#
2668
 
# --------------------------------------------------------------
2669
 
AC_DEFUN([PKG_CHECK_MODULES],
2670
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2671
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2672
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2673
 
 
2674
 
pkg_failed=no
2675
 
AC_MSG_CHECKING([for $1])
2676
 
 
2677
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2678
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2679
 
 
2680
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2681
 
and $1[]_LIBS to avoid the need to call pkg-config.
2682
 
See the pkg-config man page for more details.])
2683
 
 
2684
 
if test $pkg_failed = yes; then
2685
 
        _PKG_SHORT_ERRORS_SUPPORTED
2686
 
        if test $_pkg_short_errors_supported = yes; then
2687
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2688
 
        else 
2689
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2690
 
        fi
2691
 
        # Put the nasty error message in config.log where it belongs
2692
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2693
 
 
2694
 
        ifelse([$4], , [AC_MSG_ERROR(dnl
2695
 
[Package requirements ($2) were not met:
2696
 
 
2697
 
$$1_PKG_ERRORS
2698
 
 
2699
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
2700
 
installed software in a non-standard prefix.
2701
 
 
2702
 
_PKG_TEXT
2703
 
])],
2704
 
                [AC_MSG_RESULT([no])
2705
 
                $4])
2706
 
elif test $pkg_failed = untried; then
2707
 
        ifelse([$4], , [AC_MSG_FAILURE(dnl
2708
 
[The pkg-config script could not be found or is too old.  Make sure it
2709
 
is in your PATH or set the PKG_CONFIG environment variable to the full
2710
 
path to pkg-config.
2711
 
 
2712
 
_PKG_TEXT
2713
 
 
2714
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2715
 
                [$4])
2716
 
else
2717
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2718
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2719
 
        AC_MSG_RESULT([yes])
2720
 
        ifelse([$3], , :, [$3])
2721
 
fi[]dnl
2722
 
])# PKG_CHECK_MODULES
2723