~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to m4/ax_boost_thread.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ===========================================================================
2
 
#            http://autoconf-archive.cryp.to/ax_boost_thread.html
 
2
#         http://www.nongnu.org/autoconf-archive/ax_boost_thread.html
3
3
# ===========================================================================
4
4
#
5
5
# SYNOPSIS
20
20
#
21
21
#     HAVE_BOOST_THREAD
22
22
#
23
 
# LAST MODIFICATION
24
 
#
25
 
#   2008-04-12
26
 
#
27
 
# COPYLEFT
28
 
#
29
 
#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
30
 
#   Copyright (c) 2008 Michael Tindal
 
23
# LICENSE
 
24
#
 
25
#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
 
26
#   Copyright (c) 2009 Michael Tindal
31
27
#
32
28
#   Copying and distribution of this file, with or without modification, are
33
29
#   permitted in any medium without royalty provided the copyright notice
40
36
                   [use the Thread library from boost - it is possible to specify a certain library for the linker
41
37
                        e.g. --with-boost-thread=boost_thread-gcc-mt ]),
42
38
        [
43
 
        if test "$withval" = "no"; then
 
39
        if test "x$withval" = "xno"; then
44
40
                        want_boost="no"
45
 
        elif test "$withval" = "yes"; then
 
41
        elif test "x$withval" = "xyes"; then
46
42
            want_boost="yes"
47
43
            ax_boost_user_thread_lib=""
48
44
        else
69
65
        [AC_LANG_PUSH([C++])
70
66
                         CXXFLAGS_SAVE=$CXXFLAGS
71
67
 
72
 
                         if test "x$build_os" = "xsolaris" ; then
73
 
                                 CXXFLAGS="-pthreads $CXXFLAGS"
74
 
                         elif test "x$build_os" = "xming32" ; then
75
 
                                 CXXFLAGS="-mthreads $CXXFLAGS"
76
 
                         else
77
 
                                CXXFLAGS="-pthread $CXXFLAGS"
78
 
                         fi
 
68
dnl                      if test "x$build_os" = "xsolaris" ; then
 
69
dnl                              CXXFLAGS="-pthreads $CXXFLAGS"
 
70
dnl                      elif test "x$build_os" = "xming32" ; then
 
71
dnl                              CXXFLAGS="-mthreads $CXXFLAGS"
 
72
dnl                      else
 
73
dnl                             CXXFLAGS="-pthread $CXXFLAGS"
 
74
dnl                      fi
79
75
                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
80
76
                                   [[boost::thread_group thrds;
81
77
                                   return 0;]]),
84
80
             AC_LANG_POP([C++])
85
81
                ])
86
82
                if test "x$ax_cv_boost_thread" = "xyes"; then
87
 
           if test "x$build_os" = "xsolaris" ; then
88
 
                          BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
89
 
                   elif test "x$build_os" = "xming32" ; then
90
 
                          BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
91
 
                   else
92
 
                          BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
93
 
                   fi
 
83
dnl           if test "x$build_os" = "xsolaris" ; then
 
84
dnl                       BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
 
85
dnl                elif test "x$build_os" = "xming32" ; then
 
86
dnl                       BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
 
87
dnl                else
 
88
dnl                       BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
 
89
dnl                fi
94
90
 
95
91
                        AC_SUBST(BOOST_CPPFLAGS)
96
92
 
97
 
                        AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
 
93
                        AC_DEFINE(HAVE_BOOST_THREAD,[1],[define if the Boost::Thread library is available])
98
94
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
99
95
 
100
96
                        LDFLAGS_SAVE=$LDFLAGS
105
101
                          ;;
106
102
                        esac
107
103
            if test "x$ax_boost_user_thread_lib" = "x"; then
108
 
                for libextension in `ls $BOOSTLIBDIR/libboost_thread*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;' -e 's;^lib\(boost_thread.*\)\.a*$;\1;'` ; do
 
104
                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
109
105
                     ax_lib=${libextension}
110
106
                                    AC_CHECK_LIB($ax_lib, exit,
111
107
                                 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
112
108
                                 [link_thread="no"])
113
109
                                done
114
110
                if test "x$link_thread" != "xyes"; then
115
 
                for libextension in `ls $BOOSTLIBDIR/boost_thread*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;' -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
 
111
                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
116
112
                     ax_lib=${libextension}
117
113
                                    AC_CHECK_LIB($ax_lib, exit,
118
114
                                 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],