Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 110 lines (88 sloc) 3.808 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
781eaa6 @novas0x2a oops, I didn't mean to commit that boost thing yet.
novas0x2a authored
8 m4_ifset([m4_argn], [],
9 [m4_define([m4_argn],
10 [m4_car(m4_shiftn($1, $@))])])
11
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
12 # Usage: AX_PKG_BOOST(<required boost libs> [,boost_lib, how-to-detect-lib]*)
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
13 AC_DEFUN([AX_PKG_BOOST],
14 [
298cc32 @novas0x2a output the option-handling code later in the process
novas0x2a authored
15 m4_divert_once([INIT_PREPARE], [dnl
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
16 AC_ARG_WITH(boost,
17 AC_HELP_STRING([--with-boost], [enable searching for the boost package @<:@auto@:>@]),
18 [ HAVE_PKG_BOOST=$withval ]
298cc32 @novas0x2a output the option-handling code later in the process
novas0x2a authored
19 )])
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
20
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
21 AC_LANG_ASSERT(C++)
22
93ae5cf @novas0x2a fix bashism that snuck into the scripts
novas0x2a authored
23 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
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
24 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
25 else
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
26 PKG_PATHS_BOOST="${PKG_PATHS}"
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
27 fi
28
29 # Skip testing if the user has overridden
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
30 if test "no" = "$HAVE_PKG_BOOST"; then
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
31 HAVE_PKG_BOOST="no:disabled by user"
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
32 elif test x"${HAVE_PKG_BOOST#no:}" != "x$HAVE_PKG_BOOST"; then # read as: if has_prefix(HAVE_PKG_BOOST, "no:")
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
33 :
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
34 else
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
35
36 HAVE_PKG_BOOST=no
37
38 for ax_boost_base_path in $PKG_PATHS_BOOST; do
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
39 boost_base_path_glob="${ax_boost_base_path}/include/boost-*"
40 for ax_boost_inc_path in ${ax_boost_base_path}/include `echo ${boost_base_path_glob} | xargs -n1 | sort -r` ; do
41 AX_LOG([Checking for a boost in ${ax_boost_inc_path}])
42 if test -f "${ax_boost_inc_path}/boost/version.hpp"; then
43 AC_MSG_NOTICE([Checking if Boost at ${ax_boost_inc_path}/boost is OK])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
44
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
45 AX_EXTRACT_CPP_SYMBOL([BOOST_VERSION], [#include <boost/version.hpp>], [BOOST_VERSION=$output],
e30cdcf @novas0x2a fix new boost detection on osx
novas0x2a authored
46 [AX_LOG([Couldn't get boost version for $ax_boost_inc_path/boost]); continue;],
47 ["-I${ax_boost_inc_path}"])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
48
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
49 AX_LOG([Found boost includes at ${ax_boost_inc_path}, version(${BOOST_VERSION})])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
50
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
51 PKG_BOOST_INCDIR="${ax_boost_inc_path}"
52 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
53
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
54 # In case it's not in lib64 despite specifying lib64...
55 if test ! -d $PKG_BOOST_LIBDIR -a x"${AX_OTHER_LIBDIR}" != "x"; then
56 PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_OTHER_LIBDIR}"
57 fi
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
58
781eaa6 @novas0x2a oops, I didn't mean to commit that boost thing yet.
novas0x2a authored
59 m4_for([idx], 3, $#, 2, [m4_do(m4_argn(idx, $@)) ])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
60
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
61 missing=
62 AC_FOREACH([required], $1,
781eaa6 @novas0x2a oops, I didn't mean to commit that boost thing yet.
novas0x2a authored
63 [AS_IF([test x"$HAVE_PKG_]required[" != "xyes"], [missing="${missing} required"])
64 ])
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
65
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
66 AS_IF([test -n "$missing"], [AC_MSG_NOTICE([${ax_boost_inc_path}/boost is missing these required libraries: $missing]); continue;],
67 [
68 HAVE_PKG_BOOST="yes"
69 break 2
70 ])
71 fi
72 done
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
73 done
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
74
9bfff2f @novas0x2a make it so --with-boost does what you'd expect
novas0x2a authored
75 fi
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
76
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
77 AC_MSG_CHECKING(for package BOOST)
78
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
79 if test "${HAVE_PKG_BOOST}" = "yes" ; then
80 ax_have_pkg_bool=1
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
81 OTHER_CPPFLAGS="${OTHER_CPPFLAGS} -I${PKG_BOOST_INCDIR}"
82 OTHER_LDFLAGS="${OTHER_LDFLAGS} -L${PKG_BOOST_LIBDIR}"
83 AC_MSG_RESULT([yes])
84 elif test x"${HAVE_PKG_BOOST#no:}" != "x$HAVE_PKG_BOOST"; then # read as: if has_prefix(HAVE_PKG_BOOST, "no:")
85 dnl { and } break AC_MSG_RESULT
86 reason="${HAVE_PKG_BOOST#no:}"
87 AC_MSG_RESULT([no ($reason)])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
88 else
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
89 HAVE_PKG_BOOST=no
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
90 ax_have_pkg_bool=0
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
91 AC_MSG_RESULT([no])
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
92 fi
1605e60 @novas0x2a re-work boost detection again
novas0x2a authored
93
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
94 AC_DEFINE_UNQUOTED([HAVE_PKG_BOOST],
95 [$ax_have_pkg_bool],
96 [Define to 1 if the BOOST package is available.])
97
54183f2 @novas0x2a Mostly sync the macros between vw & stereo. This is good either if we st...
novas0x2a authored
98 AC_SUBST(PKG_BOOST_CPPFLAGS)
99 AC_SUBST(PKG_BOOST_LIBS)
0643e91 @novas0x2a split the macros into one-per-file, and move the thirdparty ones to a ne...
novas0x2a authored
100 AC_SUBST(HAVE_PKG_BOOST)
101
80359c7 @novas0x2a fix up boost detection to be a little less fragile... i hope.
novas0x2a authored
102 AX_LOG(HAVE_PKG_BOOST=${HAVE_PKG_BOOST})
103 AX_LOG(PKG_BOOST_CPPFLAGS=$PKG_BOOST_CPPFLAGS)
104 AX_LOG(PKG_BOOST_LIBS=$PKG_BOOST_LIBS)
105 AX_LOG(CPPFLAGS=$CPPFLAGS)
106 AX_LOG(LDFLAGS=$LDFLAGS)
107 AX_LOG(OTHER_CPPFLAGS=$OTHER_CPPFLAGS)
108 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
109 ])
Something went wrong with that request. Please try again.