| 1 | # |
|---|
| 2 | # the following variables contain our macro definitions: |
|---|
| 3 | # |
|---|
| 4 | required_defs="" |
|---|
| 5 | required_undefs="" |
|---|
| 6 | |
|---|
| 7 | dnl Process this file with autoconf to produce a configure script. |
|---|
| 8 | dnl disable cache processing, it has no effect here: |
|---|
| 9 | define([AC_CACHE_LOAD], )dnl |
|---|
| 10 | define([AC_CACHE_SAVE], )dnl |
|---|
| 11 | AC_INIT(./tools/configure.in) |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | AC_ARG_ENABLE(test, --enable-test tests current settings rather than defining new ones) |
|---|
| 15 | |
|---|
| 16 | if test "foo"$enable_test = "foo"; then |
|---|
| 17 | enable_test="no" |
|---|
| 18 | fi |
|---|
| 19 | |
|---|
| 20 | cat << EOF |
|---|
| 21 | *** $0: boost configuration utility *** |
|---|
| 22 | |
|---|
| 23 | Please stand by while exploring compiler capabilities... |
|---|
| 24 | Be patient - this could take some time... |
|---|
| 25 | |
|---|
| 26 | Note that this test script only gives an approximate |
|---|
| 27 | configuration - you will need to test the results carefully |
|---|
| 28 | using the boost regression test suite before using the results. |
|---|
| 29 | EOF |
|---|
| 30 | |
|---|
| 31 | if test $enable_test = 'yes'; then |
|---|
| 32 | |
|---|
| 33 | cat << EOF |
|---|
| 34 | |
|---|
| 35 | This script reports only the difference between the detected |
|---|
| 36 | configuration, and the existing boost configuration. Its |
|---|
| 37 | primary aim is to quickly report how well boost is configured |
|---|
| 38 | for one compiler. |
|---|
| 39 | |
|---|
| 40 | *** |
|---|
| 41 | |
|---|
| 42 | EOF |
|---|
| 43 | |
|---|
| 44 | else |
|---|
| 45 | |
|---|
| 46 | cat << EOF |
|---|
| 47 | |
|---|
| 48 | *** |
|---|
| 49 | |
|---|
| 50 | EOF |
|---|
| 51 | fi |
|---|
| 52 | |
|---|
| 53 | AC_ARG_ENABLE(extension,[--enable-extension=<ext>], |
|---|
| 54 | [ |
|---|
| 55 | case "$enableval" in |
|---|
| 56 | no) AC_MSG_RESULT(Info :.cpp used as extension for tests) |
|---|
| 57 | ac_ext=cpp |
|---|
| 58 | ;; |
|---|
| 59 | *) AC_MSG_RESULT(Argument : .$enableval used as extension) |
|---|
| 60 | ac_ext=$enableval |
|---|
| 61 | esac |
|---|
| 62 | ], |
|---|
| 63 | [AC_MSG_RESULT(Info : .cpp used as extension for tests) |
|---|
| 64 | ac_ext=cpp |
|---|
| 65 | ] |
|---|
| 66 | ) |
|---|
| 67 | |
|---|
| 68 | dnl figure out which version of sed to use, on some platforms |
|---|
| 69 | dnl the version in the path is not Unix conforming (MacOS X ? ) |
|---|
| 70 | |
|---|
| 71 | if test -f /bin/sed ; then |
|---|
| 72 | SED=/bin/sed |
|---|
| 73 | else |
|---|
| 74 | if test -f /usr/bin/sed ; then |
|---|
| 75 | SED=/usr/bin/sed |
|---|
| 76 | else |
|---|
| 77 | SED=sed |
|---|
| 78 | fi |
|---|
| 79 | fi |
|---|
| 80 | |
|---|
| 81 | dnl Set the boost main directory. |
|---|
| 82 | AC_MSG_CHECKING(for boost main tree) |
|---|
| 83 | boost_base= |
|---|
| 84 | AC_ARG_WITH(boost, |
|---|
| 85 | AC_HELP_STRING([--with-boost=DIR],[path to the boost main tree]), |
|---|
| 86 | [ |
|---|
| 87 | #echo "--with boost is set" |
|---|
| 88 | if test "x$withval" != "x"; then |
|---|
| 89 | if test "x$withval" != no; then |
|---|
| 90 | boost_base=`echo "$withval" | $SED 's,//*,/,g' | $SED 's,/$,,'` |
|---|
| 91 | #echo boost_base=$boost_base |
|---|
| 92 | if test -f "$boost_base/boost/config.hpp"; then |
|---|
| 93 | if test -f "$boost_base/libs/config/configure"; then :; else |
|---|
| 94 | boost_base= |
|---|
| 95 | #echo "$boost_base/libs/config/configure" not found |
|---|
| 96 | fi |
|---|
| 97 | else |
|---|
| 98 | #echo "$boost_base/boost/config.hpp" not found |
|---|
| 99 | boost_base= |
|---|
| 100 | fi |
|---|
| 101 | fi |
|---|
| 102 | fi |
|---|
| 103 | ] |
|---|
| 104 | ) |
|---|
| 105 | if test "x$boost_base" = "x"; then |
|---|
| 106 | #echo '$0 = ' $0 |
|---|
| 107 | boost_base=`expr "x$0" : 'x\(.*\)/@<:@/@:>@*' \| '.'` |
|---|
| 108 | boost_base="$boost_base/../.." |
|---|
| 109 | #echo boost_base=$boost_base |
|---|
| 110 | if test -f "$boost_base/boost/config.hpp"; then |
|---|
| 111 | if test -f "$boost_base/libs/config/configure"; then :; else |
|---|
| 112 | boost_base= |
|---|
| 113 | fi |
|---|
| 114 | else |
|---|
| 115 | boost_base= |
|---|
| 116 | fi |
|---|
| 117 | fi |
|---|
| 118 | if test "x$boost_base" != "x"; then |
|---|
| 119 | AC_MSG_RESULT([$boost_base]) |
|---|
| 120 | else |
|---|
| 121 | AC_MSG_RESULT([not found]) |
|---|
| 122 | AC_MSG_ERROR([The boost main tree was not found. |
|---|
| 123 | Specify its location by the --with-boost option.]) |
|---|
| 124 | fi |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | # Save that, as it is being redefined several times |
|---|
| 129 | use_ac_ext=$ac_ext |
|---|
| 130 | |
|---|
| 131 | AC_PROG_CXX |
|---|
| 132 | ac_ext=$use_ac_ext |
|---|
| 133 | |
|---|
| 134 | AC_LANG_CPLUSPLUS |
|---|
| 135 | |
|---|
| 136 | OLD_CXXFLAGS="$CXXFLAGS" |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | if test $enable_test = 'yes'; then |
|---|
| 140 | CXXFLAGS="-I$boost_base -I$boost_base/libs/config/test $CXXFLAGS" |
|---|
| 141 | else |
|---|
| 142 | CXXFLAGS="-I$boost_base -I$boost_base/libs/config/test $CXXFLAGS -DBOOST_NO_CONFIG" |
|---|
| 143 | fi |
|---|
| 144 | |
|---|
| 145 | # add the -AA conformance option to CXXFLAGS for HP aCC only |
|---|
| 146 | if test $CXX = 'aCC'; then |
|---|
| 147 | CXXFLAGS="-AA $CXXFLAGS" |
|---|
| 148 | fi |
|---|
| 149 | |
|---|
| 150 | dnl check for some standard libraries |
|---|
| 151 | dnl without these some of the tests may fail: |
|---|
| 152 | |
|---|
| 153 | AC_CHECK_LIB(pthread, pthread_exit) |
|---|
| 154 | AC_CHECK_LIB(m, cos) |
|---|
| 155 | AC_CHECK_LIB(rt, clock) |
|---|
| 156 | |
|---|
| 157 | # |
|---|
| 158 | # enumerate test files and test each one: |
|---|
| 159 | # |
|---|
| 160 | for file in $boost_base/libs/config/test/boost_no*.ipp; do |
|---|
| 161 | |
|---|
| 162 | basename=`echo $file | $SED 's/.*boost_\(.*\)\.ipp/\1/'` |
|---|
| 163 | macroname=`cat $file | grep '^//[[ ]]*MACRO:' | $SED 's/.*MACRO:[[ ]]*\([[_A-Z0-9]]*\).*/\1/'` |
|---|
| 164 | title=`cat $file | grep '^//[[ ]]*TITLE:' | $SED 's/.*TITLE:[[ ]]*\([[^ ]].*\)/\1/'` |
|---|
| 165 | namespace=`echo $macroname | tr [[A-Z]] [[a-z]]` |
|---|
| 166 | |
|---|
| 167 | #echo file = $file |
|---|
| 168 | #echo basename = $basename |
|---|
| 169 | #echo macroname = $macroname |
|---|
| 170 | #echo title = $title |
|---|
| 171 | #echo namespace = $namespace |
|---|
| 172 | |
|---|
| 173 | ac_ext=$use_ac_ext |
|---|
| 174 | if test $enable_test = 'yes'; then |
|---|
| 175 | AC_MSG_CHECKING($title (pass expected) ) |
|---|
| 176 | else |
|---|
| 177 | AC_MSG_CHECKING($title ) |
|---|
| 178 | fi |
|---|
| 179 | AC_TRY_RUN( |
|---|
| 180 | [ |
|---|
| 181 | #include <boost/config.hpp> |
|---|
| 182 | #include "test.hpp" |
|---|
| 183 | |
|---|
| 184 | #if !defined($macroname) || defined(BOOST_NO_CONFIG) |
|---|
| 185 | #include "boost_$basename.ipp" |
|---|
| 186 | #else |
|---|
| 187 | namespace ${namespace} = empty_boost; |
|---|
| 188 | #endif |
|---|
| 189 | |
|---|
| 190 | int main(){ return ${namespace}::test(); } ] |
|---|
| 191 | , |
|---|
| 192 | [AC_MSG_RESULT(OK)] |
|---|
| 193 | , |
|---|
| 194 | [AC_MSG_RESULT(Failed) |
|---|
| 195 | required_defs="$macroname $required_defs"] |
|---|
| 196 | ) |
|---|
| 197 | |
|---|
| 198 | if test $enable_test = 'yes'; then |
|---|
| 199 | |
|---|
| 200 | ac_ext=$use_ac_ext |
|---|
| 201 | AC_MSG_CHECKING($title (fail expected) ) |
|---|
| 202 | AC_TRY_RUN( |
|---|
| 203 | [ |
|---|
| 204 | #include <boost/config.hpp> |
|---|
| 205 | #include "test.hpp" |
|---|
| 206 | |
|---|
| 207 | #ifdef $macroname |
|---|
| 208 | #include "boost_$basename.ipp" |
|---|
| 209 | #else |
|---|
| 210 | #error "this file should not compile" |
|---|
| 211 | #endif |
|---|
| 212 | |
|---|
| 213 | int main() { return ${namespace}::test(); }] |
|---|
| 214 | , |
|---|
| 215 | [AC_MSG_RESULT(failed) |
|---|
| 216 | required_undefs="$macroname $required_undefs"] |
|---|
| 217 | , |
|---|
| 218 | [AC_MSG_RESULT(OK)] |
|---|
| 219 | ) |
|---|
| 220 | |
|---|
| 221 | fi |
|---|
| 222 | |
|---|
| 223 | done |
|---|
| 224 | |
|---|
| 225 | # |
|---|
| 226 | # enumerate optional test files and test each one: |
|---|
| 227 | # |
|---|
| 228 | for file in $boost_base/libs/config/test/boost_has*.ipp; do |
|---|
| 229 | |
|---|
| 230 | basename=`echo $file | $SED 's/.*boost_\(.*\)\.ipp/\1/'` |
|---|
| 231 | macroname=`cat $file | grep '^//[[ ]]*MACRO:' | $SED 's/.*MACRO:[[ ]]*\([[_A-Z0-9]]*\).*/\1/'` |
|---|
| 232 | title=`cat $file | grep '^//[[ ]]*TITLE:' | $SED 's/.*TITLE:[[ ]]*\([[^ ]].*\)/\1/'` |
|---|
| 233 | namespace=`echo $macroname | tr [[A-Z]] [[a-z]]` |
|---|
| 234 | |
|---|
| 235 | # echo $file |
|---|
| 236 | # echo $basename |
|---|
| 237 | # echo $macroname |
|---|
| 238 | # echo $title |
|---|
| 239 | |
|---|
| 240 | ac_ext=$use_ac_ext |
|---|
| 241 | if test $enable_test = 'yes'; then |
|---|
| 242 | AC_MSG_CHECKING($title (pass expected) ) |
|---|
| 243 | AC_TRY_RUN( |
|---|
| 244 | [ |
|---|
| 245 | #include <boost/config.hpp> |
|---|
| 246 | #include "test.hpp" |
|---|
| 247 | |
|---|
| 248 | #ifdef $macroname |
|---|
| 249 | #include "boost_$basename.ipp" |
|---|
| 250 | #else |
|---|
| 251 | namespace ${namespace} = empty_boost; |
|---|
| 252 | #endif |
|---|
| 253 | |
|---|
| 254 | int main(){ return ${namespace}::test(); }] |
|---|
| 255 | , |
|---|
| 256 | [AC_MSG_RESULT(OK)] |
|---|
| 257 | , |
|---|
| 258 | [AC_MSG_RESULT(Failed) |
|---|
| 259 | required_undefs="$macroname $required_undefs"] |
|---|
| 260 | ) |
|---|
| 261 | |
|---|
| 262 | AC_MSG_CHECKING($title (fail expected) ) |
|---|
| 263 | AC_TRY_RUN( |
|---|
| 264 | [ |
|---|
| 265 | #include <boost/config.hpp> |
|---|
| 266 | #include "test.hpp" |
|---|
| 267 | |
|---|
| 268 | #ifndef $macroname |
|---|
| 269 | #include "boost_$basename.ipp" |
|---|
| 270 | #else |
|---|
| 271 | #error "this file should not compile" |
|---|
| 272 | #endif |
|---|
| 273 | |
|---|
| 274 | int main(){ return ${namespace}::test(); }] |
|---|
| 275 | , |
|---|
| 276 | [ |
|---|
| 277 | AC_MSG_RESULT(failed) |
|---|
| 278 | required_defs="$macroname $required_defs" |
|---|
| 279 | ] |
|---|
| 280 | , |
|---|
| 281 | [ |
|---|
| 282 | AC_MSG_RESULT(OK) |
|---|
| 283 | ] |
|---|
| 284 | ) |
|---|
| 285 | |
|---|
| 286 | else |
|---|
| 287 | |
|---|
| 288 | ac_ext=$use_ac_ext |
|---|
| 289 | AC_MSG_CHECKING($title) |
|---|
| 290 | AC_TRY_RUN( |
|---|
| 291 | [ |
|---|
| 292 | #include <boost/config.hpp> |
|---|
| 293 | #include "test.hpp" |
|---|
| 294 | |
|---|
| 295 | #include "boost_$basename.ipp" |
|---|
| 296 | |
|---|
| 297 | int main(){ return ${namespace}::test(); }] |
|---|
| 298 | , |
|---|
| 299 | [ |
|---|
| 300 | AC_MSG_RESULT(Yes) |
|---|
| 301 | required_defs="$macroname $required_defs" |
|---|
| 302 | ] |
|---|
| 303 | , |
|---|
| 304 | [ |
|---|
| 305 | AC_MSG_RESULT(no) |
|---|
| 306 | ] |
|---|
| 307 | ) |
|---|
| 308 | |
|---|
| 309 | fi |
|---|
| 310 | |
|---|
| 311 | done |
|---|
| 312 | |
|---|
| 313 | |
|---|
| 314 | #echo $required_defs |
|---|
| 315 | #echo $required_undefs |
|---|
| 316 | |
|---|
| 317 | if test $enable_test = 'yes'; then |
|---|
| 318 | |
|---|
| 319 | if test "$required_defs" = ""; then |
|---|
| 320 | echo no boost macros need to be defined |
|---|
| 321 | echo no boost macros need to be defined >&5 |
|---|
| 322 | else |
|---|
| 323 | echo the following macros need to be defined |
|---|
| 324 | echo $required_defs |
|---|
| 325 | echo the following macros need to be defined >&5 |
|---|
| 326 | echo $required_defs >&5 |
|---|
| 327 | fi |
|---|
| 328 | if test "$required_undefs" = ""; then |
|---|
| 329 | echo no boost macros need to be undefined |
|---|
| 330 | echo no boost macros need to be undefined >&5 |
|---|
| 331 | else |
|---|
| 332 | echo "the following macros need to be undef'ed" |
|---|
| 333 | echo $required_undefs |
|---|
| 334 | echo "the following macros need to be undef'ed" >&5 |
|---|
| 335 | echo $required_undefs >&5 |
|---|
| 336 | fi |
|---|
| 337 | |
|---|
| 338 | else |
|---|
| 339 | |
|---|
| 340 | date_string=`date` |
|---|
| 341 | |
|---|
| 342 | echo boost_base=$boost_base |
|---|
| 343 | |
|---|
| 344 | cat > user.hpp << EOF |
|---|
| 345 | // (C) Copyright Boost.org 2001. |
|---|
| 346 | // Do not check in modified versions of this file, |
|---|
| 347 | // This file may be customised by the end user, but not by boost. |
|---|
| 348 | |
|---|
| 349 | // |
|---|
| 350 | // Use this file to define a site and compiler specific |
|---|
| 351 | // configuration policy, this version was auto-generated by |
|---|
| 352 | // configure on ${date_string} |
|---|
| 353 | // With the following options: |
|---|
| 354 | // CXX = ${CXX} |
|---|
| 355 | // CXXFLAGS = ${CXXFLAGS} |
|---|
| 356 | // LDFLAGS = ${LDFLAGS} |
|---|
| 357 | // LIBS = ${LIBS} |
|---|
| 358 | // |
|---|
| 359 | |
|---|
| 360 | // define this to disable all config options, |
|---|
| 361 | // excluding the user config. Use if your |
|---|
| 362 | // setup is fully ISO complient, and has no |
|---|
| 363 | // useful extentions, or for autoconf generated |
|---|
| 364 | // setups: |
|---|
| 365 | #ifndef BOOST_NO_CONFIG |
|---|
| 366 | # define BOOST_NO_CONFIG |
|---|
| 367 | #endif |
|---|
| 368 | |
|---|
| 369 | |
|---|
| 370 | // define if you want to disable threading support, even |
|---|
| 371 | // when available: |
|---|
| 372 | // #define BOOST_DISABLE_THREADS |
|---|
| 373 | |
|---|
| 374 | // define if you want the regex library to use the C locale |
|---|
| 375 | // even on Win32: |
|---|
| 376 | // #define BOOST_REGEX_USE_C_LOCALE |
|---|
| 377 | |
|---|
| 378 | // define this is you want the regex library to use the C++ |
|---|
| 379 | // locale: |
|---|
| 380 | // #define BOOST_REGEX_USE_CPP_LOCALE |
|---|
| 381 | |
|---|
| 382 | |
|---|
| 383 | // |
|---|
| 384 | // options added by configure: |
|---|
| 385 | // |
|---|
| 386 | EOF |
|---|
| 387 | |
|---|
| 388 | for name in $required_defs; do |
|---|
| 389 | echo '#define '"$name" >> user.hpp |
|---|
| 390 | done |
|---|
| 391 | |
|---|
| 392 | cat_conts=`cat user.hpp` |
|---|
| 393 | |
|---|
| 394 | # |
|---|
| 395 | # post configuration step: |
|---|
| 396 | # |
|---|
| 397 | AC_MSG_CHECKING(original configuration ) |
|---|
| 398 | rm -f conftest$ac_exeext |
|---|
| 399 | $CXX -I$boost_base $OLD_CXXFLAGS -DBOOST_NO_USER_CONFIG -o conftest$ac_exeext $LDFLAGS $boost_base/libs/config/test/config_info.cpp $LIBS >&5 2>&1 |
|---|
| 400 | ./conftest >&5 2>&1 |
|---|
| 401 | AC_MSG_RESULT(done) |
|---|
| 402 | AC_MSG_CHECKING(new configuration ) |
|---|
| 403 | rm -f conftest$ac_exeext |
|---|
| 404 | $CXX -I$boost_base -I$boost_base/libs/config $OLD_CXXFLAGS -DBOOST_USER_CONFIG='"user.hpp"' -o conftest$ac_exeext $LDFLAGS $boost_base/libs/config/test/config_info.cpp $LIBS >&5 2>&1 |
|---|
| 405 | ./conftest >&5 2>&1 |
|---|
| 406 | AC_MSG_RESULT(done) |
|---|
| 407 | |
|---|
| 408 | AC_OUTPUT( |
|---|
| 409 | [], |
|---|
| 410 | [ |
|---|
| 411 | cat > user.hpp << EEEOF |
|---|
| 412 | ${cat_conts} |
|---|
| 413 | EEEOF |
|---|
| 414 | cat << EEEOF |
|---|
| 415 | |
|---|
| 416 | Adjustments to boost configuration have been written to |
|---|
| 417 | user.hpp. Copy this to boost/config/user.hpp to use "as is", |
|---|
| 418 | or define BOOST_SITE_CONFIG to point to its location. |
|---|
| 419 | |
|---|
| 420 | TREAT THIS FILE WITH CARE. |
|---|
| 421 | Autoconf generated options are not infallible! |
|---|
| 422 | |
|---|
| 423 | EEEOF |
|---|
| 424 | ], |
|---|
| 425 | [ |
|---|
| 426 | cat_conts="$cat_conts" |
|---|
| 427 | ] |
|---|
| 428 | ) |
|---|
| 429 | |
|---|
| 430 | fi |
|---|
| 431 | |
|---|
| 432 | |
|---|
| 433 | |
|---|
| 434 | |
|---|
| 435 | |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | |
|---|
| 439 | |
|---|
| 440 | |
|---|
| 441 | |
|---|
| 442 | |
|---|
| 443 | |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | |
|---|
| 450 | |
|---|
| 451 | |
|---|
| 452 | |
|---|
| 453 | |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | |
|---|