3939# - define BOOST_CPPFLAGS
4040# - define BOOST_LDFLAGS
4141# - define BOOST_REQUIRES_CPP11
42+ # - allow separation of boost include and lib directories via $BOOST_INCLUDE_DIR
43+ # and $BOOST_LIB_DIR environment variables
4244#
4345
4446# serial 22
@@ -79,6 +81,19 @@ if test "x$ac_boost_path" = "x"; then
7981 AC_MSG_NOTICE ( [ BOOST_ROOT is defined as $BOOST_ROOT] )
8082fi
8183
84+ # use $BOOST_LIB_DIR to initialize ac_boost_lib_path
85+ if test "x$ac_boost_lib_path" = "x"; then
86+ ac_boost_lib_path=$BOOST_LIB_DIR
87+ AC_MSG_NOTICE ( [ BOOST_LIB_DIR is defined as $BOOST_LIB_DIR] )
88+ fi
89+
90+ # use $BOOST_INCLUDE_DIR to initialize ac_boost_include_path
91+ ac_boost_include_path=""
92+ if test "x$ac_boost_include_path" = "x"; then
93+ ac_boost_include_path=$BOOST_INCLUDE_DIR
94+ AC_MSG_NOTICE ( [ BOOST_INCLUDE_DIR is defined as $BOOST_INCLUDE_DIR] )
95+ fi
96+
8297if test "x$want_boost" = "xyes"; then
8398 boost_lib_version_req=ifelse ( [ $1 ] , ,1.20.0 ,$1 )
8499 boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([ [ 0-9] ] *\.[ [ 0-9] ] *\)'`
@@ -112,15 +127,15 @@ if test "x$want_boost" = "xyes"; then
112127 if test "$ac_boost_path" != ""; then
113128 BOOST_DIR=$ac_boost_path
114129 BOOST_CPPFLAGS="-I$ac_boost_path/include"
115- BOOST_LIB_DIR =""
130+ BOOST_LIB_PATH =""
116131 for ac_boost_path_tmp in $libsubdirs; do
117132 if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
118133 if ls "$ac_boost_path"/"$ac_boost_path_tmp/libboost_"* >/dev/null 2>&1 ; then
119- BOOST_LIB_DIR ="$ac_boost_path/$ac_boost_path_tmp"
134+ BOOST_LIB_PATH ="$ac_boost_path/$ac_boost_path_tmp"
120135 BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
121136 fi
122137 fi
123- if ! test -z "$BOOST_LIB_DIR "; then
138+ if ! test -z "$BOOST_LIB_PATH "; then
124139 break;
125140 fi
126141 done
@@ -139,11 +154,17 @@ if test "x$want_boost" = "xyes"; then
139154 fi
140155
141156 dnl overwrite ld flags if we have required special directory with
142- dnl --with-boost-libdir parameter
157+ dnl --with-boost-libdir parameter or via $BOOST_LIB_DIR
143158 if test "$ac_boost_lib_path" != ""; then
144159 BOOST_LDFLAGS="-L$ac_boost_lib_path"
145160 fi
146161
162+ dnl overwrite cpp flags if we have required special directory via
163+ dnl $BOOST_INCLUDE_DIR
164+ if test "$ac_boost_include_path" != ""; then
165+ BOOST_CPPFLAGS="-I$ac_boost_include_path"
166+ fi
167+
147168 CPPFLAGS_SAVED="$CPPFLAGS"
148169 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
149170 export CPPFLAGS
@@ -288,6 +309,7 @@ if test "x$want_boost" = "xyes"; then
288309 AC_MSG_NOTICE ( [ Using boost version $BOOST_VERSION] )
289310 AC_MSG_NOTICE ( [ Using BOOST_DIR: $BOOST_DIR] )
290311 AC_MSG_NOTICE ( [ Using BOOST_LIB_DIR: $BOOST_LIB_DIR] )
312+ AC_MSG_NOTICE ( [ Using BOOST_INCLUDE_DIR: $BOOST_INCLUDE_DIR] )
291313 AC_MSG_NOTICE ( [ Using BOOST_CPPFLAGS: $BOOST_CPPFLAGS] )
292314 AC_MSG_NOTICE ( [ Using BOOST_LDFLAGS: $BOOST_LDFLAGS] )
293315 AC_MSG_NOTICE ( [ Using BOOST_REQUIRES_CPP11: $BOOST_REQUIRES_CPP11] )
0 commit comments