Changeset 19443

Show
Ignore:
Timestamp:
11/10/06 09:32:35 (2 years ago)
Author:
patrick
Message:

MFT [rev 19347]: Be smarter about handling 64-bit Boost.Python installations

where the library is in the lib64 subdirectory. Among other
things, this eliminates linker warnings about referencing
libraries in /usr/lib when Boost is installed in /usr.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PyJuggler/branches/1.0/configure.ac

    r19439 r19443  
    323323fi 
    324324 
     325if test "lib$LIBBITSUF" != "lib" ; then 
     326   libdirs="lib$LIBBITSUF lib" 
     327else 
     328   libdirs='lib' 
     329fi 
     330 
    325331LIBS="$LIBS $bpl_link_option $PYTHON_LIB $UTIL_LIB $PYTHON_LIB_DEPS" 
    326 LDFLAGS="$LDFLAGS -L$BOOST_PYTHON_DIR/lib $PYTHON_LDFLAGS" 
    327  
    328 AC_CACHE_CHECK([for boost::python::handle<> in $bpl_link_option], 
    329    ac_cv_boost__python__handle_in_boost_python, 
    330    [AC_TRY_LINK([ 
     332 
     333for l in $libdirs ; do 
     334   cur_bp_libdir="$BOOST_PYTHON_DIR/$l" 
     335   LDFLAGS="-L$cur_bp_libdir $PYTHON_LDFLAGS ${_pyj_save_LDFLAGS}" 
     336 
     337   AC_MSG_CHECKING([for boost::python::handle<> in $bpl_link_option in $cur_bp_libdir]) 
     338   AC_TRY_LINK([ 
    331339#include <boost/python.hpp> 
    332340using namespace boost::python;], 
    333                 [handle<> main_module(borrowed(PyImport_AddModule("__main__")));], 
    334                 [ac_cv_boost__python__handle_in_boost_python='yes' 
    335                  rm -rf ./ii_files], 
    336                 [ac_cv_boost__python__handle_in_boost_python='no'])]) 
     341               [handle<> main_module(borrowed(PyImport_AddModule("__main__")));], 
     342               [pyj_have_bp='yes' 
     343                rm -rf ./ii_files], 
     344               [pyj_have_bp='no']) 
     345   AC_MSG_RESULT([$pyj_have_bp]) 
     346 
     347   if test "x$pyj_have_bp" = "xyes" ; then 
     348      BPL_LIBDIR="$cur_bp_libdir" 
     349      break 
     350   fi 
     351done 
    337352 
    338353DPP_LANG_RESTORE 
     
    342357LDFLAGS="${_pyj_save_LDFLAGS}" 
    343358 
    344 if test "x$ac_cv_boost__python__handle_in_boost_python" = "xyes" ; then 
     359if test "x$pyj_have_bp" = "xyes" ; then 
    345360   if test "x$GXX" = "xyes" ; then 
    346361      BOOST_PYTHON_CXXFLAGS="-ftemplate-depth-256" 
     
    366381   fi 
    367382 
    368    bpl_dir="-L$BOOST_PYTHON_DIR/lib
    369    BOOST_PYTHON_LDFLAGS_OPT="$bpl_dir -l$BOOST_PYTHON_LIB" 
    370    BOOST_PYTHON_LDFLAGS_DBG="$bpl_dir -l$BASE_BP_LIBNAME$boost_debug_suffix$BPL_VER_SUFFIX" 
     383   bpl_ldflags="-L$BPL_LIBDIR
     384   BOOST_PYTHON_LDFLAGS_OPT="$bpl_ldflags -l$BOOST_PYTHON_LIB" 
     385   BOOST_PYTHON_LDFLAGS_DBG="$bpl_ldflags -l$BASE_BP_LIBNAME$boost_debug_suffix$BPL_VER_SUFFIX" 
    371386else 
    372387   AC_MSG_ERROR([*** Boost.Python v2 is required for PyJuggler ***])