1 --- arts-1.5.5/mcop/Makefile.am.orig 2005-09-10 10:13:32.000000000 +0200
2 +++ arts-1.5.5/mcop/Makefile.am 2007-01-05 21:47:58.212920750 +0100
4 trader_impl.cc dynamicrequest.cc anyref.cc loopback.cc \
5 delayedreturn.cc thread.cc dynamicskeleton.cc
7 +CXXFLAGS += -fexceptions
8 libmcop_la_LIBADD = $(LIBSOCKET) $(GLIB_LIBADD) $(top_builddir)/libltdl/libltdlc.la
9 +libmcop_la_LIBADD += -lboost_filesystem -lboost_regex
10 libmcop_la_LDFLAGS = -no-undefined -version-info 1:0 $(GLIB_LDFLAGS) $(all_libraries)
12 artsincludedir = $(includedir)/arts
13 --- arts-1.5.5/mcop/extensionloader.cc.orig 2005-09-10 10:13:32.000000000 +0200
14 +++ arts-1.5.5/mcop/extensionloader.cc 2007-01-05 22:36:03.034272500 +0100
19 +#include <boost/filesystem/exception.hpp>
20 +#include <boost/filesystem/operations.hpp>
21 +#include <boost/regex.hpp>
26 +static std::string makeLibraryName( std::string const& dir, std::string const& name )
30 + std::string p = dir + "/" + name;
31 + if ( boost::filesystem::exists( p + ".so" ) )
32 + return ( p + ".so" );
33 + boost::regex re( p + "(-.+){0,1}\\..+", boost::regex::extended );
34 + for ( boost::filesystem::directory_iterator i( dir );
35 + i != boost::filesystem::directory_iterator(); ++i )
38 + if ( boost::regex_match( i->string(), m, re ) )
41 + return ( p + ".la" );
43 + catch ( boost::filesystem::filesystem_error const& )
46 + return std::string();
49 ExtensionLoader::ExtensionLoader(const string& filename) :handle(0)
53 assert(filename.size());
54 - if(filename[0] == '/')
55 - dlfilename = filename;
59 + boost::filesystem::path p( filename );
60 + if ( p.has_root_directory() )
61 + dlfilename = makeLibraryName( p.branch_path().string(), p.leaf() );
63 + catch ( boost::filesystem::filesystem_error const& )
66 + if ( dlfilename.empty() )
68 const vector<string> *path = MCOPUtils::extensionPath();
70 vector<string>::const_iterator pi;
71 for(pi = path->begin(); pi != path->end(); pi++)
73 - dlfilename = *pi + "/" + filename;
75 - if(access(dlfilename.c_str(),F_OK) == 0)
76 + dlfilename = makeLibraryName( *pi, filename );
77 + if ( !dlfilename.empty() && ( access( dlfilename.c_str(), F_OK ) == 0 ) )