source: trunk/FACT++/aclocal.m4 @ 10335

Last change on this file since 10335 was 10335, checked in by tbretz, 9 years ago
Updated with latest changes in configure.ac.
File size: 101.9 KB
Line 
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.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
17[m4_warning([this file was generated for autoconf 2.67.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22# ===========================================================================
23#              http://autoconf-archive.cryp.to/acx_pthread.html
24# ===========================================================================
25#
26# SYNOPSIS
27#
28#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
29#
30# DESCRIPTION
31#
32#   This macro figures out how to build C programs using POSIX threads. It
33#   sets the PTHREAD_LIBS output variable to the threads library and linker
34#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
35#   flags that are needed. (The user can also force certain compiler
36#   flags/libs to be tested by setting these environment variables.)
37#
38#   Also sets PTHREAD_CC to any special C compiler that is needed for
39#   multi-threaded programs (defaults to the value of CC otherwise). (This
40#   is necessary on AIX to use the special cc_r compiler alias.)
41#
42#   NOTE: You are assumed to not only compile your program with these flags,
43#   but also link it with them as well. e.g. you should link with
44#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
45#
46#   If you are only building threads programs, you may wish to use these
47#   variables in your default LIBS, CFLAGS, and CC:
48#
49#          LIBS="$PTHREAD_LIBS $LIBS"
50#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
51#          CC="$PTHREAD_CC"
52#
53#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
54#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
55#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
56#
57#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
58#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
59#   is not found. If ACTION-IF-FOUND is not specified, the default action
60#   will define HAVE_PTHREAD.
61#
62#   Please let the authors know if this macro fails on any platform, or if
63#   you have any other suggestions or comments. This macro was based on work
64#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
65#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
66#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
67#   grateful for the helpful feedback of numerous users.
68#
69# LICENSE
70#
71#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
72#
73#   This program is free software: you can redistribute it and/or modify it
74#   under the terms of the GNU General Public License as published by the
75#   Free Software Foundation, either version 3 of the License, or (at your
76#   option) any later version.
77#
78#   This program is distributed in the hope that it will be useful, but
79#   WITHOUT ANY WARRANTY; without even the implied warranty of
80#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
81#   Public License for more details.
82#
83#   You should have received a copy of the GNU General Public License along
84#   with this program. If not, see <http://www.gnu.org/licenses/>.
85#
86#   As a special exception, the respective Autoconf Macro's copyright owner
87#   gives unlimited permission to copy, distribute and modify the configure
88#   scripts that are the output of Autoconf when processing the Macro. You
89#   need not follow the terms of the GNU General Public License when using
90#   or distributing such scripts, even though portions of the text of the
91#   Macro appear in them. The GNU General Public License (GPL) does govern
92#   all other use of the material that constitutes the Autoconf Macro.
93#
94#   This special exception to the GPL applies to versions of the Autoconf
95#   Macro released by the Autoconf Archive. When you make and distribute a
96#   modified version of the Autoconf Macro, you may extend this special
97#   exception to the GPL to apply to your modified version as well.
98
99AC_DEFUN([ACX_PTHREAD], [
100AC_REQUIRE([AC_CANONICAL_HOST])
101AC_LANG_SAVE
102AC_LANG_C
103acx_pthread_ok=no
104
105# We used to check for pthread.h first, but this fails if pthread.h
106# requires special compiler flags (e.g. on True64 or Sequent).
107# It gets checked for in the link test anyway.
108
109# First of all, check if the user has set any of the PTHREAD_LIBS,
110# etcetera environment variables, and if threads linking works using
111# them:
112if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
113        save_CFLAGS="$CFLAGS"
114        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
115        save_LIBS="$LIBS"
116        LIBS="$PTHREAD_LIBS $LIBS"
117        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
118        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
119        AC_MSG_RESULT($acx_pthread_ok)
120        if test x"$acx_pthread_ok" = xno; then
121                PTHREAD_LIBS=""
122                PTHREAD_CFLAGS=""
123        fi
124        LIBS="$save_LIBS"
125        CFLAGS="$save_CFLAGS"
126fi
127
128# We must check for the threads library under a number of different
129# names; the ordering is very important because some systems
130# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
131# libraries is broken (non-POSIX).
132
133# Create a list of thread flags to try.  Items starting with a "-" are
134# C compiler flags, and other items are library names, except for "none"
135# which indicates that we try without any flags at all, and "pthread-config"
136# which is a program returning the flags for the Pth emulation library.
137
138acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
139
140# The ordering *is* (sometimes) important.  Some notes on the
141# individual items follow:
142
143# pthreads: AIX (must check this before -lpthread)
144# none: in case threads are in libc; should be tried before -Kthread and
145#       other compiler flags to prevent continual compiler warnings
146# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
147# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
148# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
149# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
150# -pthreads: Solaris/gcc
151# -mthreads: Mingw32/gcc, Lynx/gcc
152# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
153#      doesn't hurt to check since this sometimes defines pthreads too;
154#      also defines -D_REENTRANT)
155#      ... -mt is also the pthreads flag for HP/aCC
156# pthread: Linux, etcetera
157# --thread-safe: KAI C++
158# pthread-config: use pthread-config program (for GNU Pth library)
159
160case "${host_cpu}-${host_os}" in
161        *solaris*)
162
163        # On Solaris (at least, for some versions), libc contains stubbed
164        # (non-functional) versions of the pthreads routines, so link-based
165        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
166        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
167        # a function called by this macro, so we could check for that, but
168        # who knows whether they'll stub that too in a future libc.)  So,
169        # we'll just look for -pthreads and -lpthread first:
170
171        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
172        ;;
173esac
174
175if test x"$acx_pthread_ok" = xno; then
176for flag in $acx_pthread_flags; do
177
178        case $flag in
179                none)
180                AC_MSG_CHECKING([whether pthreads work without any flags])
181                ;;
182
183                -*)
184                AC_MSG_CHECKING([whether pthreads work with $flag])
185                PTHREAD_CFLAGS="$flag"
186                ;;
187
188                pthread-config)
189                AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
190                if test x"$acx_pthread_config" = xno; then continue; fi
191                PTHREAD_CFLAGS="`pthread-config --cflags`"
192                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
193                ;;
194
195                *)
196                AC_MSG_CHECKING([for the pthreads library -l$flag])
197                PTHREAD_LIBS="-l$flag"
198                ;;
199        esac
200
201        save_LIBS="$LIBS"
202        save_CFLAGS="$CFLAGS"
203        LIBS="$PTHREAD_LIBS $LIBS"
204        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
205
206        # Check for various functions.  We must include pthread.h,
207        # since some functions may be macros.  (On the Sequent, we
208        # need a special flag -Kthread to make this header compile.)
209        # We check for pthread_join because it is in -lpthread on IRIX
210        # while pthread_create is in libc.  We check for pthread_attr_init
211        # due to DEC craziness with -lpthreads.  We check for
212        # pthread_cleanup_push because it is one of the few pthread
213        # functions on Solaris that doesn't have a non-functional libc stub.
214        # We try pthread_create on general principles.
215        AC_TRY_LINK([#include <pthread.h>],
216                    [pthread_t th; pthread_join(th, 0);
217                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
218                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
219                    [acx_pthread_ok=yes])
220
221        LIBS="$save_LIBS"
222        CFLAGS="$save_CFLAGS"
223
224        AC_MSG_RESULT($acx_pthread_ok)
225        if test "x$acx_pthread_ok" = xyes; then
226                break;
227        fi
228
229        PTHREAD_LIBS=""
230        PTHREAD_CFLAGS=""
231done
232fi
233
234# Various other checks:
235if test "x$acx_pthread_ok" = xyes; then
236        save_LIBS="$LIBS"
237        LIBS="$PTHREAD_LIBS $LIBS"
238        save_CFLAGS="$CFLAGS"
239        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
240
241        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
242        AC_MSG_CHECKING([for joinable pthread attribute])
243        attr_name=unknown
244        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
245            AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
246                        [attr_name=$attr; break])
247        done
248        AC_MSG_RESULT($attr_name)
249        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
250            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
251                               [Define to necessary symbol if this constant
252                                uses a non-standard name on your system.])
253        fi
254
255        AC_MSG_CHECKING([if more special flags are required for pthreads])
256        flag=no
257        case "${host_cpu}-${host_os}" in
258            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
259            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
260        esac
261        AC_MSG_RESULT(${flag})
262        if test "x$flag" != xno; then
263            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
264        fi
265
266        LIBS="$save_LIBS"
267        CFLAGS="$save_CFLAGS"
268
269        # More AIX lossage: must compile with xlc_r or cc_r
270        if test x"$GCC" != xyes; then
271          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
272        else
273          PTHREAD_CC=$CC
274        fi
275else
276        PTHREAD_CC="$CC"
277fi
278
279AC_SUBST(PTHREAD_LIBS)
280AC_SUBST(PTHREAD_CFLAGS)
281AC_SUBST(PTHREAD_CC)
282
283# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
284if test x"$acx_pthread_ok" = xyes; then
285        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
286        :
287else
288        acx_pthread_ok=no
289        $2
290fi
291AC_LANG_RESTORE
292])dnl ACX_PTHREAD
293
294# ===========================================================================
295#             http://autoconf-archive.cryp.to/ax_boost_asio.html
296# ===========================================================================
297#
298# SYNOPSIS
299#
300#   AX_BOOST_ASIO
301#
302# DESCRIPTION
303#
304#   Test for Asio library from the Boost C++ libraries. The macro requires a
305#   preceding call to AX_BOOST_BASE. Further documentation is available at
306#   <http://randspringer.de/boost/index.html>.
307#
308#   This macro calls:
309#
310#     AC_SUBST(BOOST_ASIO_LIB)
311#
312#   And sets:
313#
314#     HAVE_BOOST_ASIO
315#
316# LICENSE
317#
318#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
319#   Copyright (c) 2008 Pete Greenwell <pete@mu.org>
320#
321#   Copying and distribution of this file, with or without modification, are
322#   permitted in any medium without royalty provided the copyright notice
323#   and this notice are preserved.
324
325AC_DEFUN([AX_BOOST_ASIO],
326[
327        AC_ARG_WITH([boost-asio],
328        AS_HELP_STRING([--with-boost-asio@<:@=special-lib@:>@],
329                   [use the ASIO library from boost - it is possible to specify a certain library for the linker
330                        e.g. --with-boost-asio=boost_system-gcc41-mt-1_34 ]),
331        [
332        if test "$withval" = "no"; then
333                        want_boost="no"
334        elif test "$withval" = "yes"; then
335            want_boost="yes"
336            ax_boost_user_asio_lib=""
337        else
338                    want_boost="yes"
339                ax_boost_user_asio_lib="$withval"
340                fi
341        ],
342        [want_boost="yes"]
343        )
344
345        if test "x$want_boost" = "xyes"; then
346        AC_REQUIRE([AC_PROG_CC])
347                CPPFLAGS_SAVED="$CPPFLAGS"
348                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
349                export CPPFLAGS
350
351                LDFLAGS_SAVED="$LDFLAGS"
352                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
353                export LDFLAGS
354
355        AC_CACHE_CHECK(whether the Boost::ASIO library is available,
356                                           ax_cv_boost_asio,
357        [AC_LANG_PUSH([C++])
358                 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ @%:@include <boost/asio.hpp>
359                                                                                        ]],
360                                  [[
361
362                                    boost::asio::io_service io;
363                                    boost::system::error_code timer_result;
364                                    boost::asio::deadline_timer t(io);
365                                    t.cancel();
366                                    io.run_one();
367                                                                        return 0;
368                                   ]]),
369                             ax_cv_boost_asio=yes, ax_cv_boost_asio=no)
370         AC_LANG_POP([C++])
371                ])
372                if test "x$ax_cv_boost_asio" = "xyes"; then
373                        AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available])
374                        BN=boost_system
375            if test "x$ax_boost_user_asio_lib" = "x"; then
376                                for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
377                              lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
378                              $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
379                                    AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break],
380                                 [link_thread="no"])
381                                done
382            else
383               for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; do
384                                      AC_CHECK_LIB($ax_lib, main,
385                                   [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_asio="yes" break],
386                                   [link_asio="no"])
387                  done
388
389            fi
390                        if test "x$link_asio" = "xno"; then
391                                AC_MSG_ERROR(Could not link against $ax_lib !)
392                        fi
393                fi
394
395                CPPFLAGS="$CPPFLAGS_SAVED"
396        LDFLAGS="$LDFLAGS_SAVED"
397        fi
398])
399
400# ===========================================================================
401#             http://autoconf-archive.cryp.to/ax_boost_base.html
402# ===========================================================================
403#
404# SYNOPSIS
405#
406#   AX_BOOST_BASE([MINIMUM-VERSION])
407#
408# DESCRIPTION
409#
410#   Test for the Boost C++ libraries of a particular version (or newer)
411#
412#   If no path to the installed boost library is given the macro searchs
413#   under /usr, /usr/local, /opt and /opt/local and evaluates the
414#   $BOOST_ROOT environment variable. Further documentation is available at
415#   <http://randspringer.de/boost/index.html>.
416#
417#   This macro calls:
418#
419#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
420#
421#   And sets:
422#
423#     HAVE_BOOST
424#
425# LICENSE
426#
427#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
428#
429#   Copying and distribution of this file, with or without modification, are
430#   permitted in any medium without royalty provided the copyright notice
431#   and this notice are preserved.
432
433AC_DEFUN([AX_BOOST_BASE],
434[
435AC_ARG_WITH([boost],
436        AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
437        [
438    if test "$withval" = "no"; then
439                want_boost="no"
440    elif test "$withval" = "yes"; then
441        want_boost="yes"
442        ac_boost_path=""
443    else
444            want_boost="yes"
445        ac_boost_path="$withval"
446        fi
447    ],
448    [want_boost="yes"])
449
450
451AC_ARG_WITH([boost-libdir],
452        AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
453        [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
454        [
455        if test -d $withval
456        then
457                ac_boost_lib_path="$withval"
458        else
459                AC_MSG_ERROR(--with-boost-libdir expected directory name)
460        fi
461        ],
462        [ac_boost_lib_path=""]
463)
464
465if test "x$want_boost" = "xyes"; then
466        boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
467        boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
468        boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
469        boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
470        boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
471        if test "x$boost_lib_version_req_sub_minor" = "x" ; then
472                boost_lib_version_req_sub_minor="0"
473        fi
474        WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+  $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
475        AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
476        succeeded=no
477
478        dnl first we check the system location for boost libraries
479        dnl this location ist chosen if boost libraries are installed with the --layout=system option
480        dnl or if you install boost with RPM
481        if test "$ac_boost_path" != ""; then
482                BOOST_LDFLAGS="-L$ac_boost_path/lib"
483                BOOST_CPPFLAGS="-I$ac_boost_path/include"
484        else
485                for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
486                        if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
487                                BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
488                                BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
489                                break;
490                        fi
491                done
492        fi
493
494    dnl overwrite ld flags if we have required special directory with
495    dnl --with-boost-libdir parameter
496    if test "$ac_boost_lib_path" != ""; then
497       BOOST_LDFLAGS="-L$ac_boost_lib_path"
498    fi
499
500        CPPFLAGS_SAVED="$CPPFLAGS"
501        CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
502        export CPPFLAGS
503
504        LDFLAGS_SAVED="$LDFLAGS"
505        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
506        export LDFLAGS
507
508        AC_LANG_PUSH(C++)
509        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
510        @%:@include <boost/version.hpp>
511        ]], [[
512        #if BOOST_VERSION >= $WANT_BOOST_VERSION
513        // Everything is okay
514        #else
515        #  error Boost version is too old
516        #endif
517        ]])],[
518        AC_MSG_RESULT(yes)
519        succeeded=yes
520        found_system=yes
521        ],[
522        ])
523        AC_LANG_POP([C++])
524
525
526
527        dnl if we found no boost with system layout we search for boost libraries
528        dnl built and installed without the --layout=system option or for a staged(not installed) version
529        if test "x$succeeded" != "xyes"; then
530                _version=0
531                if test "$ac_boost_path" != ""; then
532                        if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
533                                for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
534                                        _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
535                                        V_CHECK=`expr $_version_tmp \> $_version`
536                                        if test "$V_CHECK" = "1" ; then
537                                                _version=$_version_tmp
538                                        fi
539                                        VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
540                                        BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
541                                done
542                        fi
543                else
544                        for ac_boost_path in /usr /usr/local /opt /opt/local ; do
545                                if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
546                                        for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
547                                                _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
548                                                V_CHECK=`expr $_version_tmp \> $_version`
549                                                if test "$V_CHECK" = "1" ; then
550                                                        _version=$_version_tmp
551                                                        best_path=$ac_boost_path
552                                                fi
553                                        done
554                                fi
555                        done
556
557                        VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
558                        BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
559            if test "$ac_boost_lib_path" = ""
560            then
561               BOOST_LDFLAGS="-L$best_path/lib"
562            fi
563
564                        if test "x$BOOST_ROOT" != "x"; then
565                                if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
566                                        version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
567                                        stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
568                                        stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
569                                        V_CHECK=`expr $stage_version_shorten \>\= $_version`
570                    if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
571                                                AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
572                                                BOOST_CPPFLAGS="-I$BOOST_ROOT"
573                                                BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
574                                        fi
575                                fi
576                        fi
577                fi
578
579                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
580                export CPPFLAGS
581                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
582                export LDFLAGS
583
584                AC_LANG_PUSH(C++)
585                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
586                @%:@include <boost/version.hpp>
587                ]], [[
588                #if BOOST_VERSION >= $WANT_BOOST_VERSION
589                // Everything is okay
590                #else
591                #  error Boost version is too old
592                #endif
593                ]])],[
594                AC_MSG_RESULT(yes)
595                succeeded=yes
596                found_system=yes
597                ],[
598                ])
599                AC_LANG_POP([C++])
600        fi
601
602        if test "$succeeded" != "yes" ; then
603                if test "$_version" = "0" ; then
604                        AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
605                else
606                        AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
607                fi
608        else
609                AC_SUBST(BOOST_CPPFLAGS)
610                AC_SUBST(BOOST_LDFLAGS)
611                AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
612        fi
613
614        CPPFLAGS="$CPPFLAGS_SAVED"
615        LDFLAGS="$LDFLAGS_SAVED"
616fi
617
618])
619
620# ===========================================================================
621#           http://autoconf-archive.cryp.to/ax_boost_date_time.html
622# ===========================================================================
623#
624# SYNOPSIS
625#
626#   AX_BOOST_DATE_TIME
627#
628# DESCRIPTION
629#
630#   Test for Date_Time library from the Boost C++ libraries. The macro
631#   requires a preceding call to AX_BOOST_BASE. Further documentation is
632#   available at <http://randspringer.de/boost/index.html>.
633#
634#   This macro calls:
635#
636#     AC_SUBST(BOOST_DATE_TIME_LIB)
637#
638#   And sets:
639#
640#     HAVE_BOOST_DATE_TIME
641#
642# LICENSE
643#
644#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
645#   Copyright (c) 2008 Michael Tindal
646#
647#   Copying and distribution of this file, with or without modification, are
648#   permitted in any medium without royalty provided the copyright notice
649#   and this notice are preserved.
650
651AC_DEFUN([AX_BOOST_DATE_TIME],
652[
653        AC_ARG_WITH([boost-date-time],
654        AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
655                   [use the Date_Time library from boost - it is possible to specify a certain library for the linker
656                        e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
657        [
658        if test "$withval" = "no"; then
659                        want_boost="no"
660        elif test "$withval" = "yes"; then
661            want_boost="yes"
662            ax_boost_user_date_time_lib=""
663        else
664                    want_boost="yes"
665                ax_boost_user_date_time_lib="$withval"
666                fi
667        ],
668        [want_boost="yes"]
669        )
670
671        if test "x$want_boost" = "xyes"; then
672        AC_REQUIRE([AC_PROG_CC])
673                CPPFLAGS_SAVED="$CPPFLAGS"
674                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
675                export CPPFLAGS
676
677                LDFLAGS_SAVED="$LDFLAGS"
678                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
679                export LDFLAGS
680
681        AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
682                                           ax_cv_boost_date_time,
683        [AC_LANG_PUSH([C++])
684                 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
685                                   [[using namespace boost::gregorian; date d(2002,Jan,10);
686                                     return 0;
687                                   ]]),
688         ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
689         AC_LANG_POP([C++])
690                ])
691                if test "x$ax_cv_boost_date_time" = "xyes"; then
692                        AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
693            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
694            if test "x$ax_boost_user_date_time_lib" = "x"; then
695                for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
696                     ax_lib=${libextension}
697                                    AC_CHECK_LIB($ax_lib, exit,
698                                 [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
699                                 [link_date_time="no"])
700                                done
701                if test "x$link_date_time" != "xyes"; then
702                for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
703                     ax_lib=${libextension}
704                                    AC_CHECK_LIB($ax_lib, exit,
705                                 [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
706                                 [link_date_time="no"])
707                                done
708                fi
709
710            else
711               for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
712                                      AC_CHECK_LIB($ax_lib, main,
713                                   [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
714                                   [link_date_time="no"])
715                  done
716
717            fi
718                        if test "x$link_date_time" != "xyes"; then
719                                AC_MSG_ERROR(Could not link against $ax_lib !)
720                        fi
721                fi
722
723                CPPFLAGS="$CPPFLAGS_SAVED"
724        LDFLAGS="$LDFLAGS_SAVED"
725        fi
726])
727
728# ===========================================================================
729#          http://autoconf-archive.cryp.to/ax_boost_filesystem.html
730# ===========================================================================
731#
732# SYNOPSIS
733#
734#   AX_BOOST_FILESYSTEM
735#
736# DESCRIPTION
737#
738#   Test for Filesystem library from the Boost C++ libraries. The macro
739#   requires a preceding call to AX_BOOST_BASE. Further documentation is
740#   available at <http://randspringer.de/boost/index.html>.
741#
742#   This macro calls:
743#
744#     AC_SUBST(BOOST_FILESYSTEM_LIB)
745#
746#   And sets:
747#
748#     HAVE_BOOST_FILESYSTEM
749#
750# LICENSE
751#
752#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
753#   Copyright (c) 2009 Michael Tindal
754#   Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
755#
756#   Copying and distribution of this file, with or without modification, are
757#   permitted in any medium without royalty provided the copyright notice
758#   and this notice are preserved.
759
760AC_DEFUN([AX_BOOST_FILESYSTEM],
761[
762        AC_ARG_WITH([boost-filesystem],
763        AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
764                   [use the Filesystem library from boost - it is possible to specify a certain library for the linker
765                        e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
766        [
767        if test "$withval" = "no"; then
768                        want_boost="no"
769        elif test "$withval" = "yes"; then
770            want_boost="yes"
771            ax_boost_user_filesystem_lib=""
772        else
773                    want_boost="yes"
774                ax_boost_user_filesystem_lib="$withval"
775                fi
776        ],
777        [want_boost="yes"]
778        )
779
780        if test "x$want_boost" = "xyes"; then
781        AC_REQUIRE([AC_PROG_CC])
782                CPPFLAGS_SAVED="$CPPFLAGS"
783                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
784                export CPPFLAGS
785
786                LDFLAGS_SAVED="$LDFLAGS"
787                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
788                export LDFLAGS
789
790                LIBS_SAVED=$LIBS
791                LIBS="$LIBS $BOOST_SYSTEM_LIB"
792                export LIBS
793
794        AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
795                                           ax_cv_boost_filesystem,
796        [AC_LANG_PUSH([C++])
797         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
798                                   [[using namespace boost::filesystem;
799                                   path my_path( "foo/bar/data.txt" );
800                                   return 0;]]),
801                                               ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
802         AC_LANG_POP([C++])
803                ])
804                if test "x$ax_cv_boost_filesystem" = "xyes"; then
805                        AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
806            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
807            if test "x$ax_boost_user_filesystem_lib" = "x"; then
808                for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.dylib$;\1;'` ; do
809                     ax_lib=${libextension}
810                                    AC_CHECK_LIB($ax_lib, exit,
811                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
812                                 [link_filesystem="no"])
813                                done
814                if test "x$link_program_options" != "xyes"; then
815                for libextension in `ls $BOOSTLIBDIR/boost_filesystem*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_filesystem.*\)\.dll.*$;\1;' -e 's;^\(boost_filesystem.*\)\.a*$;\1;'` ; do
816                     ax_lib=${libextension}
817                                    AC_CHECK_LIB($ax_lib, exit,
818                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
819                                 [link_filesystem="no"])
820                                done
821                    fi
822            else
823               for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
824                                      AC_CHECK_LIB($ax_lib, exit,
825                                   [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
826                                   [link_filesystem="no"])
827                  done
828
829            fi
830                        if test "x$link_filesystem" != "xyes"; then
831                                AC_MSG_ERROR(Could not link against $ax_lib !)
832                        fi
833                fi
834
835                CPPFLAGS="$CPPFLAGS_SAVED"
836                LDFLAGS="$LDFLAGS_SAVED"
837                LIBS="$LIBS_SAVED"
838        fi
839])
840
841# ===========================================================================
842#        http://autoconf-archive.cryp.to/ax_boost_program_options.html
843# ===========================================================================
844#
845# SYNOPSIS
846#
847#   AX_BOOST_PROGRAM_OPTIONS
848#
849# DESCRIPTION
850#
851#   Test for program options library from the Boost C++ libraries. The macro
852#   requires a preceding call to AX_BOOST_BASE. Further documentation is
853#   available at <http://randspringer.de/boost/index.html>.
854#
855#   This macro calls:
856#
857#     AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
858#
859#   And sets:
860#
861#     HAVE_BOOST_PROGRAM_OPTIONS
862#
863# LICENSE
864#
865#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
866#
867#   Copying and distribution of this file, with or without modification, are
868#   permitted in any medium without royalty provided the copyright notice
869#   and this notice are preserved.
870
871AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
872[
873        AC_ARG_WITH([boost-program-options],
874                AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
875                       [use the program options library from boost - it is possible to specify a certain library for the linker
876                        e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
877        [
878        if test "$withval" = "no"; then
879                        want_boost="no"
880        elif test "$withval" = "yes"; then
881            want_boost="yes"
882            ax_boost_user_program_options_lib=""
883        else
884                    want_boost="yes"
885                ax_boost_user_program_options_lib="$withval"
886                fi
887        ],
888        [want_boost="yes"]
889        )
890
891        if test "x$want_boost" = "xyes"; then
892        AC_REQUIRE([AC_PROG_CC])
893            export want_boost
894                CPPFLAGS_SAVED="$CPPFLAGS"
895                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
896                export CPPFLAGS
897                LDFLAGS_SAVED="$LDFLAGS"
898                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
899                export LDFLAGS
900                AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
901                                           ax_cv_boost_program_options,
902                                           [AC_LANG_PUSH(C++)
903                                AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
904                                                          ]],
905                                  [[boost::program_options::options_description generic("Generic options");
906                                   return 0;]]),
907                           ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
908                                        AC_LANG_POP([C++])
909                ])
910                if test "$ax_cv_boost_program_options" = yes; then
911                                AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
912                  BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
913                if test "x$ax_boost_user_program_options_lib" = "x"; then
914                for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
915                     ax_lib=${libextension}
916                                    AC_CHECK_LIB($ax_lib, exit,
917                                 [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
918                                 [link_program_options="no"])
919                                done
920                if test "x$link_program_options" != "xyes"; then
921                for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
922                     ax_lib=${libextension}
923                                    AC_CHECK_LIB($ax_lib, exit,
924                                 [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
925                                 [link_program_options="no"])
926                                done
927                fi
928                else
929                  for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
930                                      AC_CHECK_LIB($ax_lib, main,
931                                   [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
932                                   [link_program_options="no"])
933                  done
934                fi
935                                if test "x$link_program_options" != "xyes"; then
936                                        AC_MSG_ERROR([Could not link against [$ax_lib] !])
937                                fi
938                fi
939                CPPFLAGS="$CPPFLAGS_SAVED"
940        LDFLAGS="$LDFLAGS_SAVED"
941        fi
942])
943
944# ===========================================================================
945#             http://autoconf-archive.cryp.to/ax_boost_regex.html
946# ===========================================================================
947#
948# SYNOPSIS
949#
950#   AX_BOOST_REGEX
951#
952# DESCRIPTION
953#
954#   Test for Regex library from the Boost C++ libraries. The macro requires
955#   a preceding call to AX_BOOST_BASE. Further documentation is available at
956#   <http://randspringer.de/boost/index.html>.
957#
958#   This macro calls:
959#
960#     AC_SUBST(BOOST_REGEX_LIB)
961#
962#   And sets:
963#
964#     HAVE_BOOST_REGEX
965#
966# LICENSE
967#
968#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
969#   Copyright (c) 2008 Michael Tindal
970#
971#   Copying and distribution of this file, with or without modification, are
972#   permitted in any medium without royalty provided the copyright notice
973#   and this notice are preserved.
974
975AC_DEFUN([AX_BOOST_REGEX],
976[
977        AC_ARG_WITH([boost-regex],
978        AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
979                   [use the Regex library from boost - it is possible to specify a certain library for the linker
980                        e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
981        [
982        if test "$withval" = "no"; then
983                        want_boost="no"
984        elif test "$withval" = "yes"; then
985            want_boost="yes"
986            ax_boost_user_regex_lib=""
987        else
988                    want_boost="yes"
989                ax_boost_user_regex_lib="$withval"
990                fi
991        ],
992        [want_boost="yes"]
993        )
994
995        if test "x$want_boost" = "xyes"; then
996        AC_REQUIRE([AC_PROG_CC])
997                CPPFLAGS_SAVED="$CPPFLAGS"
998                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
999                export CPPFLAGS
1000
1001                LDFLAGS_SAVED="$LDFLAGS"
1002                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
1003                export LDFLAGS
1004
1005        AC_CACHE_CHECK(whether the Boost::Regex library is available,
1006                                           ax_cv_boost_regex,
1007        [AC_LANG_PUSH([C++])
1008                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
1009                                                                                                ]],
1010                                   [[boost::regex r(); return 0;]]),
1011                   ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
1012         AC_LANG_POP([C++])
1013                ])
1014                if test "x$ax_cv_boost_regex" = "xyes"; then
1015                        AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
1016            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
1017            if test "x$ax_boost_user_regex_lib" = "x"; then
1018                for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do
1019                     ax_lib=${libextension}
1020                                    AC_CHECK_LIB($ax_lib, exit,
1021                                 [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
1022                                 [link_regex="no"])
1023                                done
1024                if test "x$link_regex" != "xyes"; then
1025                for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do
1026                     ax_lib=${libextension}
1027                                    AC_CHECK_LIB($ax_lib, exit,
1028                                 [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
1029                                 [link_regex="no"])
1030                                done
1031                fi
1032
1033            else
1034               for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
1035                                      AC_CHECK_LIB($ax_lib, main,
1036                                   [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
1037                                   [link_regex="no"])
1038               done
1039            fi
1040                        if test "x$link_regex" != "xyes"; then
1041                                AC_MSG_ERROR(Could not link against $ax_lib !)
1042                        fi
1043                fi
1044
1045                CPPFLAGS="$CPPFLAGS_SAVED"
1046        LDFLAGS="$LDFLAGS_SAVED"
1047        fi
1048])
1049
1050# ===========================================================================
1051#            http://autoconf-archive.cryp.to/ax_boost_system.html
1052# ===========================================================================
1053#
1054# SYNOPSIS
1055#
1056#   AX_BOOST_SYSTEM
1057#
1058# DESCRIPTION
1059#
1060#   Test for System library from the Boost C++ libraries. The macro requires
1061#   a preceding call to AX_BOOST_BASE. Further documentation is available at
1062#   <http://randspringer.de/boost/index.html>.
1063#
1064#   This macro calls:
1065#
1066#     AC_SUBST(BOOST_SYSTEM_LIB)
1067#
1068#   And sets:
1069#
1070#     HAVE_BOOST_SYSTEM
1071#
1072# LICENSE
1073#
1074#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
1075#   Copyright (c) 2008 Michael Tindal
1076#   Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
1077#
1078#   Copying and distribution of this file, with or without modification, are
1079#   permitted in any medium without royalty provided the copyright notice
1080#   and this notice are preserved.
1081
1082AC_DEFUN([AX_BOOST_SYSTEM],
1083[
1084        AC_ARG_WITH([boost-system],
1085        AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
1086                   [use the System library from boost - it is possible to specify a certain library for the linker
1087                        e.g. --with-boost-system=boost_system-gcc-mt ]),
1088        [
1089        if test "$withval" = "no"; then
1090                        want_boost="no"
1091        elif test "$withval" = "yes"; then
1092            want_boost="yes"
1093            ax_boost_user_system_lib=""
1094        else
1095                    want_boost="yes"
1096                ax_boost_user_system_lib="$withval"
1097                fi
1098        ],
1099        [want_boost="yes"]
1100        )
1101
1102        if test "x$want_boost" = "xyes"; then
1103        AC_REQUIRE([AC_PROG_CC])
1104        AC_REQUIRE([AC_CANONICAL_BUILD])
1105                CPPFLAGS_SAVED="$CPPFLAGS"
1106                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1107                export CPPFLAGS
1108
1109                LDFLAGS_SAVED="$LDFLAGS"
1110                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
1111                export LDFLAGS
1112
1113        AC_CACHE_CHECK(whether the Boost::System library is available,
1114                                           ax_cv_boost_system,
1115        [AC_LANG_PUSH([C++])
1116                         CXXFLAGS_SAVE=$CXXFLAGS
1117
1118                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
1119                                   [[boost::system::system_category]]),
1120                   ax_cv_boost_system=yes, ax_cv_boost_system=no)
1121                         CXXFLAGS=$CXXFLAGS_SAVE
1122             AC_LANG_POP([C++])
1123                ])
1124                if test "x$ax_cv_boost_system" = "xyes"; then
1125                        AC_SUBST(BOOST_CPPFLAGS)
1126
1127                        AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
1128            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
1129
1130                        LDFLAGS_SAVE=$LDFLAGS
1131            if test "x$ax_boost_user_system_lib" = "x"; then
1132                for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
1133                     ax_lib=${libextension}
1134                                    AC_CHECK_LIB($ax_lib, exit,
1135                                 [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
1136                                 [link_system="no"])
1137                                done
1138                if test "x$link_system" != "xyes"; then
1139                for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
1140                     ax_lib=${libextension}
1141                                    AC_CHECK_LIB($ax_lib, exit,
1142                                 [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
1143                                 [link_system="no"])
1144                                done
1145                fi
1146
1147            else
1148               for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
1149                                      AC_CHECK_LIB($ax_lib, exit,
1150                                   [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
1151                                   [link_system="no"])
1152                  done
1153
1154            fi
1155                        if test "x$link_system" = "xno"; then
1156                                AC_MSG_ERROR(Could not link against $ax_lib !)
1157                        fi
1158                fi
1159
1160                CPPFLAGS="$CPPFLAGS_SAVED"
1161        LDFLAGS="$LDFLAGS_SAVED"
1162        fi
1163])
1164
1165# ===========================================================================
1166#            http://autoconf-archive.cryp.to/ax_boost_thread.html
1167# ===========================================================================
1168#
1169# SYNOPSIS
1170#
1171#   AX_BOOST_THREAD
1172#
1173# DESCRIPTION
1174#
1175#   Test for Thread library from the Boost C++ libraries. The macro requires
1176#   a preceding call to AX_BOOST_BASE. Further documentation is available at
1177#   <http://randspringer.de/boost/index.html>.
1178#
1179#   This macro calls:
1180#
1181#     AC_SUBST(BOOST_THREAD_LIB)
1182#
1183#   And sets:
1184#
1185#     HAVE_BOOST_THREAD
1186#
1187# LICENSE
1188#
1189#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
1190#   Copyright (c) 2009 Michael Tindal
1191#
1192#   Copying and distribution of this file, with or without modification, are
1193#   permitted in any medium without royalty provided the copyright notice
1194#   and this notice are preserved.
1195
1196AC_DEFUN([AX_BOOST_THREAD],
1197[
1198        AC_ARG_WITH([boost-thread],
1199        AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
1200                   [use the Thread library from boost - it is possible to specify a certain library for the linker
1201                        e.g. --with-boost-thread=boost_thread-gcc-mt ]),
1202        [
1203        if test "$withval" = "no"; then
1204                        want_boost="no"
1205        elif test "$withval" = "yes"; then
1206            want_boost="yes"
1207            ax_boost_user_thread_lib=""
1208        else
1209                    want_boost="yes"
1210                ax_boost_user_thread_lib="$withval"
1211                fi
1212        ],
1213        [want_boost="yes"]
1214        )
1215
1216        if test "x$want_boost" = "xyes"; then
1217        AC_REQUIRE([AC_PROG_CC])
1218        AC_REQUIRE([AC_CANONICAL_BUILD])
1219                CPPFLAGS_SAVED="$CPPFLAGS"
1220                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1221                export CPPFLAGS
1222
1223                LDFLAGS_SAVED="$LDFLAGS"
1224                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
1225                export LDFLAGS
1226
1227        AC_CACHE_CHECK(whether the Boost::Thread library is available,
1228                                           ax_cv_boost_thread,
1229        [AC_LANG_PUSH([C++])
1230                         CXXFLAGS_SAVE=$CXXFLAGS
1231
1232                         if test "x$build_os" = "xsolaris" ; then
1233                                 CXXFLAGS="-pthreads $CXXFLAGS"
1234                         elif test "x$build_os" = "xming32" ; then
1235                                 CXXFLAGS="-mthreads $CXXFLAGS"
1236                         else
1237                                CXXFLAGS="-pthread $CXXFLAGS"
1238                         fi
1239                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
1240                                   [[boost::thread_group thrds;
1241                                   return 0;]]),
1242                   ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
1243                         CXXFLAGS=$CXXFLAGS_SAVE
1244             AC_LANG_POP([C++])
1245                ])
1246                if test "x$ax_cv_boost_thread" = "xyes"; then
1247           if test "x$build_os" = "xsolaris" ; then
1248                          BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
1249                   elif test "x$build_os" = "xming32" ; then
1250                          BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
1251                   else
1252                          BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
1253                   fi
1254
1255                        AC_SUBST(BOOST_CPPFLAGS)
1256
1257                        AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
1258            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
1259
1260                        LDFLAGS_SAVE=$LDFLAGS
1261                        case "x$build_os" in
1262                          *bsd* )
1263                               LDFLAGS="-pthread $LDFLAGS"
1264                          break;
1265                          ;;
1266                        esac
1267            if test "x$ax_boost_user_thread_lib" = "x"; then
1268                for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do
1269                     ax_lib=${libextension}
1270                                    AC_CHECK_LIB($ax_lib, exit,
1271                                 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
1272                                 [link_thread="no"])
1273                                done
1274                if test "x$link_thread" != "xyes"; then
1275                for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
1276                     ax_lib=${libextension}
1277                                    AC_CHECK_LIB($ax_lib, exit,
1278                                 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
1279                                 [link_thread="no"])
1280                                done
1281                fi
1282
1283            else
1284               for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
1285                                      AC_CHECK_LIB($ax_lib, exit,
1286                                   [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
1287                                   [link_thread="no"])
1288                  done
1289
1290            fi
1291                        if test "x$link_thread" = "xno"; then
1292                                AC_MSG_ERROR(Could not link against $ax_lib !)
1293                        else
1294                           case "x$build_os" in
1295                              *bsd* )
1296                                BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
1297                              break;
1298                              ;;
1299                           esac
1300
1301                        fi
1302                fi
1303
1304                CPPFLAGS="$CPPFLAGS_SAVED"
1305        LDFLAGS="$LDFLAGS_SAVED"
1306        fi
1307])
1308
1309# ===========================================================================
1310#            http://autoconf-archive.cryp.to/ax_prog_doxygen.html
1311# ===========================================================================
1312#
1313# SYNOPSIS
1314#
1315#   DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR])
1316#   DX_DOXYGEN_FEATURE(ON|OFF)
1317#   DX_DOT_FEATURE(ON|OFF)
1318#   DX_HTML_FEATURE(ON|OFF)
1319#   DX_CHM_FEATURE(ON|OFF)
1320#   DX_CHI_FEATURE(ON|OFF)
1321#   DX_MAN_FEATURE(ON|OFF)
1322#   DX_RTF_FEATURE(ON|OFF)
1323#   DX_XML_FEATURE(ON|OFF)
1324#   DX_PDF_FEATURE(ON|OFF)
1325#   DX_PS_FEATURE(ON|OFF)
1326#
1327# DESCRIPTION
1328#
1329#   The DX_*_FEATURE macros control the default setting for the given
1330#   Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for
1331#   generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML
1332#   help (for MS users), 'CHI' for generating a seperate .chi file by the
1333#   .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate
1334#   output formats. The environment variable DOXYGEN_PAPER_SIZE may be
1335#   specified to override the default 'a4wide' paper size.
1336#
1337#   By default, HTML, PDF and PS documentation is generated as this seems to
1338#   be the most popular and portable combination. MAN pages created by
1339#   Doxygen are usually problematic, though by picking an appropriate subset
1340#   and doing some massaging they might be better than nothing. CHM and RTF
1341#   are specific for MS (note that you can't generate both HTML and CHM at
1342#   the same time). The XML is rather useless unless you apply specialized
1343#   post-processing to it.
1344#
1345#   The macros mainly control the default state of the feature. The use can
1346#   override the default by specifying --enable or --disable. The macros
1347#   ensure that contradictory flags are not given (e.g.,
1348#   --enable-doxygen-html and --enable-doxygen-chm,
1349#   --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each
1350#   feature will be automatically disabled (with a warning) if the required
1351#   programs are missing.
1352#
1353#   Once all the feature defaults have been specified, call DX_INIT_DOXYGEN
1354#   with the following parameters: a one-word name for the project for use
1355#   as a filename base etc., an optional configuration file name (the
1356#   default is 'Doxyfile', the same as Doxygen's default), and an optional
1357#   output directory name (the default is 'doxygen-doc').
1358#
1359#   Automake Support
1360#
1361#   The following is a template aminclude.am file for use with Automake.
1362#   Make targets and variables values are controlled by the various
1363#   DX_COND_* conditionals set by autoconf.
1364#
1365#   The provided targets are:
1366#
1367#     doxygen-doc: Generate all doxygen documentation.
1368#
1369#     doxygen-run: Run doxygen, which will generate some of the
1370#                  documentation (HTML, CHM, CHI, MAN, RTF, XML)
1371#                  but will not do the post processing required
1372#                  for the rest of it (PS, PDF, and some MAN).
1373#
1374#     doxygen-man: Rename some doxygen generated man pages.
1375#
1376#     doxygen-ps:  Generate doxygen PostScript documentation.
1377#
1378#     doxygen-pdf: Generate doxygen PDF documentation.
1379#
1380#   Note that by default these are not integrated into the automake targets.
1381#   If doxygen is used to generate man pages, you can achieve this
1382#   integration by setting man3_MANS to the list of man pages generated and
1383#   then adding the dependency:
1384#
1385#     $(man3_MANS): doxygen-doc
1386#
1387#   This will cause make to run doxygen and generate all the documentation.
1388#
1389#   The following variable is intended for use in Makefile.am:
1390#
1391#     DX_CLEANFILES = everything to clean.
1392#
1393#   Then add this variable to MOSTLYCLEANFILES.
1394#
1395#     ----- begin aminclude.am -------------------------------------
1396#
1397#     ## --------------------------------- ##
1398#     ## Format-independent Doxygen rules. ##
1399#     ## --------------------------------- ##
1400#
1401#     if DX_COND_doc
1402#
1403#     ## ------------------------------- ##
1404#     ## Rules specific for HTML output. ##
1405#     ## ------------------------------- ##
1406#
1407#     if DX_COND_html
1408#
1409#     DX_CLEAN_HTML = @DX_DOCDIR@/html
1410#
1411#     endif DX_COND_html
1412#
1413#     ## ------------------------------ ##
1414#     ## Rules specific for CHM output. ##
1415#     ## ------------------------------ ##
1416#
1417#     if DX_COND_chm
1418#
1419#     DX_CLEAN_CHM = @DX_DOCDIR@/chm
1420#
1421#     if DX_COND_chi
1422#
1423#     DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
1424#
1425#     endif DX_COND_chi
1426#
1427#     endif DX_COND_chm
1428#
1429#     ## ------------------------------ ##
1430#     ## Rules specific for MAN output. ##
1431#     ## ------------------------------ ##
1432#
1433#     if DX_COND_man
1434#
1435#     DX_CLEAN_MAN = @DX_DOCDIR@/man
1436#
1437#     endif DX_COND_man
1438#
1439#     ## ------------------------------ ##
1440#     ## Rules specific for RTF output. ##
1441#     ## ------------------------------ ##
1442#
1443#     if DX_COND_rtf
1444#
1445#     DX_CLEAN_RTF = @DX_DOCDIR@/rtf
1446#
1447#     endif DX_COND_rtf
1448#
1449#     ## ------------------------------ ##
1450#     ## Rules specific for XML output. ##
1451#     ## ------------------------------ ##
1452#
1453#     if DX_COND_xml
1454#
1455#     DX_CLEAN_XML = @DX_DOCDIR@/xml
1456#
1457#     endif DX_COND_xml
1458#
1459#     ## ----------------------------- ##
1460#     ## Rules specific for PS output. ##
1461#     ## ----------------------------- ##
1462#
1463#     if DX_COND_ps
1464#
1465#     DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
1466#
1467#     DX_PS_GOAL = doxygen-ps
1468#
1469#     doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
1470#
1471#     @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
1472#         cd @DX_DOCDIR@/latex; \
1473#         rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
1474#         $(DX_LATEX) refman.tex; \
1475#         $(MAKEINDEX_PATH) refman.idx; \
1476#         $(DX_LATEX) refman.tex; \
1477#         countdown=5; \
1478#         while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
1479#                           refman.log > /dev/null 2>&1 \
1480#            && test $$countdown -gt 0; do \
1481#             $(DX_LATEX) refman.tex; \
1482#             countdown=`expr $$countdown - 1`; \
1483#         done; \
1484#         $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
1485#
1486#     endif DX_COND_ps
1487#
1488#     ## ------------------------------ ##
1489#     ## Rules specific for PDF output. ##
1490#     ## ------------------------------ ##
1491#
1492#     if DX_COND_pdf
1493#
1494#     DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
1495#
1496#     DX_PDF_GOAL = doxygen-pdf
1497#
1498#     doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
1499#
1500#     @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
1501#         cd @DX_DOCDIR@/latex; \
1502#         rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
1503#         $(DX_PDFLATEX) refman.tex; \
1504#         $(DX_MAKEINDEX) refman.idx; \
1505#         $(DX_PDFLATEX) refman.tex; \
1506#         countdown=5; \
1507#         while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
1508#                           refman.log > /dev/null 2>&1 \
1509#            && test $$countdown -gt 0; do \
1510#             $(DX_PDFLATEX) refman.tex; \
1511#             countdown=`expr $$countdown - 1`; \
1512#         done; \
1513#         mv refman.pdf ../@PACKAGE@.pdf
1514#
1515#     endif DX_COND_pdf
1516#
1517#     ## ------------------------------------------------- ##
1518#     ## Rules specific for LaTeX (shared for PS and PDF). ##
1519#     ## ------------------------------------------------- ##
1520#
1521#     if DX_COND_latex
1522#
1523#     DX_CLEAN_LATEX = @DX_DOCDIR@/latex
1524#
1525#     endif DX_COND_latex
1526#
1527#     .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
1528#
1529#     .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
1530#
1531#     doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
1532#
1533#     doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
1534#
1535#     @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
1536#         rm -rf @DX_DOCDIR@
1537#         $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
1538#
1539#     DX_CLEANFILES = \
1540#         @DX_DOCDIR@/@PACKAGE@.tag \
1541#         -r \
1542#         $(DX_CLEAN_HTML) \
1543#         $(DX_CLEAN_CHM) \
1544#         $(DX_CLEAN_CHI) \
1545#         $(DX_CLEAN_MAN) \
1546#         $(DX_CLEAN_RTF) \
1547#         $(DX_CLEAN_XML) \
1548#         $(DX_CLEAN_PS) \
1549#         $(DX_CLEAN_PDF) \
1550#         $(DX_CLEAN_LATEX)
1551#
1552#     endif DX_COND_doc
1553#
1554#     ----- end aminclude.am ---------------------------------------
1555#
1556# LICENSE
1557#
1558#   Copyright (c) 2009 Oren Ben-Kiki <oren@ben-kiki.org>
1559#
1560#   Copying and distribution of this file, with or without modification, are
1561#   permitted in any medium without royalty provided the copyright notice
1562#   and this notice are preserved.
1563
1564
1565DX_ENV=""
1566AC_DEFUN([DX_FEATURE_doc],  ON)
1567AC_DEFUN([DX_FEATURE_dot],  ON)
1568AC_DEFUN([DX_FEATURE_man],  OFF)
1569AC_DEFUN([DX_FEATURE_html], ON)
1570AC_DEFUN([DX_FEATURE_chm],  OFF)
1571AC_DEFUN([DX_FEATURE_chi],  OFF)
1572AC_DEFUN([DX_FEATURE_rtf],  OFF)
1573AC_DEFUN([DX_FEATURE_xml],  OFF)
1574AC_DEFUN([DX_FEATURE_pdf],  ON)
1575AC_DEFUN([DX_FEATURE_ps],   ON)
1576
1577
1578# DX_ENV_APPEND(VARIABLE, VALUE)
1579# ------------------------------
1580# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
1581AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
1582
1583# DX_DIRNAME_EXPR
1584# ---------------
1585# Expand into a shell expression prints the directory part of a path.
1586AC_DEFUN([DX_DIRNAME_EXPR],
1587         [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
1588
1589# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
1590# -------------------------------------
1591# Expands according to the M4 (static) status of the feature.
1592AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
1593
1594# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
1595# ----------------------------------
1596# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
1597AC_DEFUN([DX_REQUIRE_PROG], [
1598AC_PATH_TOOL([$1], [$2])
1599if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
1600    AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
1601    AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
1602fi
1603])
1604
1605# DX_TEST_FEATURE(FEATURE)
1606# ------------------------
1607# Expand to a shell expression testing whether the feature is active.
1608AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
1609
1610# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
1611# -------------------------------------------------
1612# Verify that a required features has the right state before trying to turn on
1613# the DX_CURRENT_FEATURE.
1614AC_DEFUN([DX_CHECK_DEPEND], [
1615test "$DX_FLAG_$1" = "$2" \
1616|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
1617                            requires, contradicts) doxygen-DX_CURRENT_FEATURE])
1618])
1619
1620# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
1621# ----------------------------------------------------------
1622# Turn off the DX_CURRENT_FEATURE if the required feature is off.
1623AC_DEFUN([DX_CLEAR_DEPEND], [
1624test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
1625])
1626
1627# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
1628#                CHECK_DEPEND, CLEAR_DEPEND,
1629#                REQUIRE, DO-IF-ON, DO-IF-OFF)
1630# --------------------------------------------
1631# Parse the command-line option controlling a feature. CHECK_DEPEND is called
1632# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
1633# otherwise CLEAR_DEPEND is called to turn off the default state if a required
1634# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
1635# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
1636# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
1637AC_DEFUN([DX_ARG_ABLE], [
1638    AC_DEFUN([DX_CURRENT_FEATURE], [$1])
1639    AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
1640    AC_ARG_ENABLE(doxygen-$1,
1641                  [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
1642                                                      [--enable-doxygen-$1]),
1643                                  DX_IF_FEATURE([$1], [don't $2], [$2]))],
1644                  [
1645case "$enableval" in
1646#(
1647y|Y|yes|Yes|YES)
1648    AC_SUBST([DX_FLAG_$1], 1)
1649    $3
1650;; #(
1651n|N|no|No|NO)
1652    AC_SUBST([DX_FLAG_$1], 0)
1653;; #(
1654*)
1655    AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
1656;;
1657esac
1658], [
1659AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
1660$4
1661])
1662if DX_TEST_FEATURE([$1]); then
1663    $5
1664    :
1665fi
1666if DX_TEST_FEATURE([$1]); then
1667    AM_CONDITIONAL(DX_COND_$1, :)
1668    $6
1669    :
1670else
1671    AM_CONDITIONAL(DX_COND_$1, false)
1672    $7
1673    :
1674fi
1675])
1676
1677
1678# DX_XXX_FEATURE(DEFAULT_STATE)
1679# -----------------------------
1680AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc],  [$1])])
1681AC_DEFUN([DX_MAN_FEATURE],     [AC_DEFUN([DX_FEATURE_man],  [$1])])
1682AC_DEFUN([DX_HTML_FEATURE],    [AC_DEFUN([DX_FEATURE_html], [$1])])
1683AC_DEFUN([DX_CHM_FEATURE],     [AC_DEFUN([DX_FEATURE_chm],  [$1])])
1684AC_DEFUN([DX_CHI_FEATURE],     [AC_DEFUN([DX_FEATURE_chi],  [$1])])
1685AC_DEFUN([DX_RTF_FEATURE],     [AC_DEFUN([DX_FEATURE_rtf],  [$1])])
1686AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
1687AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
1688AC_DEFUN([DX_PDF_FEATURE],     [AC_DEFUN([DX_FEATURE_pdf],  [$1])])
1689AC_DEFUN([DX_PS_FEATURE],      [AC_DEFUN([DX_FEATURE_ps],   [$1])])
1690
1691# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
1692# ---------------------------------------------------------
1693# PROJECT also serves as the base name for the documentation files.
1694# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
1695AC_DEFUN([DX_INIT_DOXYGEN], [
1696
1697# Files:
1698AC_SUBST([DX_PROJECT], [$1])
1699AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
1700AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
1701
1702# Environment variables used inside doxygen.cfg:
1703DX_ENV_APPEND(SRCDIR, $srcdir)
1704DX_ENV_APPEND(PROJECT, $DX_PROJECT)
1705DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
1706DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
1707
1708# Doxygen itself:
1709DX_ARG_ABLE(doc, [generate any doxygen documentation],
1710            [],
1711            [],
1712            [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
1713             DX_REQUIRE_PROG([DX_PERL], perl)],
1714            [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
1715
1716# Dot for graphics:
1717DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
1718            [DX_CHECK_DEPEND(doc, 1)],
1719            [DX_CLEAR_DEPEND(doc, 1)],
1720            [DX_REQUIRE_PROG([DX_DOT], dot)],
1721            [DX_ENV_APPEND(HAVE_DOT, YES)
1722             DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
1723            [DX_ENV_APPEND(HAVE_DOT, NO)])
1724
1725# Man pages generation:
1726DX_ARG_ABLE(man, [generate doxygen manual pages],
1727            [DX_CHECK_DEPEND(doc, 1)],
1728            [DX_CLEAR_DEPEND(doc, 1)],
1729            [],
1730            [DX_ENV_APPEND(GENERATE_MAN, YES)],
1731            [DX_ENV_APPEND(GENERATE_MAN, NO)])
1732
1733# RTF file generation:
1734DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
1735            [DX_CHECK_DEPEND(doc, 1)],
1736            [DX_CLEAR_DEPEND(doc, 1)],
1737            [],
1738            [DX_ENV_APPEND(GENERATE_RTF, YES)],
1739            [DX_ENV_APPEND(GENERATE_RTF, NO)])
1740
1741# XML file generation:
1742DX_ARG_ABLE(xml, [generate doxygen XML documentation],
1743            [DX_CHECK_DEPEND(doc, 1)],
1744            [DX_CLEAR_DEPEND(doc, 1)],
1745            [],
1746            [DX_ENV_APPEND(GENERATE_XML, YES)],
1747            [DX_ENV_APPEND(GENERATE_XML, NO)])
1748
1749# (Compressed) HTML help generation:
1750DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
1751            [DX_CHECK_DEPEND(doc, 1)],
1752            [DX_CLEAR_DEPEND(doc, 1)],
1753            [DX_REQUIRE_PROG([DX_HHC], hhc)],
1754            [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
1755             DX_ENV_APPEND(GENERATE_HTML, YES)
1756             DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
1757            [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
1758
1759# Seperate CHI file generation.
1760DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
1761            [DX_CHECK_DEPEND(chm, 1)],
1762            [DX_CLEAR_DEPEND(chm, 1)],
1763            [],
1764            [DX_ENV_APPEND(GENERATE_CHI, YES)],
1765            [DX_ENV_APPEND(GENERATE_CHI, NO)])
1766
1767# Plain HTML pages generation:
1768DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
1769            [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
1770            [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
1771            [],
1772            [DX_ENV_APPEND(GENERATE_HTML, YES)],
1773            [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
1774
1775# PostScript file generation:
1776DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
1777            [DX_CHECK_DEPEND(doc, 1)],
1778            [DX_CLEAR_DEPEND(doc, 1)],
1779            [DX_REQUIRE_PROG([DX_LATEX], latex)
1780             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
1781             DX_REQUIRE_PROG([DX_DVIPS], dvips)
1782             DX_REQUIRE_PROG([DX_EGREP], egrep)])
1783
1784# PDF file generation:
1785DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
1786            [DX_CHECK_DEPEND(doc, 1)],
1787            [DX_CLEAR_DEPEND(doc, 1)],
1788            [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
1789             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
1790             DX_REQUIRE_PROG([DX_EGREP], egrep)])
1791
1792# LaTeX generation for PS and/or PDF:
1793if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
1794    AM_CONDITIONAL(DX_COND_latex, :)
1795    DX_ENV_APPEND(GENERATE_LATEX, YES)
1796else
1797    AM_CONDITIONAL(DX_COND_latex, false)
1798    DX_ENV_APPEND(GENERATE_LATEX, NO)
1799fi
1800
1801# Paper size for PS and/or PDF:
1802AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
1803           [a4wide (default), a4, letter, legal or executive])
1804case "$DOXYGEN_PAPER_SIZE" in
1805#(
1806"")
1807    AC_SUBST(DOXYGEN_PAPER_SIZE, "")
1808;; #(
1809a4wide|a4|letter|legal|executive)
1810    DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
1811;; #(
1812*)
1813    AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
1814;;
1815esac
1816
1817#For debugging:
1818#echo DX_FLAG_doc=$DX_FLAG_doc
1819#echo DX_FLAG_dot=$DX_FLAG_dot
1820#echo DX_FLAG_man=$DX_FLAG_man
1821#echo DX_FLAG_html=$DX_FLAG_html
1822#echo DX_FLAG_chm=$DX_FLAG_chm
1823#echo DX_FLAG_chi=$DX_FLAG_chi
1824#echo DX_FLAG_rtf=$DX_FLAG_rtf
1825#echo DX_FLAG_xml=$DX_FLAG_xml
1826#echo DX_FLAG_pdf=$DX_FLAG_pdf
1827#echo DX_FLAG_ps=$DX_FLAG_ps
1828#echo DX_ENV=$DX_ENV
1829])
1830
1831# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1832#
1833# This file is free software; the Free Software Foundation
1834# gives unlimited permission to copy and/or distribute it,
1835# with or without modifications, as long as this notice is preserved.
1836
1837# AM_AUTOMAKE_VERSION(VERSION)
1838# ----------------------------
1839# Automake X.Y traces this macro to ensure aclocal.m4 has been
1840# generated from the m4 files accompanying Automake X.Y.
1841# (This private macro should not be called outside this file.)
1842AC_DEFUN([AM_AUTOMAKE_VERSION],
1843[am__api_version='1.11'
1844dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1845dnl require some minimum version.  Point them to the right macro.
1846m4_if([$1], [1.11.1], [],
1847      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1848])
1849
1850# _AM_AUTOCONF_VERSION(VERSION)
1851# -----------------------------
1852# aclocal traces this macro to find the Autoconf version.
1853# This is a private macro too.  Using m4_define simplifies
1854# the logic in aclocal, which can simply ignore this definition.
1855m4_define([_AM_AUTOCONF_VERSION], [])
1856
1857# AM_SET_CURRENT_AUTOMAKE_VERSION
1858# -------------------------------
1859# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1860# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1861AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1862[AM_AUTOMAKE_VERSION([1.11.1])dnl
1863m4_ifndef([AC_AUTOCONF_VERSION],
1864  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1865_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1866
1867# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1868
1869# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1870#
1871# This file is free software; the Free Software Foundation
1872# gives unlimited permission to copy and/or distribute it,
1873# with or without modifications, as long as this notice is preserved.
1874
1875# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1876# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1877# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1878#
1879# Of course, Automake must honor this variable whenever it calls a
1880# tool from the auxiliary directory.  The problem is that $srcdir (and
1881# therefore $ac_aux_dir as well) can be either absolute or relative,
1882# depending on how configure is run.  This is pretty annoying, since
1883# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1884# source directory, any form will work fine, but in subdirectories a
1885# relative path needs to be adjusted first.
1886#
1887# $ac_aux_dir/missing
1888#    fails when called from a subdirectory if $ac_aux_dir is relative
1889# $top_srcdir/$ac_aux_dir/missing
1890#    fails if $ac_aux_dir is absolute,
1891#    fails when called from a subdirectory in a VPATH build with
1892#          a relative $ac_aux_dir
1893#
1894# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1895# are both prefixed by $srcdir.  In an in-source build this is usually
1896# harmless because $srcdir is `.', but things will broke when you
1897# start a VPATH build or use an absolute $srcdir.
1898#
1899# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1900# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1901#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1902# and then we would define $MISSING as
1903#   MISSING="\${SHELL} $am_aux_dir/missing"
1904# This will work as long as MISSING is not called from configure, because
1905# unfortunately $(top_srcdir) has no meaning in configure.
1906# However there are other variables, like CC, which are often used in
1907# configure, and could therefore not use this "fixed" $ac_aux_dir.
1908#
1909# Another solution, used here, is to always expand $ac_aux_dir to an
1910# absolute PATH.  The drawback is that using absolute paths prevent a
1911# configured tree to be moved without reconfiguration.
1912
1913AC_DEFUN([AM_AUX_DIR_EXPAND],
1914[dnl Rely on autoconf to set up CDPATH properly.
1915AC_PREREQ([2.50])dnl
1916# expand $ac_aux_dir to an absolute path
1917am_aux_dir=`cd $ac_aux_dir && pwd`
1918])
1919
1920# AM_COND_IF                                            -*- Autoconf -*-
1921
1922# Copyright (C) 2008 Free Software Foundation, Inc.
1923#
1924# This file is free software; the Free Software Foundation
1925# gives unlimited permission to copy and/or distribute it,
1926# with or without modifications, as long as this notice is preserved.
1927
1928# serial 1
1929
1930# _AM_COND_IF
1931# _AM_COND_ELSE
1932# _AM_COND_ENDIF
1933# --------------
1934# These macros are only used for tracing.
1935m4_define([_AM_COND_IF])
1936m4_define([_AM_COND_ELSE])
1937m4_define([_AM_COND_ENDIF])
1938
1939
1940# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
1941# ---------------------------------------
1942# If the shell condition matching COND is true, execute IF-TRUE,
1943# otherwise execute IF-FALSE.  Allow automake to learn about conditional
1944# instantiating macros (the AC_CONFIG_FOOS).
1945AC_DEFUN([AM_COND_IF],
1946[m4_ifndef([_AM_COND_VALUE_$1],
1947           [m4_fatal([$0: no such condition "$1"])])dnl
1948_AM_COND_IF([$1])dnl
1949if _AM_COND_VALUE_$1; then
1950  m4_default([$2], [:])
1951m4_ifval([$3],
1952[_AM_COND_ELSE([$1])dnl
1953else
1954  $3
1955])dnl
1956_AM_COND_ENDIF([$1])dnl
1957fi[]dnl
1958])
1959
1960# AM_CONDITIONAL                                            -*- Autoconf -*-
1961
1962# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1963# Free Software Foundation, Inc.
1964#
1965# This file is free software; the Free Software Foundation
1966# gives unlimited permission to copy and/or distribute it,
1967# with or without modifications, as long as this notice is preserved.
1968
1969# serial 9
1970
1971# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1972# -------------------------------------
1973# Define a conditional.
1974AC_DEFUN([AM_CONDITIONAL],
1975[AC_PREREQ(2.52)dnl
1976 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1977        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1978AC_SUBST([$1_TRUE])dnl
1979AC_SUBST([$1_FALSE])dnl
1980_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1981_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1982m4_define([_AM_COND_VALUE_$1], [$2])dnl
1983if $2; then
1984  $1_TRUE=
1985  $1_FALSE='#'
1986else
1987  $1_TRUE='#'
1988  $1_FALSE=
1989fi
1990AC_CONFIG_COMMANDS_PRE(
1991[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1992  AC_MSG_ERROR([[conditional "$1" was never defined.
1993Usually this means the macro was only invoked conditionally.]])
1994fi])])
1995
1996# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1997# Free Software Foundation, Inc.
1998#
1999# This file is free software; the Free Software Foundation
2000# gives unlimited permission to copy and/or distribute it,
2001# with or without modifications, as long as this notice is preserved.
2002
2003# serial 10
2004
2005# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2006# written in clear, in which case automake, when reading aclocal.m4,
2007# will think it sees a *use*, and therefore will trigger all it's
2008# C support machinery.  Also note that it means that autoscan, seeing
2009# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2010
2011
2012# _AM_DEPENDENCIES(NAME)
2013# ----------------------
2014# See how the compiler implements dependency checking.
2015# NAME is "CC", "CXX", "GCJ", or "OBJC".
2016# We try a few techniques and use that to set a single cache variable.
2017#
2018# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2019# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2020# dependency, and given that the user is not expected to run this macro,
2021# just rely on AC_PROG_CC.
2022AC_DEFUN([_AM_DEPENDENCIES],
2023[AC_REQUIRE([AM_SET_DEPDIR])dnl
2024AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2025AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2026AC_REQUIRE([AM_DEP_TRACK])dnl
2027
2028ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
2029       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
2030       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2031       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
2032       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
2033                   [depcc="$$1"   am_compiler_list=])
2034
2035AC_CACHE_CHECK([dependency style of $depcc],
2036               [am_cv_$1_dependencies_compiler_type],
2037[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2038  # We make a subdir and do the tests there.  Otherwise we can end up
2039  # making bogus files that we don't know about and never remove.  For
2040  # instance it was reported that on HP-UX the gcc test will end up
2041  # making a dummy file named `D' -- because `-MD' means `put the output
2042  # in D'.
2043  mkdir conftest.dir
2044  # Copy depcomp to subdir because otherwise we won't find it if we're
2045  # using a relative directory.
2046  cp "$am_depcomp" conftest.dir
2047  cd conftest.dir
2048  # We will build objects and dependencies in a subdirectory because
2049  # it helps to detect inapplicable dependency modes.  For instance
2050  # both Tru64's cc and ICC support -MD to output dependencies as a
2051  # side effect of compilation, but ICC will put the dependencies in
2052  # the current directory while Tru64 will put them in the object
2053  # directory.
2054  mkdir sub
2055
2056  am_cv_$1_dependencies_compiler_type=none
2057  if test "$am_compiler_list" = ""; then
2058     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2059  fi
2060  am__universal=false
2061  m4_case([$1], [CC],
2062    [case " $depcc " in #(
2063     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2064     esac],
2065    [CXX],
2066    [case " $depcc " in #(
2067     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2068     esac])
2069
2070  for depmode in $am_compiler_list; do
2071    # Setup a source with many dependencies, because some compilers
2072    # like to wrap large dependency lists on column 80 (with \), and
2073    # we should not choose a depcomp mode which is confused by this.
2074    #
2075    # We need to recreate these files for each test, as the compiler may
2076    # overwrite some of them when testing with obscure command lines.
2077    # This happens at least with the AIX C compiler.
2078    : > sub/conftest.c
2079    for i in 1 2 3 4 5 6; do
2080      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2081      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2082      # Solaris 8's {/usr,}/bin/sh.
2083      touch sub/conftst$i.h
2084    done
2085    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2086
2087    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2088    # mode.  It turns out that the SunPro C++ compiler does not properly
2089    # handle `-M -o', and we need to detect this.  Also, some Intel
2090    # versions had trouble with output in subdirs
2091    am__obj=sub/conftest.${OBJEXT-o}
2092    am__minus_obj="-o $am__obj"
2093    case $depmode in
2094    gcc)
2095      # This depmode causes a compiler race in universal mode.
2096      test "$am__universal" = false || continue
2097      ;;
2098    nosideeffect)
2099      # after this tag, mechanisms are not by side-effect, so they'll
2100      # only be used when explicitly requested
2101      if test "x$enable_dependency_tracking" = xyes; then
2102        continue
2103      else
2104        break
2105      fi
2106      ;;
2107    msvisualcpp | msvcmsys)
2108      # This compiler won't grok `-c -o', but also, the minuso test has
2109      # not run yet.  These depmodes are late enough in the game, and
2110      # so weak that their functioning should not be impacted.
2111      am__obj=conftest.${OBJEXT-o}
2112      am__minus_obj=
2113      ;;
2114    none) break ;;
2115    esac
2116    if depmode=$depmode \
2117       source=sub/conftest.c object=$am__obj \
2118       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2119       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2120         >/dev/null 2>conftest.err &&
2121       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2122       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2123       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2124       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2125      # icc doesn't choke on unknown options, it will just issue warnings
2126      # or remarks (even with -Werror).  So we grep stderr for any message
2127      # that says an option was ignored or not supported.
2128      # When given -MP, icc 7.0 and 7.1 complain thusly:
2129      #   icc: Command line warning: ignoring option '-M'; no argument required
2130      # The diagnosis changed in icc 8.0:
2131      #   icc: Command line remark: option '-MP' not supported
2132      if (grep 'ignoring option' conftest.err ||
2133          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2134        am_cv_$1_dependencies_compiler_type=$depmode
2135        break
2136      fi
2137    fi
2138  done
2139
2140  cd ..
2141  rm -rf conftest.dir
2142else
2143  am_cv_$1_dependencies_compiler_type=none
2144fi
2145])
2146AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2147AM_CONDITIONAL([am__fastdep$1], [
2148  test "x$enable_dependency_tracking" != xno \
2149  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2150])
2151
2152
2153# AM_SET_DEPDIR
2154# -------------
2155# Choose a directory name for dependency files.
2156# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2157AC_DEFUN([AM_SET_DEPDIR],
2158[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2159AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2160])
2161
2162
2163# AM_DEP_TRACK
2164# ------------
2165AC_DEFUN([AM_DEP_TRACK],
2166[AC_ARG_ENABLE(dependency-tracking,
2167[  --disable-dependency-tracking  speeds up one-time build
2168  --enable-dependency-tracking   do not reject slow dependency extractors])
2169if test "x$enable_dependency_tracking" != xno; then
2170  am_depcomp="$ac_aux_dir/depcomp"
2171  AMDEPBACKSLASH='\'
2172fi
2173AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2174AC_SUBST([AMDEPBACKSLASH])dnl
2175_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2176])
2177
2178# Generate code to set up dependency tracking.              -*- Autoconf -*-
2179
2180# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2181# Free Software Foundation, Inc.
2182#
2183# This file is free software; the Free Software Foundation
2184# gives unlimited permission to copy and/or distribute it,
2185# with or without modifications, as long as this notice is preserved.
2186
2187#serial 5
2188
2189# _AM_OUTPUT_DEPENDENCY_COMMANDS
2190# ------------------------------
2191AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2192[{
2193  # Autoconf 2.62 quotes --file arguments for eval, but not when files
2194  # are listed without --file.  Let's play safe and only enable the eval
2195  # if we detect the quoting.
2196  case $CONFIG_FILES in
2197  *\'*) eval set x "$CONFIG_FILES" ;;
2198  *)   set x $CONFIG_FILES ;;
2199  esac
2200  shift
2201  for mf
2202  do
2203    # Strip MF so we end up with the name of the file.
2204    mf=`echo "$mf" | sed -e 's/:.*$//'`
2205    # Check whether this is an Automake generated Makefile or not.
2206    # We used to match only the files named `Makefile.in', but
2207    # some people rename them; so instead we look at the file content.
2208    # Grep'ing the first line is not enough: some people post-process
2209    # each Makefile.in and add a new line on top of each file to say so.
2210    # Grep'ing the whole file is not good either: AIX grep has a line
2211    # limit of 2048, but all sed's we know have understand at least 4000.
2212    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2213      dirpart=`AS_DIRNAME("$mf")`
2214    else
2215      continue
2216    fi
2217    # Extract the definition of DEPDIR, am__include, and am__quote
2218    # from the Makefile without running `make'.
2219    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2220    test -z "$DEPDIR" && continue
2221    am__include=`sed -n 's/^am__include = //p' < "$mf"`
2222    test -z "am__include" && continue
2223    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2224    # When using ansi2knr, U may be empty or an underscore; expand it
2225    U=`sed -n 's/^U = //p' < "$mf"`
2226    # Find all dependency output files, they are included files with
2227    # $(DEPDIR) in their names.  We invoke sed twice because it is the
2228    # simplest approach to changing $(DEPDIR) to its actual value in the
2229    # expansion.
2230    for file in `sed -n "
2231      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2232         sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2233      # Make sure the directory exists.
2234      test -f "$dirpart/$file" && continue
2235      fdir=`AS_DIRNAME(["$file"])`
2236      AS_MKDIR_P([$dirpart/$fdir])
2237      # echo "creating $dirpart/$file"
2238      echo '# dummy' > "$dirpart/$file"
2239    done
2240  done
2241}
2242])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2243
2244
2245# AM_OUTPUT_DEPENDENCY_COMMANDS
2246# -----------------------------
2247# This macro should only be invoked once -- use via AC_REQUIRE.
2248#
2249# This code is only required when automatic dependency tracking
2250# is enabled.  FIXME.  This creates each `.P' file that we will
2251# need in order to bootstrap the dependency handling code.
2252AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2253[AC_CONFIG_COMMANDS([depfiles],
2254     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2255     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2256])
2257
2258# Do all the work for Automake.                             -*- Autoconf -*-
2259
2260# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2261# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
2262#
2263# This file is free software; the Free Software Foundation
2264# gives unlimited permission to copy and/or distribute it,
2265# with or without modifications, as long as this notice is preserved.
2266
2267# serial 16
2268
2269# This macro actually does too much.  Some checks are only needed if
2270# your package does certain things.  But this isn't really a big deal.
2271
2272# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2273# AM_INIT_AUTOMAKE([OPTIONS])
2274# -----------------------------------------------
2275# The call with PACKAGE and VERSION arguments is the old style
2276# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2277# and VERSION should now be passed to AC_INIT and removed from
2278# the call to AM_INIT_AUTOMAKE.
2279# We support both call styles for the transition.  After
2280# the next Automake release, Autoconf can make the AC_INIT
2281# arguments mandatory, and then we can depend on a new Autoconf
2282# release and drop the old call support.
2283AC_DEFUN([AM_INIT_AUTOMAKE],
2284[AC_PREREQ([2.62])dnl
2285dnl Autoconf wants to disallow AM_ names.  We explicitly allow
2286dnl the ones we care about.
2287m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2288AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2289AC_REQUIRE([AC_PROG_INSTALL])dnl
2290if test "`cd $srcdir && pwd`" != "`pwd`"; then
2291  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2292  # is not polluted with repeated "-I."
2293  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2294  # test to see if srcdir already configured
2295  if test -f $srcdir/config.status; then
2296    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2297  fi
2298fi
2299
2300# test whether we have cygpath
2301if test -z "$CYGPATH_W"; then
2302  if (cygpath --version) >/dev/null 2>/dev/null; then
2303    CYGPATH_W='cygpath -w'
2304  else
2305    CYGPATH_W=echo
2306  fi
2307fi
2308AC_SUBST([CYGPATH_W])
2309
2310# Define the identity of the package.
2311dnl Distinguish between old-style and new-style calls.
2312m4_ifval([$2],
2313[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2314 AC_SUBST([PACKAGE], [$1])dnl
2315 AC_SUBST([VERSION], [$2])],
2316[_AM_SET_OPTIONS([$1])dnl
2317dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2318m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2319  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2320 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2321 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2322
2323_AM_IF_OPTION([no-define],,
2324[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2325 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2326
2327# Some tools Automake needs.
2328AC_REQUIRE([AM_SANITY_CHECK])dnl
2329AC_REQUIRE([AC_ARG_PROGRAM])dnl
2330AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2331AM_MISSING_PROG(AUTOCONF, autoconf)
2332AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2333AM_MISSING_PROG(AUTOHEADER, autoheader)
2334AM_MISSING_PROG(MAKEINFO, makeinfo)
2335AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2336AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2337AC_REQUIRE([AM_PROG_MKDIR_P])dnl
2338# We need awk for the "check" target.  The system "awk" is bad on
2339# some platforms.
2340AC_REQUIRE([AC_PROG_AWK])dnl
2341AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2342AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2343_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2344              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2345                             [_AM_PROG_TAR([v7])])])
2346_AM_IF_OPTION([no-dependencies],,
2347[AC_PROVIDE_IFELSE([AC_PROG_CC],
2348                  [_AM_DEPENDENCIES(CC)],
2349                  [define([AC_PROG_CC],
2350                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2351AC_PROVIDE_IFELSE([AC_PROG_CXX],
2352                  [_AM_DEPENDENCIES(CXX)],
2353                  [define([AC_PROG_CXX],
2354                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2355AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2356                  [_AM_DEPENDENCIES(OBJC)],
2357                  [define([AC_PROG_OBJC],
2358                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
2359])
2360_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
2361dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
2362dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
2363dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
2364AC_CONFIG_COMMANDS_PRE(dnl
2365[m4_provide_if([_AM_COMPILER_EXEEXT],
2366  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2367])
2368
2369dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2370dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2371dnl mangled by Autoconf and run in a shell conditional statement.
2372m4_define([_AC_COMPILER_EXEEXT],
2373m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2374
2375
2376# When config.status generates a header, we must update the stamp-h file.
2377# This file resides in the same directory as the config header
2378# that is generated.  The stamp files are numbered to have different names.
2379
2380# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2381# loop where config.status creates the headers, so we can generate
2382# our stamp files there.
2383AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2384[# Compute $1's index in $config_headers.
2385_am_arg=$1
2386_am_stamp_count=1
2387for _am_header in $config_headers :; do
2388  case $_am_header in
2389    $_am_arg | $_am_arg:* )
2390      break ;;
2391    * )
2392      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2393  esac
2394done
2395echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2396
2397# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2398#
2399# This file is free software; the Free Software Foundation
2400# gives unlimited permission to copy and/or distribute it,
2401# with or without modifications, as long as this notice is preserved.
2402
2403# AM_PROG_INSTALL_SH
2404# ------------------
2405# Define $install_sh.
2406AC_DEFUN([AM_PROG_INSTALL_SH],
2407[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2408if test x"${install_sh}" != xset; then
2409  case $am_aux_dir in
2410  *\ * | *\     *)
2411    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2412  *)
2413    install_sh="\${SHELL} $am_aux_dir/install-sh"
2414  esac
2415fi
2416AC_SUBST(install_sh)])
2417
2418# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
2419#
2420# This file is free software; the Free Software Foundation
2421# gives unlimited permission to copy and/or distribute it,
2422# with or without modifications, as long as this notice is preserved.
2423
2424# serial 2
2425
2426# Check whether the underlying file-system supports filenames
2427# with a leading dot.  For instance MS-DOS doesn't.
2428AC_DEFUN([AM_SET_LEADING_DOT],
2429[rm -rf .tst 2>/dev/null
2430mkdir .tst 2>/dev/null
2431if test -d .tst; then
2432  am__leading_dot=.
2433else
2434  am__leading_dot=_
2435fi
2436rmdir .tst 2>/dev/null
2437AC_SUBST([am__leading_dot])])
2438
2439# Check to see how 'make' treats includes.                  -*- Autoconf -*-
2440
2441# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2442#
2443# This file is free software; the Free Software Foundation
2444# gives unlimited permission to copy and/or distribute it,
2445# with or without modifications, as long as this notice is preserved.
2446
2447# serial 4
2448
2449# AM_MAKE_INCLUDE()
2450# -----------------
2451# Check to see how make treats includes.
2452AC_DEFUN([AM_MAKE_INCLUDE],
2453[am_make=${MAKE-make}
2454cat > confinc << 'END'
2455am__doit:
2456        @echo this is the am__doit target
2457.PHONY: am__doit
2458END
2459# If we don't find an include directive, just comment out the code.
2460AC_MSG_CHECKING([for style of include used by $am_make])
2461am__include="#"
2462am__quote=
2463_am_result=none
2464# First try GNU make style include.
2465echo "include confinc" > confmf
2466# Ignore all kinds of additional output from `make'.
2467case `$am_make -s -f confmf 2> /dev/null` in #(
2468*the\ am__doit\ target*)
2469  am__include=include
2470  am__quote=
2471  _am_result=GNU
2472  ;;
2473esac
2474# Now try BSD make style include.
2475if test "$am__include" = "#"; then
2476   echo '.include "confinc"' > confmf
2477   case `$am_make -s -f confmf 2> /dev/null` in #(
2478   *the\ am__doit\ target*)
2479     am__include=.include
2480     am__quote="\""
2481     _am_result=BSD
2482     ;;
2483   esac
2484fi
2485AC_SUBST([am__include])
2486AC_SUBST([am__quote])
2487AC_MSG_RESULT([$_am_result])
2488rm -f confinc confmf
2489])
2490
2491# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
2492# Free Software Foundation, Inc.
2493#
2494# This file is free software; the Free Software Foundation
2495# gives unlimited permission to copy and/or distribute it,
2496# with or without modifications, as long as this notice is preserved.
2497
2498# serial 6
2499
2500# AM_PROG_CC_C_O
2501# --------------
2502# Like AC_PROG_CC_C_O, but changed for automake.
2503AC_DEFUN([AM_PROG_CC_C_O],
2504[AC_REQUIRE([AC_PROG_CC_C_O])dnl
2505AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2506AC_REQUIRE_AUX_FILE([compile])dnl
2507# FIXME: we rely on the cache variable name because
2508# there is no other way.
2509set dummy $CC
2510am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
2511eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
2512if test "$am_t" != yes; then
2513   # Losing compiler, so override with the script.
2514   # FIXME: It is wrong to rewrite CC.
2515   # But if we don't then we get into trouble of one sort or another.
2516   # A longer-term fix would be to have automake use am__CC in this case,
2517   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2518   CC="$am_aux_dir/compile $CC"
2519fi
2520dnl Make sure AC_PROG_CC is never called again, or it will override our
2521dnl setting of CC.
2522m4_define([AC_PROG_CC],
2523          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
2524])
2525
2526# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2527
2528# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2529# Free Software Foundation, Inc.
2530#
2531# This file is free software; the Free Software Foundation
2532# gives unlimited permission to copy and/or distribute it,
2533# with or without modifications, as long as this notice is preserved.
2534
2535# serial 6
2536
2537# AM_MISSING_PROG(NAME, PROGRAM)
2538# ------------------------------
2539AC_DEFUN([AM_MISSING_PROG],
2540[AC_REQUIRE([AM_MISSING_HAS_RUN])
2541$1=${$1-"${am_missing_run}$2"}
2542AC_SUBST($1)])
2543
2544
2545# AM_MISSING_HAS_RUN
2546# ------------------
2547# Define MISSING if not defined so far and test if it supports --run.
2548# If it does, set am_missing_run to use it, otherwise, to nothing.
2549AC_DEFUN([AM_MISSING_HAS_RUN],
2550[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2551AC_REQUIRE_AUX_FILE([missing])dnl
2552if test x"${MISSING+set}" != xset; then
2553  case $am_aux_dir in
2554  *\ * | *\     *)
2555    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2556  *)
2557    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2558  esac
2559fi
2560# Use eval to expand $SHELL
2561if eval "$MISSING --run true"; then
2562  am_missing_run="$MISSING --run "
2563else
2564  am_missing_run=
2565  AC_MSG_WARN([`missing' script is too old or missing])
2566fi
2567])
2568
2569# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2570#
2571# This file is free software; the Free Software Foundation
2572# gives unlimited permission to copy and/or distribute it,
2573# with or without modifications, as long as this notice is preserved.
2574
2575# AM_PROG_MKDIR_P
2576# ---------------
2577# Check for `mkdir -p'.
2578AC_DEFUN([AM_PROG_MKDIR_P],
2579[AC_PREREQ([2.60])dnl
2580AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2581dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2582dnl while keeping a definition of mkdir_p for backward compatibility.
2583dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2584dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2585dnl Makefile.ins that do not define MKDIR_P, so we do our own
2586dnl adjustment using top_builddir (which is defined more often than
2587dnl MKDIR_P).
2588AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2589case $mkdir_p in
2590  [[\\/$]]* | ?:[[\\/]]*) ;;
2591  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2592esac
2593])
2594
2595# Helper functions for option handling.                     -*- Autoconf -*-
2596
2597# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2598#
2599# This file is free software; the Free Software Foundation
2600# gives unlimited permission to copy and/or distribute it,
2601# with or without modifications, as long as this notice is preserved.
2602
2603# serial 4
2604
2605# _AM_MANGLE_OPTION(NAME)
2606# -----------------------
2607AC_DEFUN([_AM_MANGLE_OPTION],
2608[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2609
2610# _AM_SET_OPTION(NAME)
2611# ------------------------------
2612# Set option NAME.  Presently that only means defining a flag for this option.
2613AC_DEFUN([_AM_SET_OPTION],
2614[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2615
2616# _AM_SET_OPTIONS(OPTIONS)
2617# ----------------------------------
2618# OPTIONS is a space-separated list of Automake options.
2619AC_DEFUN([_AM_SET_OPTIONS],
2620[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2621
2622# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2623# -------------------------------------------
2624# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2625AC_DEFUN([_AM_IF_OPTION],
2626[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2627
2628# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2629
2630# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2631# Free Software Foundation, Inc.
2632#
2633# This file is free software; the Free Software Foundation
2634# gives unlimited permission to copy and/or distribute it,
2635# with or without modifications, as long as this notice is preserved.
2636
2637# serial 5
2638
2639# AM_SANITY_CHECK
2640# ---------------
2641AC_DEFUN([AM_SANITY_CHECK],
2642[AC_MSG_CHECKING([whether build environment is sane])
2643# Just in case
2644sleep 1
2645echo timestamp > conftest.file
2646# Reject unsafe characters in $srcdir or the absolute working directory
2647# name.  Accept space and tab only in the latter.
2648am_lf='
2649'
2650case `pwd` in
2651  *[[\\\"\#\$\&\'\`$am_lf]]*)
2652    AC_MSG_ERROR([unsafe absolute working directory name]);;
2653esac
2654case $srcdir in
2655  *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2656    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2657esac
2658
2659# Do `set' in a subshell so we don't clobber the current shell's
2660# arguments.  Must try -L first in case configure is actually a
2661# symlink; some systems play weird games with the mod time of symlinks
2662# (eg FreeBSD returns the mod time of the symlink's containing
2663# directory).
2664if (
2665   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2666   if test "$[*]" = "X"; then
2667      # -L didn't work.
2668      set X `ls -t "$srcdir/configure" conftest.file`
2669   fi
2670   rm -f conftest.file
2671   if test "$[*]" != "X $srcdir/configure conftest.file" \
2672      && test "$[*]" != "X conftest.file $srcdir/configure"; then
2673
2674      # If neither matched, then we have a broken ls.  This can happen
2675      # if, for instance, CONFIG_SHELL is bash and it inherits a
2676      # broken ls alias from the environment.  This has actually
2677      # happened.  Such a system could not be considered "sane".
2678      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2679alias in your environment])
2680   fi
2681
2682   test "$[2]" = conftest.file
2683   )
2684then
2685   # Ok.
2686   :
2687else
2688   AC_MSG_ERROR([newly created file is older than distributed files!
2689Check your system clock])
2690fi
2691AC_MSG_RESULT(yes)])
2692
2693# Copyright (C) 2009  Free Software Foundation, Inc.
2694#
2695# This file is free software; the Free Software Foundation
2696# gives unlimited permission to copy and/or distribute it,
2697# with or without modifications, as long as this notice is preserved.
2698
2699# serial 1
2700
2701# AM_SILENT_RULES([DEFAULT])
2702# --------------------------
2703# Enable less verbose build rules; with the default set to DEFAULT
2704# (`yes' being less verbose, `no' or empty being verbose).
2705AC_DEFUN([AM_SILENT_RULES],
2706[AC_ARG_ENABLE([silent-rules],
2707[  --enable-silent-rules          less verbose build output (undo: `make V=1')
2708  --disable-silent-rules         verbose build output (undo: `make V=0')])
2709case $enable_silent_rules in
2710yes) AM_DEFAULT_VERBOSITY=0;;
2711no)  AM_DEFAULT_VERBOSITY=1;;
2712*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2713esac
2714AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2715AM_BACKSLASH='\'
2716AC_SUBST([AM_BACKSLASH])dnl
2717_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2718])
2719
2720# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2721#
2722# This file is free software; the Free Software Foundation
2723# gives unlimited permission to copy and/or distribute it,
2724# with or without modifications, as long as this notice is preserved.
2725
2726# AM_PROG_INSTALL_STRIP
2727# ---------------------
2728# One issue with vendor `install' (even GNU) is that you can't
2729# specify the program used to strip binaries.  This is especially
2730# annoying in cross-compiling environments, where the build's strip
2731# is unlikely to handle the host's binaries.
2732# Fortunately install-sh will honor a STRIPPROG variable, so we
2733# always use install-sh in `make install-strip', and initialize
2734# STRIPPROG with the value of the STRIP variable (set by the user).
2735AC_DEFUN([AM_PROG_INSTALL_STRIP],
2736[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2737# Installed binaries are usually stripped using `strip' when the user
2738# run `make install-strip'.  However `strip' might not be the right
2739# tool to use in cross-compilation environments, therefore Automake
2740# will honor the `STRIP' environment variable to overrule this program.
2741dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2742if test "$cross_compiling" != no; then
2743  AC_CHECK_TOOL([STRIP], [strip], :)
2744fi
2745INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2746AC_SUBST([INSTALL_STRIP_PROGRAM])])
2747
2748# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2749#
2750# This file is free software; the Free Software Foundation
2751# gives unlimited permission to copy and/or distribute it,
2752# with or without modifications, as long as this notice is preserved.
2753
2754# serial 2
2755
2756# _AM_SUBST_NOTMAKE(VARIABLE)
2757# ---------------------------
2758# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2759# This macro is traced by Automake.
2760AC_DEFUN([_AM_SUBST_NOTMAKE])
2761
2762# AM_SUBST_NOTMAKE(VARIABLE)
2763# ---------------------------
2764# Public sister of _AM_SUBST_NOTMAKE.
2765AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2766
2767# Check how to create a tarball.                            -*- Autoconf -*-
2768
2769# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2770#
2771# This file is free software; the Free Software Foundation
2772# gives unlimited permission to copy and/or distribute it,
2773# with or without modifications, as long as this notice is preserved.
2774
2775# serial 2
2776
2777# _AM_PROG_TAR(FORMAT)
2778# --------------------
2779# Check how to create a tarball in format FORMAT.
2780# FORMAT should be one of `v7', `ustar', or `pax'.
2781#
2782# Substitute a variable $(am__tar) that is a command
2783# writing to stdout a FORMAT-tarball containing the directory
2784# $tardir.
2785#     tardir=directory && $(am__tar) > result.tar
2786#
2787# Substitute a variable $(am__untar) that extract such
2788# a tarball read from stdin.
2789#     $(am__untar) < result.tar
2790AC_DEFUN([_AM_PROG_TAR],
2791[# Always define AMTAR for backward compatibility.
2792AM_MISSING_PROG([AMTAR], [tar])
2793m4_if([$1], [v7],
2794     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2795     [m4_case([$1], [ustar],, [pax],,
2796              [m4_fatal([Unknown tar format])])
2797AC_MSG_CHECKING([how to create a $1 tar archive])
2798# Loop over all known methods to create a tar archive until one works.
2799_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2800_am_tools=${am_cv_prog_tar_$1-$_am_tools}
2801# Do not fold the above two line into one, because Tru64 sh and
2802# Solaris sh will not grok spaces in the rhs of `-'.
2803for _am_tool in $_am_tools
2804do
2805  case $_am_tool in
2806  gnutar)
2807    for _am_tar in tar gnutar gtar;
2808    do
2809      AM_RUN_LOG([$_am_tar --version]) && break
2810    done
2811    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2812    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2813    am__untar="$_am_tar -xf -"
2814    ;;
2815  plaintar)
2816    # Must skip GNU tar: if it does not support --format= it doesn't create
2817    # ustar tarball either.
2818    (tar --version) >/dev/null 2>&1 && continue
2819    am__tar='tar chf - "$$tardir"'
2820    am__tar_='tar chf - "$tardir"'
2821    am__untar='tar xf -'
2822    ;;
2823  pax)
2824    am__tar='pax -L -x $1 -w "$$tardir"'
2825    am__tar_='pax -L -x $1 -w "$tardir"'
2826    am__untar='pax -r'
2827    ;;
2828  cpio)
2829    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2830    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2831    am__untar='cpio -i -H $1 -d'
2832    ;;
2833  none)
2834    am__tar=false
2835    am__tar_=false
2836    am__untar=false
2837    ;;
2838  esac
2839
2840  # If the value was cached, stop now.  We just wanted to have am__tar
2841  # and am__untar set.
2842  test -n "${am_cv_prog_tar_$1}" && break
2843
2844  # tar/untar a dummy directory, and stop if the command works
2845  rm -rf conftest.dir
2846  mkdir conftest.dir
2847  echo GrepMe > conftest.dir/file
2848  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2849  rm -rf conftest.dir
2850  if test -s conftest.tar; then
2851    AM_RUN_LOG([$am__untar <conftest.tar])
2852    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2853  fi
2854done
2855rm -rf conftest.dir
2856
2857AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2858AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2859AC_SUBST([am__tar])
2860AC_SUBST([am__untar])
2861]) # _AM_PROG_TAR
2862
2863m4_include([.macro_dir/ac_check_package.m4])
2864m4_include([.macro_dir/ac_check_readline.m4])
2865m4_include([.macro_dir/ac_find_motif.m4])
2866m4_include([.macro_dir/libtool.m4])
2867m4_include([.macro_dir/ltoptions.m4])
2868m4_include([.macro_dir/ltsugar.m4])
2869m4_include([.macro_dir/ltversion.m4])
2870m4_include([.macro_dir/lt~obsolete.m4])
2871m4_include([.macro_dir/mysql++_devel.m4])
2872m4_include([.macro_dir/mysql_devel.m4])
Note: See TracBrowser for help on using the repository browser.