~ubuntu-branches/ubuntu/wily/aegisub/wily-proposed

« back to all changes in this revision

Viewing changes to m4macros/ax_boost_chrono.m4

  • Committer: Package Import Robot
  • Author(s): Sebastian Reichel, Pascal De Vuyst, Juan Picca, Sebastian Reichel
  • Date: 2015-08-04 21:40:50 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20150804214050-y2aghm9vdksoc8t7
Tags: 3.2.2+dfsg-1
[ Pascal De Vuyst ]
* Fix Typo in package description (Closes: #739219)

[ Juan Picca ]
* Add patch to fix reproducible build (Closes: #789728)

[ Sebastian Reichel ]
* New upstream release
 - remove vendor directory from orig tarball
* Update Debian Standards Version to 3.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# ===========================================================================
2
 
#      http://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html
3
 
# ===========================================================================
4
 
#
5
 
# SYNOPSIS
6
 
#
7
 
#   AX_BOOST_CHRONO
8
 
#
9
 
# DESCRIPTION
10
 
#
11
 
#   Test for System library from the Boost C++ libraries. The macro requires
12
 
#   a preceding call to AX_BOOST_BASE. Further documentation is available at
13
 
#   <http://randspringer.de/boost/index.html>.
14
 
#
15
 
#   This macro calls:
16
 
#
17
 
#     AC_SUBST(BOOST_CHRONO_LIB)
18
 
#
19
 
#   And sets:
20
 
#
21
 
#     HAVE_BOOST_CHRONO
22
 
#
23
 
# LICENSE
24
 
#
25
 
#   Copyright (c) 2012 Xiyue Deng <manphiz@gmail.com>
26
 
#
27
 
#   Copying and distribution of this file, with or without modification, are
28
 
#   permitted in any medium without royalty provided the copyright notice
29
 
#   and this notice are preserved. This file is offered as-is, without any
30
 
#   warranty.
31
 
 
32
 
#serial 1
33
 
 
34
 
AC_DEFUN([AX_BOOST_CHRONO],
35
 
[
36
 
        AC_ARG_WITH([boost-chrono],
37
 
        AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@],
38
 
                   [use the Chrono library from boost - it is possible to specify a certain library for the linker
39
 
                        e.g. --with-boost-chrono=boost_chrono-gcc-mt ]),
40
 
        [
41
 
        if test "$withval" = "no"; then
42
 
                        want_boost="no"
43
 
        elif test "$withval" = "yes"; then
44
 
            want_boost="yes"
45
 
            ax_boost_user_chrono_lib=""
46
 
        else
47
 
                    want_boost="yes"
48
 
                ax_boost_user_chrono_lib="$withval"
49
 
                fi
50
 
        ],
51
 
        [want_boost="yes"]
52
 
        )
53
 
 
54
 
        if test "x$want_boost" = "xyes"; then
55
 
        AC_REQUIRE([AC_PROG_CC])
56
 
        AC_REQUIRE([AC_CANONICAL_BUILD])
57
 
                CPPFLAGS_SAVED="$CPPFLAGS"
58
 
                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
59
 
                export CPPFLAGS
60
 
 
61
 
                LDFLAGS_SAVED="$LDFLAGS"
62
 
                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
63
 
                export LDFLAGS
64
 
 
65
 
                AS_IF([test x$enable_sanity_checks != xno], [
66
 
        AC_CACHE_CHECK(whether the Boost::Chrono library is available,
67
 
                                           ax_cv_boost_chrono,
68
 
        [AC_LANG_PUSH([C++])
69
 
                         CXXFLAGS_SAVE=$CXXFLAGS
70
 
 
71
 
                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/chrono.hpp>]],
72
 
                                   [[boost::chrono::system_clock::time_point time;]])],
73
 
                   ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no)
74
 
                         CXXFLAGS=$CXXFLAGS_SAVE
75
 
             AC_LANG_POP([C++])
76
 
                ])
77
 
                ], [ax_cv_boost_chrono=yes])
78
 
                if test "x$ax_cv_boost_chrono" = "xyes"; then
79
 
                        AC_SUBST(BOOST_CPPFLAGS)
80
 
 
81
 
                        AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available])
82
 
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
83
 
 
84
 
                        LDFLAGS_SAVE=$LDFLAGS
85
 
            if test "x$ax_boost_user_chrono_lib" = "x"; then
86
 
                for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do
87
 
                     ax_lib=${libextension}
88
 
                                    AC_CHECK_LIB($ax_lib, exit,
89
 
                                 [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
90
 
                                 [link_chrono="no"])
91
 
                                done
92
 
                if test "x$link_chrono" != "xyes"; then
93
 
                for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do
94
 
                     ax_lib=${libextension}
95
 
                                    AC_CHECK_LIB($ax_lib, exit,
96
 
                                 [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
97
 
                                 [link_chrono="no"])
98
 
                                done
99
 
                fi
100
 
 
101
 
            else
102
 
               for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do
103
 
                                      AC_CHECK_LIB($ax_lib, exit,
104
 
                                   [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
105
 
                                   [link_chrono="no"])
106
 
                  done
107
 
 
108
 
            fi
109
 
            if test "x$ax_lib" = "x"; then
110
 
                AC_MSG_ERROR(Could not find a version of the library!)
111
 
            fi
112
 
                        if test "x$link_chrono" = "xno"; then
113
 
                                AC_MSG_ERROR(Could not link against $ax_lib !)
114
 
                        fi
115
 
                fi
116
 
 
117
 
                CPPFLAGS="$CPPFLAGS_SAVED"
118
 
        LDFLAGS="$LDFLAGS_SAVED"
119
 
        fi
120
 
])