Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 131 lines (104 sloc) 4.252 kB
c98254b @novas0x2a relicense everything. woo.
novas0x2a authored
1 dnl __BEGIN_LICENSE__
2 dnl Copyright (C) 2006, 2007 United States Government as represented by
3 dnl the Administrator of the National Aeronautics and Space Administration.
4 dnl All Rights Reserved.
5 dnl __END_LICENSE__
6
7
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
8 # Usage: AX_PKG_BOOST
9 AC_DEFUN([AX_PKG_BOOST],
10 [
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
11 AC_ARG_WITH(boost,
12 AC_HELP_STRING([--with-boost], [enable searching for the boost package @<:@auto@:>@]),
13 [ HAVE_PKG_BOOST=$withval ]
14 )
15
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
16 AC_MSG_CHECKING(for package BOOST)
17
18 AC_LANG_ASSERT(C++)
19
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
20 if test -n "${HAVE_PKG_BOOST}" && test "${HAVE_PKG_BOOST}" != "yes" && test "${HAVE_PKG_BOOST}" != "no" && test x"${HAVE_PKG_BOOST#no:}" == "x$HAVE_PKG_BOOST"; then
21 PKG_PATHS_BOOST="${HAVE_PKG_BOOST}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
22 else
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
23 PKG_PATHS_BOOST="${PKG_PATHS}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
24 fi
25
26 # Skip testing if the user has overridden
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
27 if test "no" = "$HAVE_PKG_BOOST"; then
28 AC_MSG_RESULT([no (disabled by user)])
29 elif test x"${HAVE_PKG_BOOST#no:}" != "x$HAVE_PKG_BOOST"; then # read as: if has_prefix(HAVE_PKG_BOOST, "no:")
30 dnl { and } break AC_MSG_RESULT
31 reason="${HAVE_PKG_BOOST#no:}"
32 AC_MSG_RESULT([no ($reason)])
33 HAVE_PKG_BOOST=no
34 else
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
35
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we…
novas0x2a authored
36 PKG_BOOST_CPPFLAGS=
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
37 PKG_BOOST_LIBS=
38 HAVE_PKG_BOOST=no
39
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
40 ax_pkg_old_other_cppflags="$OTHER_CPPFLAGS"
41 ax_pkg_old_other_ldflags="$OTHER_LDFLAGS"
42 ax_pkg_old_cppflags="$CPPFLAGS"
43 ax_pkg_old_ldflags="$LDFLAGS"
44
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
45 for ax_boost_base_path in $PKG_PATHS_BOOST; do
46 # First look for a system-style installation
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
47 AX_LOG([Checking for a boost in ${ax_boost_base_path}])
48
49 if test -f "${ax_boost_base_path}/include/boost/version.hpp" ; then
50 AX_LOG([Found a system-style boost])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
51 PKG_BOOST_INCDIR="${ax_boost_base_path}/include"
ee32d07 @novas0x2a Revert "fix boost detection of AX_OTHER_LIBDIR (lib64/lib32)"
novas0x2a authored
52 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_LIBDIR}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
53 HAVE_PKG_BOOST="yes"
54 else
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
55 # Next look for a default-style installation
56 for ax_boost_inc_path in `ls -d ${ax_boost_base_path}/include/boost-* 2> /dev/null` ; do
57 AX_LOG([Checking for default-style boost in ${ax_boost_inc_path}])
58 if test -f "${ax_boost_inc_path}/boost/version.hpp"; then
59 AX_LOG([Found a default-style boost in ${ax_boost_inc_path}])
60 # At the moment we greedily accept the first one we find, regardless of version
61 PKG_BOOST_INCDIR="${ax_boost_inc_path}"
ee32d07 @novas0x2a Revert "fix boost detection of AX_OTHER_LIBDIR (lib64/lib32)"
novas0x2a authored
62 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_LIBDIR}"
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
63 HAVE_PKG_BOOST="yes"
64 fi
65 done
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
66 fi
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
67
68 if test x"${HAVE_PKG_BOOST}" = "xyes"; then
69
70 HAVE_PKG_BOOST="no"
71
ef3bb6e @novas0x2a change how lib64/lib32 detection works
novas0x2a authored
72 # In case it's not in lib64 despite specifying lib64...
73 if test ! -d $PKG_BOOST_LIBDIR -a x"${AX_OTHER_LIBDIR}" != "x"; then
74 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_OTHER_LIBDIR}"
75 fi
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
76
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
77 OTHER_CPPFLAGS="-I${PKG_BOOST_INCDIR} $OTHER_CPPFLAGS"
78 OTHER_LDFLAGS="-L${PKG_BOOST_LIBDIR} $OTHER_LDFLAGS"
79
80 CPPFLAGS="$ax_pkg_old_cppflags $OTHER_CPPFLAGS"
81 LDFLAGS="$ax_pkg_old_ldflags $OTHER_LDFLAGS"
82
83 echo "#include <boost/version.hpp>" > conftest.h
84
85 dnl check for the header
86 dnl otherwise, check next path
87 AC_LINK_IFELSE(
88 AC_LANG_PROGRAM([#include "conftest.h"],[]),
89 [ HAVE_PKG_BOOST=yes; break; ])
90
91 HAVE_PKG_BOOST="no"
92 OTHER_CPPFLAGS="$ax_pkg_old_other_cppflags"
93 OTHER_LDFLAGS="$ax_pkg_old_other_ldflags"
94 unset PKG_BOOST_INCDIR
95 unset PKG_BOOST_LIBDIR
96
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
97 fi
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
98
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
99 done
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
100
101 CPPFLAGS="$ax_pkg_old_cppflags"
102 LDFLAGS="$ax_pkg_old_ldflags"
103
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
104 AC_MSG_RESULT([$HAVE_PKG_BOOST])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
105
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
106 fi
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
107
108 if test "${HAVE_PKG_BOOST}" = "yes" ; then
109 ax_have_pkg_bool=1
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we…
novas0x2a authored
110 PKG_BOOST_CPPFLAGS="-I${PKG_BOOST_INCDIR}"
111 PKG_BOOST_LIBS="-L${PKG_BOOST_LIBDIR}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
112 else
113 ax_have_pkg_bool=0
114 fi
115 AC_DEFINE_UNQUOTED([HAVE_PKG_BOOST],
116 [$ax_have_pkg_bool],
117 [Define to 1 if the BOOST package is available.])
118
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we…
novas0x2a authored
119 AC_SUBST(PKG_BOOST_CPPFLAGS)
120 AC_SUBST(PKG_BOOST_LIBS)
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
121 AC_SUBST(HAVE_PKG_BOOST)
122
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
123 AX_LOG(HAVE_PKG_BOOST=${HAVE_PKG_BOOST})
124 AX_LOG(PKG_BOOST_CPPFLAGS=$PKG_BOOST_CPPFLAGS)
125 AX_LOG(PKG_BOOST_LIBS=$PKG_BOOST_LIBS)
126 AX_LOG(CPPFLAGS=$CPPFLAGS)
127 AX_LOG(LDFLAGS=$LDFLAGS)
128 AX_LOG(OTHER_CPPFLAGS=$OTHER_CPPFLAGS)
129 AX_LOG(OTHER_LDFLAGS=$OTHER_LDFLAGS)
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a…
novas0x2a authored
130 ])
Something went wrong with that request. Please try again.