Changeset 19948

Show
Ignore:
Timestamp:
04/18/07 11:04:08 (2 years ago)
Author:
aronb
Message:

Add dependancy on boost.program_options.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vrjuggler/Makefile.inc.in

    r19729 r19948  
    4141srcdir=         @srcdir@ 
    4242top_srcdir=     @top_srcdir@ 
     43 
     44BOOST_VERSION=  @BOOST_VERSION_DOT@ 
    4345 
    4446# Extra compiler and linker options needed only by this file. 
     
    564566          $(topdir)/vrjuggler.fpc                                       \ 
    565567          $(libdir)$(LIBBITSUF)/flagpoll/vrjuggler-$(VERSION_DOT).$(PLATFORM).$(ISA).fpc 
     568        $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX)                   \ 
     569          $(topdir)/boost_program_options.fpc                           \ 
     570          $(libdir)$(LIBBITSUF)/flagpoll/boost_program_options-$(BOOST_VERSION).$(ISA).fpc 
    566571 
    567572# ============================================================================= 
  • juggler/trunk/modules/vrjuggler/configure.ac

    r19944 r19948  
    7777# --with-pkg[=arg] and --without-pkg arguments # 
    7878# -------------------------------------------- # 
     79AC_ARG_WITH([boost-po-lib], 
     80            [  --with-boost-po-lib=<LIB NAME> 
     81                          The name of the Boost.program_options 
     82                          library suitable for the -l 
     83                          compiler option                 [default=Auto-detect]], 
     84            [given_boost_po_libname="$withval"], [given_boost_po_libname='']) 
    7985 
    8086# Force the use of GCC as the compiler. 
     
    158164               [AC_MSG_ERROR(*** Gadgeteer required for VR Juggler ***)]) 
    159165SNX_PATH([1.1.4], , [AC_MSG_ERROR(*** Sonix required for VR Juggler ***)]) 
     166 
     167# Build up the possible Boost library suffix names. These will be stored in 
     168# $boost_suffixes and used later as necessary. 
     169case $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      ;; 
     197esac 
     198 
     199# A correct installation of Boost on Darwin does not include the toolset name 
     200# as part of the library file name. 
     201if test "x$PLATFORM" = "xDarwin" ; then 
     202   toolset='' 
     203   threading='' 
     204else 
     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 
     210fi 
     211 
     212boost_suffixes="$toolset$threading-$BOOST_LIB_VERSION $toolset$threading $threading" 
     213 
     214if test "x$given_boost_po_libname" != "x" ; then 
     215   boost_po_name="$given_boost_po_libname" 
     216fi 
     217 
     218# Ensure that a compiled version of the Boost.program_options library is available. 
     219vrjsave_CXXFLAGS="$CXXFLAGS" 
     220vrjsave_CPPFLAGS="$CPPFLAGS" 
     221vrjsave_LIBS="$LIBS" 
     222vrjsave_LDFLAGS="$LDFLAGS" 
     223 
     224CXXFLAGS="$CXXFLAGS $ABI_FLAGS" 
     225CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES" 
     226 
     227if test "lib$LIBBITSUF" != "lib" ; then 
     228   libdirs="lib$LIBBITSUF lib" 
     229else 
     230   libdirs="lib" 
     231fi 
     232 
     233DPP_LANG_SAVE 
     234DPP_LANG_CPLUSPLUS 
     235 
     236testBoostProgramOptions ( ) 
     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 
     255for 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 
     280done 
     281 
     282if test "x$vrj_have_boost_po" != "xyes" ; then 
     283   AC_MSG_ERROR([*** Boost.program_options required by VR Juggler ***]) 
     284fi 
     285 
     286DPP_LANG_RESTORE 
     287 
     288CXXFLAGS="$vrjsave_CXXFLAGS" 
     289CPPFLAGS="$vrjsave_CPPFLAGS" 
     290LIBS="$vrjsave_LIBS" 
     291LDFLAGS="$vrjsave_LDFLAGS" 
     292 
    160293 
    161294VRJ_USE_X11="$GADGET_USE_X11" 
     
    272405AC_CHECK_HEADERS([ext/functional]) 
    273406DPP_LANG_RESTORE 
     407 
     408DPP_HAVE_BOOST([1.31.0], [/usr/local], , , 
     409               [AC_MSG_ERROR([*** Boost is required for VR Juggler ***])]) 
     410BOOST_VERSION_DOT="$dpp_boost_version" 
    274411 
    275412# ----------------------------------------------------------------------------- 
     
    439576 
    440577if test "$OS_TYPE" = "UNIX" ; then 
    441     REQ_EXTRA_LIBS="$LDFLAGS $SNX_LIBS $GADGET_LIBS -lm
     578    REQ_EXTRA_LIBS="$LDFLAGS $SNX_LIBS $GADGET_LIBS -lm -l$boost_po_name
    442579    DYLIB_DEPS_VJ="$REQ_EXTRA_LIBS" 
    443580    DYLIB_DEPS_GL="$REQ_EXTRA_LIBS" 
     
    452589    fi 
    453590 
    454     REQ_EXTRA_PROF_LIBS="$LDFLAGS $SNX_PROF_LIBS $GADGET_PROF_LIBS $LIBS -lm
     591    REQ_EXTRA_PROF_LIBS="$LDFLAGS $SNX_PROF_LIBS $GADGET_PROF_LIBS $LIBS -lm -l$boost_po_name
    455592    DYLIB_PROF_DEPS_VJ="$REQ_EXTRA_PROF_LIBS" 
    456593    DYLIB_PROF_DEPS_GL="-L\$(LIBDIR) -l$vrj_prof_lib_name $OGL_LDFLAGS $LIBOPENGL $REQ_EXTRA_PROF_LIBS" 
     
    693830AC_SUBST(vrj_pf_extra_libs) 
    694831 
     832AC_SUBST(BOOST_VERSION_DOT) 
     833AC_SUBST(boost_po_name) 
     834 
    695835AC_SUBST(tweek_java_api_jars_bundle) 
    696836AC_SUBST(tweek_ext_java_api_jars_bundle) 
     
    704844AC_CONFIG_FILES([ 
    705845   vrjuggler.fpc 
     846   boost_program_options.fpc 
    706847   Makefile 
    707848   Makefile.inc