Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 143 lines (132 sloc) 5.037 kb
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
1 # Usage: AX_PKG_BOOST
2 AC_DEFUN([AX_PKG_BOOST],
3 [
4 AC_MSG_CHECKING(for package BOOST)
5 if test "$ENABLE_VERBOSE" = "yes"; then
6 AC_MSG_RESULT([])
7 fi
8
9 AC_LANG_ASSERT(C++)
10
11 if test -n "${HAVE_PKG_BOOST}" && test "${HAVE_PKG_BOOST}" != "yes" && test "${HAVE_PKG_BOOST}" != "no"; then
12 PKG_PATHS_BOOST=${HAVE_PKG_BOOST}
13 unset HAVE_PKG_BOOST
14 else
15 PKG_PATHS_BOOST=${PKG_PATHS}
16 fi
17
18 # Skip testing if the user has overridden
19 if test -z ${HAVE_PKG_BOOST}; then
20
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
21 PKG_BOOST_CPPFLAGS=
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
22 PKG_BOOST_LIBS=
23 HAVE_PKG_BOOST=no
24
25 for ax_boost_base_path in $PKG_PATHS_BOOST; do
26 # First look for a system-style installation
27 if test "$ENABLE_VERBOSE" = "yes"; then
28 AC_MSG_CHECKING([for system-style boost in ${ax_boost_base_path}])
29 fi
30 if test -d "${ax_boost_base_path}/include/boost" ; then
31 PKG_BOOST_INCDIR="${ax_boost_base_path}/include"
32 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_LIBDIR}"
33 # In case it's not in lib64 despite specifying lib64...
34 if test ! -d $PKG_BOOST_LIBDIR -a x"${AX_LIBDIR}" = "xlib64"; then
35 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_OTHER_LIBDIR}"
36 fi
37 HAVE_PKG_BOOST="yes"
38 if test "$ENABLE_VERBOSE" = "yes"; then
39 AC_MSG_RESULT([found])
40 fi
41 break
42 else
43 if test "$ENABLE_VERBOSE" = "yes"; then
44 AC_MSG_RESULT([not found])
45 fi
46 fi
47 # Next look for a default-style installation
48 if test "$ENABLE_VERBOSE" = "yes"; then
49 AC_MSG_CHECKING([for default-style boost in ${ax_boost_base_path}])
50 fi
51 for ax_boost_inc_path in `ls -d ${ax_boost_base_path}/include/boost-* 2> /dev/null` ; do
52 # At the moment we greedily accept the first one we find, regardless of version
53 PKG_BOOST_INCDIR="${ax_boost_inc_path}"
54 PKG_BOOST_LIBDIR="${ax_boost_base_path}/lib"
55 HAVE_PKG_BOOST="yes"
56 if test "$ENABLE_VERBOSE" = "yes"; then
57 AC_MSG_RESULT([found])
58 fi
59 break 2
60 done
61 if test "$ENABLE_VERBOSE" = "yes"; then
62 AC_MSG_RESULT([not found])
63 fi
64 done
65 fi
66
67 if test "${HAVE_PKG_BOOST}" = "yes" ; then
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
68 ax_pkg_old_other_cppflags=$OTHER_CPPFLAGS
69 ax_pkg_old_other_ldflags=$OTHER_LDFLAGS
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
70 ax_pkg_old_cppflags=$CPPFLAGS
71 ax_pkg_old_ldflags=$LDFLAGS
72 ax_pkg_old_libs=$LIBS
73 while true ; do
74 # First see if the current paths are sufficient
75 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
76 AC_MSG_CHECKING([whether current paths are sufficient...])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
77 fi
78 AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
79 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
80 AC_MSG_RESULT([$ax_result])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
81 fi
82 if test "$ax_result" = "yes" ; then break ; fi
83 # Try it with just the include path
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
84 OTHER_CPPFLAGS="-I${PKG_BOOST_INCDIR} $OTHER_CPPFLAGS"
85 CPPFLAGS="$ax_pkg_old_cppflags $OTHER_CPPFLAGS"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
86 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
87 AC_MSG_CHECKING([whether adding the include path is sufficient...])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
88 fi
89 AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
90 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
91 AC_MSG_RESULT([$ax_result])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
92 fi
93 if test "$ax_result" = "yes" ; then break ; fi
94 # Finally, try it with the linker path
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
95 OTHER_LDFLAGS="-L${PKG_BOOST_LIBDIR} $OTHER_LDFLAGS"
96 LDFLAGS="$ax_pkg_old_ldflags $OTHER_LDFLAGS"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
97 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
98 AC_MSG_CHECKING([whether adding the include and linker paths works...])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
99 fi
100 AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
101 if test "x${ENABLE_VERBOSE}" = "xyes" ; then
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
102 AC_MSG_RESULT([$ax_result])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
103 fi
104 if test "$ax_result" = "yes" ; then break ; fi
105 # The detected version of boost seems to be invalid!
106 HAVE_PKG_BOOST="no"
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
107 OTHER_CPPFLAGS="$ax_pkg_old_other_cppflags"
108 OTHER_LDFLAGS="$ax_pkg_old_other_ldflags"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
109 unset PKG_BOOST_INCDIR
110 unset PKG_BOOST_LIBDIR
111 break
112 done
113 fi
114 CPPFLAGS="$ax_pkg_old_cppflags"
115 LDFLAGS="$ax_pkg_old_ldflags"
116
117 if test "${HAVE_PKG_BOOST}" = "yes" ; then
118 ax_have_pkg_bool=1
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
119 PKG_BOOST_CPPFLAGS="-I${PKG_BOOST_INCDIR}"
120 PKG_BOOST_LIBS="-L${PKG_BOOST_LIBDIR}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
121 else
122 ax_have_pkg_bool=0
123 fi
124 AC_DEFINE_UNQUOTED([HAVE_PKG_BOOST],
125 [$ax_have_pkg_bool],
126 [Define to 1 if the BOOST package is available.])
127
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
128 AC_SUBST(PKG_BOOST_CPPFLAGS)
129 AC_SUBST(PKG_BOOST_LIBS)
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
130 AC_SUBST(HAVE_PKG_BOOST)
131
132 if test "$ENABLE_VERBOSE" = "yes"; then
133 AC_MSG_NOTICE([HAVE_PKG_BOOST= $HAVE_PKG_BOOST])
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
134 AC_MSG_NOTICE([OTHER_CPPFLAGS= $OTHER_CPPFLAGS])
135 AC_MSG_NOTICE([OTHER_LDFLAGS= $OTHER_LDFLAGS])
2f8a07f @novas0x2a change ax_pkg's var handling to make sure it always cleans its vars when
novas0x2a authored
136 AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
137 AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
138 else
139 AC_MSG_RESULT([$HAVE_PKG_BOOST])
140 fi
141
142 ])
Something went wrong with that request. Please try again.