2 dnl Copyright 2004,2005 Free Software Foundation, Inc.
4 dnl This file is part of GNU Radio
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING. If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
22 dnl This tries to do the "right thing" to locate the boost include files.
23 dnl If the user explicitly specified --with-boost-include-dir=<foo>
24 dnl we believe them and use it. Otherwise,
26 dnl We look for boost/shared_ptr.hpp in the "normal places". That is,
27 dnl wherever AC_CHECK_HEADER looks. If the boost includes are in /usr/local/include
28 dnl this step will find them.
30 dnl Otherwise, we check to see if the boost stuff was installed in a version-specific
31 dnl directory under /usr/local/include. These look like: /usr/local/include/boost-1_33_1
32 dnl If there's more than one version installed, we select the
33 dnl lexicographically greatest one.
35 dnl If none of these work, we bail.
37 AC_DEFUN([GR_REQUIRE_BOOST_INCLUDES],
41 AC_ARG_WITH([boost-include-dir],
42 AC_HELP_STRING([--with-boost-include-dir=<path>],
43 [path to boost c++ include files]),
45 # "yes" and "no" are bogus answers
46 if test x"$with_boost_include_dir" = xyes ||
47 test x"$with_boost_include_dir" = xno; then
50 gr_boost_include_dir=$with_boost_include_dir
53 echo "gr_boost_include_dir = $gr_boost_include_dir"
54 if test x$gr_boost_include_dir != x; then
56 # If the user specified a directory, then we use it
58 OLD_CPPFLAGS=$CPPFLAGS
59 CPPFLAGS="$CPPFLAGS -I$gr_boost_include_dir"
60 AC_CHECK_HEADER([boost/shared_ptr.hpp],
61 [BOOST_CFLAGS="-I$gr_boost_include_dir"],
63 [Failed to locate boost/shared_ptr.hpp.
64 Try using --with-boost-include-dir=<path>,
65 E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])])
66 CPPFLAGS=$OLD_CPPFLAGS
69 # Otherwise we check in the default places
71 AC_CHECK_HEADER([boost/shared_ptr.hpp],
73 [ # Nope, look for latest version if any in $prefix/include/boost-*
75 # Wipe out cached value. KLUDGE: AC should have API for this
76 unset AS_TR_SH([ac_cv_header_boost/shared_ptr.hpp])
79 #echo "boost_last_match: [$]*"
82 if test "[$]pattern" = "[$]1"
92 pattern="/usr/local/include/boost-*"
93 boost_last_match "$pattern" $pattern
96 OLD_CPPFLAGS=$CPP_FLAGS
97 CPPFLAGS="$CPPFLAGS -I$LM"
98 AC_CHECK_HEADER([boost/shared_ptr.hpp],
99 [BOOST_CFLAGS="-I$LM"],
101 [Failed to locate boost/shared_ptr.hpp.
102 Try using --with-boost-include-dir=<path>,
103 E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])])
104 CPPFLAGS=$OLD_CPPFLAGS
108 unset boost_last_match LM
110 AC_SUBST(BOOST_CFLAGS)