Exemple #1
0
co::ConnectionPtr _startLocalServer()
{
    Strings dirNames;
    dirNames.push_back( "" );
    dirNames.push_back( "./" );
// Add path of current .so so search paths for EqualizerServer    
#ifndef _WIN32
    Dl_info dl_info;
    dladdr((void *)_startLocalServer, &dl_info);
    
    char libPath[1024];
    strncpy(libPath, dl_info.dli_fname, 1024);
    char* k = strrchr(libPath, '/');
    *(k + 1) = '\0';
    dirNames.push_back( libPath );
#endif
#ifdef EQ_BUILD_DIR
#ifdef NDEBUG
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "libs/server/Release/" );
#else
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "libs/server/Debug/" );
#endif
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "libs/server/" );
#endif

#ifdef _MSC_VER
    const std::string libName = "EqualizerServer.dll";
#elif defined (_WIN32)
    const std::string libName = "libEqualizerServer.dll";
#elif defined (Darwin)
    const std::string libName = "libEqualizerServer.dylib";
#else
    const std::string libName = "libEqualizerServer.so";
#endif

    while( !_libeqserver.isOpen() && !dirNames.empty( ))
    {
        _libeqserver.open( dirNames.back() + libName );
        dirNames.pop_back();
    }

    if( !_libeqserver.isOpen( ))
    {
        EQWARN << "Can't open Equalizer server library" << std::endl;
        return 0;
    }

    eqsStartLocalServer_t eqsStartLocalServer = (eqsStartLocalServer_t)
        _libeqserver.getFunctionPointer( "eqsStartLocalServer" );

    if( !eqsStartLocalServer )
    {
        EQWARN << "Can't find server entry function eqsStartLocalServer"
               << std::endl;
        return 0;
    }

    return eqsStartLocalServer( Global::getConfigFile( ));
}
Exemple #2
0
co::ConnectionPtr _startLocalServer()
{
    Strings dirNames;
    dirNames.push_back( "" );

#ifdef EQ_BUILD_DIR
#ifdef NDEBUG
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "lib/Release/" );
#else
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "lib/Debug/" );
#endif
    dirNames.push_back( std::string( EQ_BUILD_DIR ) + "lib/" );
#endif

#ifdef _MSC_VER
    const std::string libName = "EqualizerServer.dll";
#elif defined (_WIN32)
    const std::string libName = "libEqualizerServer.dll";
#elif defined (Darwin)
    const std::string libName = "libEqualizerServer.dylib";
#else
    const std::string libName = "libEqualizerServer.so";
#endif

    while( !_libeqserver.isOpen() && !dirNames.empty( ))
    {
        _libeqserver.open( dirNames.back() + libName );
        dirNames.pop_back();
    }

    if( !_libeqserver.isOpen( ))
    {
        LBWARN << "Can't open Equalizer server library" << std::endl;
        return 0;
    }

    eqsStartLocalServer_t eqsStartLocalServer = (eqsStartLocalServer_t)
        _libeqserver.getFunctionPointer( "eqsStartLocalServer" );

    if( !eqsStartLocalServer )
    {
        LBWARN << "Can't find server entry function eqsStartLocalServer"
               << std::endl;
        return 0;
    }

    return eqsStartLocalServer( Global::getConfigFile( ));
}