Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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