From: <br...@us...> - 2009-10-22 05:06:36
|
Revision: 4008 http://openvrml.svn.sourceforge.net/openvrml/?rev=4008&view=rev Author: braden Date: 2009-10-22 05:06:27 +0000 (Thu, 22 Oct 2009) Log Message: ----------- Use boost::filesystem::path when setting the search path for libjvm. Modified Paths: -------------- trunk/ChangeLog trunk/src/script/java.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-10-22 04:45:26 UTC (rev 4007) +++ trunk/ChangeLog 2009-10-22 05:06:27 UTC (rev 4008) @@ -1,5 +1,17 @@ 2009-10-22 Braden McDaniel <br...@en...> + Use boost::filesystem::path when setting the search path for + libjvm. + + * src/script/java.cpp + (prepend_jre_home_libdirs_to_searchpath(const + boost::filesystem::path &)): Changed to take a + boost::filesystem::path. + (load_libjvm::load_libjvm()): Pass a boost::filesystem::path to + prepend_jre_home_libdirs_to_searchpath. + +2009-10-22 Braden McDaniel <br...@en...> + Prefer JRE_HOME to locate libjvm rather than JAVA_HOME. * configure.ac: Use JRE_HOME instead of JAVA_HOME. Modified: trunk/src/script/java.cpp =================================================================== --- trunk/src/script/java.cpp 2009-10-22 04:45:26 UTC (rev 4007) +++ trunk/src/script/java.cpp 2009-10-22 05:06:27 UTC (rev 4008) @@ -114,36 +114,29 @@ OPENVRML_JAVA_LOCAL int - prepend_jre_home_libdirs_to_searchpath(const std::string & jre_home) + prepend_jre_home_libdirs_to_searchpath( + const boost::filesystem::path & jre_home) { assert(!jre_home.empty()); - using std::ostringstream; + using boost::filesystem::path; using namespace openvrml::local; - static const ostringstream::iostate exceptions = ostringstream::eofbit - | ostringstream::failbit - | ostringstream::badbit; + const path archdir = jre_home / "lib" / OPENVRML_JVM_ARCH; int result = 0; - { - ostringstream libdir; - libdir.exceptions(exceptions); - libdir << jre_home << "/lib/" << OPENVRML_JVM_ARCH << "/client"; - result = dl::prepend_to_searchpath(libdir.str().c_str()); - if (result != 0) { return result; } - } - { - ostringstream libdir; - libdir.exceptions(exceptions); - libdir << jre_home << "/lib/" << OPENVRML_JVM_ARCH << "/server"; - result = dl::prepend_to_searchpath(libdir.str().c_str()); - if (result != 0) { return result; } - } + + result = dl::prepend_to_searchpath(archdir / "client"); + if (result != 0) { return result; } + + result = dl::prepend_to_searchpath(archdir / "server"); + if (result != 0) { return result; } + return result; } load_libjvm::load_libjvm() { + using boost::filesystem::path; using namespace openvrml::local; int result = dl::init(); @@ -151,7 +144,7 @@ std::cerr << dl::error() << std::endl; return; } - const std::string jre_home = JRE_HOME; + const path jre_home = JRE_HOME; if (!jre_home.empty()) { result = prepend_jre_home_libdirs_to_searchpath(jre_home); if (result != 0) { @@ -172,10 +165,9 @@ // const char * const java_home_env = getenv("JAVA_HOME"); if (java_home_env) { - using boost::filesystem::path; result = prepend_jre_home_libdirs_to_searchpath( - (path(java_home_env) / "jre").string()); + path(java_home_env) / "jre"); if (result != 0) { std::cerr << dl::error() << std::endl; return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |