| | 166 | |
|---|
| | 167 | # Build up the possible Boost library suffix names. These will be stored in |
|---|
| | 168 | # $boost_suffixes and used later as necessary. |
|---|
| | 169 | case $CC in |
|---|
| | 170 | gcc*|*/gcc*) |
|---|
| | 171 | toolset='-gcc' |
|---|
| | 172 | ;; |
|---|
| | 173 | icc*|*/icc*) |
|---|
| | 174 | if test "x$OS_TYPE" = "xWin32" ; then |
|---|
| | 175 | toolset='-iw' |
|---|
| | 176 | else |
|---|
| | 177 | toolset='-il' |
|---|
| | 178 | fi |
|---|
| | 179 | ;; |
|---|
| | 180 | cygcl|msvccc|cl*|CL*) |
|---|
| | 181 | toolset="-${BOOST_TOOL:=vc7}" |
|---|
| | 182 | ;; |
|---|
| | 183 | cc*|*/cc*) |
|---|
| | 184 | if test "x$GCC" = "xyes" ; then |
|---|
| | 185 | toolset='-gcc' |
|---|
| | 186 | else |
|---|
| | 187 | case $PLATFORM in |
|---|
| | 188 | IRIX) |
|---|
| | 189 | toolset='-mp' |
|---|
| | 190 | ;; |
|---|
| | 191 | Solaris) |
|---|
| | 192 | toolset='-sw' |
|---|
| | 193 | ;; |
|---|
| | 194 | esac |
|---|
| | 195 | fi |
|---|
| | 196 | ;; |
|---|
| | 197 | esac |
|---|
| | 198 | |
|---|
| | 199 | # A correct installation of Boost on Darwin does not include the toolset name |
|---|
| | 200 | # as part of the library file name. |
|---|
| | 201 | if test "x$PLATFORM" = "xDarwin" ; then |
|---|
| | 202 | toolset='' |
|---|
| | 203 | threading='' |
|---|
| | 204 | else |
|---|
| | 205 | # We can only use multi-threading versions of Boost libraries if we are |
|---|
| | 206 | # not using SPROC threads. Boost does not support SPROC. |
|---|
| | 207 | if test "x$SUBSYSTEM" != "xSPROC" -a "x$ABI" != "x64" ; then |
|---|
| | 208 | threading='-mt' |
|---|
| | 209 | fi |
|---|
| | 210 | fi |
|---|
| | 211 | |
|---|
| | 212 | boost_suffixes="$toolset$threading-$BOOST_LIB_VERSION $toolset$threading $threading" |
|---|
| | 213 | |
|---|
| | 214 | if test "x$given_boost_po_libname" != "x" ; then |
|---|
| | 215 | boost_po_name="$given_boost_po_libname" |
|---|
| | 216 | fi |
|---|
| | 217 | |
|---|
| | 218 | # Ensure that a compiled version of the Boost.program_options library is available. |
|---|
| | 219 | vrjsave_CXXFLAGS="$CXXFLAGS" |
|---|
| | 220 | vrjsave_CPPFLAGS="$CPPFLAGS" |
|---|
| | 221 | vrjsave_LIBS="$LIBS" |
|---|
| | 222 | vrjsave_LDFLAGS="$LDFLAGS" |
|---|
| | 223 | |
|---|
| | 224 | CXXFLAGS="$CXXFLAGS $ABI_FLAGS" |
|---|
| | 225 | CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES" |
|---|
| | 226 | |
|---|
| | 227 | if test "lib$LIBBITSUF" != "lib" ; then |
|---|
| | 228 | libdirs="lib$LIBBITSUF lib" |
|---|
| | 229 | else |
|---|
| | 230 | libdirs="lib" |
|---|
| | 231 | fi |
|---|
| | 232 | |
|---|
| | 233 | DPP_LANG_SAVE |
|---|
| | 234 | DPP_LANG_CPLUSPLUS |
|---|
| | 235 | |
|---|
| | 236 | testBoostProgramOptions ( ) |
|---|
| | 237 | { |
|---|
| | 238 | libname="$1" |
|---|
| | 239 | orig_LIBS="$2" |
|---|
| | 240 | |
|---|
| | 241 | # NOTE: We do not need $ABI_FLAGS in $LDFLAGS since $CXXFLAGS and $LDFLAGS |
|---|
| | 242 | # are used together by AC_TRY_LINK(). |
|---|
| | 243 | LIBS="-l$libname $orig_LIBS" |
|---|
| | 244 | |
|---|
| | 245 | AC_MSG_CHECKING([for boost::program_options::options_description() in $libname in $cur_boost_libdir]) |
|---|
| | 246 | AC_TRY_LINK([#include <boost/program_options.hpp>], |
|---|
| | 247 | [boost::program_options::options_description desc("Allowed options");desc.add_options()("help", "help");], |
|---|
| | 248 | [vrj_have_boost_po='yes'], [vrj_have_boost_po='no']) |
|---|
| | 249 | rm -rf ./ii_files |
|---|
| | 250 | AC_MSG_RESULT([$vrj_have_boost_po]) |
|---|
| | 251 | |
|---|
| | 252 | LIBS="$orig_LIBS" |
|---|
| | 253 | } |
|---|
| | 254 | |
|---|
| | 255 | for l in $libdirs ; do |
|---|
| | 256 | cur_boost_libdir="$BOOST_ROOT/$l" |
|---|
| | 257 | LDFLAGS="-L$cur_boost_libdir $vrjsave_LDFLAGS" |
|---|
| | 258 | |
|---|
| | 259 | if test "x$boost_po_name" != "x" ; then |
|---|
| | 260 | testBoostProgramOptions $boost_po_name $vrjsave_LIBS |
|---|
| | 261 | else |
|---|
| | 262 | # The extra empty string is to allow for no suffix to be used on the |
|---|
| | 263 | # boost_program_options library name. |
|---|
| | 264 | for s in $boost_suffixes "" ; do |
|---|
| | 265 | cur_boost_po_name="boost_program_options$s" |
|---|
| | 266 | |
|---|
| | 267 | testBoostProgramOptions $cur_boost_po_name $vrjsave_LIBS |
|---|
| | 268 | |
|---|
| | 269 | if test "$vrj_have_boost_po" = "yes" ; then |
|---|
| | 270 | boost_po_name="$cur_boost_po_name" |
|---|
| | 271 | break |
|---|
| | 272 | fi |
|---|
| | 273 | done |
|---|
| | 274 | fi |
|---|
| | 275 | |
|---|
| | 276 | if test "$vrj_have_boost_po" = "yes" ; then |
|---|
| | 277 | BOOST_LIBDIR="$cur_boost_libdir" |
|---|
| | 278 | break |
|---|
| | 279 | fi |
|---|
| | 280 | done |
|---|
| | 281 | |
|---|
| | 282 | if test "x$vrj_have_boost_po" != "xyes" ; then |
|---|
| | 283 | AC_MSG_ERROR([*** Boost.program_options required by VR Juggler ***]) |
|---|
| | 284 | fi |
|---|
| | 285 | |
|---|
| | 286 | DPP_LANG_RESTORE |
|---|
| | 287 | |
|---|
| | 288 | CXXFLAGS="$vrjsave_CXXFLAGS" |
|---|
| | 289 | CPPFLAGS="$vrjsave_CPPFLAGS" |
|---|
| | 290 | LIBS="$vrjsave_LIBS" |
|---|
| | 291 | LDFLAGS="$vrjsave_LDFLAGS" |
|---|
| | 292 | |
|---|