Commit 9537f29b authored by jan.koester's avatar jan.koester
Browse files

bsd changes

parent 00c700d1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@ find_package(OpenLDAP)
find_package(Hiredis REQUIRED)
find_package(libsecureid REQUIRED)
find_package(Brotli REQUIRED)
find_package(MbedTLS REQUIRED)
find_package(libcmdplus REQUIRED)
find_package(libconfplus REQUIRED)

include_directories(
    ${NETPLUS_INCLUDE_DIRS}
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ if(${gameinfoplus_FOUND})
    add_library(gamestatus SHARED gameinfo.cpp)

    target_include_directories(gamestatus PUBLIC ${gameinfoplus_INCLUDE_DIR})
    target_link_libraries(gamestatus dl blogidev  ${gameinfoplus_LIBRARIES})
    target_link_libraries(gamestatus dl blogidev Upstream::gameinfoplus)

    install (TARGETS gamestatus  DESTINATION lib/blogi/plugins)
endif()
+3 −3
Original line number Diff line number Diff line
@@ -101,9 +101,9 @@ namespace blogi {

            long psize;
            if((psize=sysconf(_SC_PAGESIZE))>0){
                char ab[512];
                snprintf(ab,512,"%ld/%ld MB",(sysconf(_SC_AVPHYS_PAGES)*psize)/(1048576),((sysconf(_SC_PHYS_PAGES)*psize)/1048576));
                htmltable << libhtmlpp::HtmlTable::Row() << "Arbeitspeicher: " <<  ab;
                //char ab[512];
                //snprintf(ab,512,"%ld/%ld MB",(sysconf(_SC_AVPHYS_PAGES)*psize)/(1048576),((sysconf(_SC_PHYS_PAGES)*psize)/1048576));
                //htmltable << libhtmlpp::HtmlTable::Row() << "Arbeitspeicher: " <<  ab;
            }
            libhtmlpp::HtmlElement table;
            htmltable.insert(&table);
+12 −7
Original line number Diff line number Diff line
find_path(LIBUUID_INCLUDE_DIR uuid.h PATH_SUFFIXES uuid)
find_library(LIBUUID_LIBRARY libuuid.so)

include_directories(${LIBUUID_INCLUDE_DIR})

add_definitions(
    -DSQLITE_THREADSAFE=2
)
@@ -15,17 +20,17 @@ add_library(blogidev STATIC
)

target_link_libraries(blogidev
    htmlpp
    httppp
    netplus
    uuid
    secureid
    cmdplus
    htmlpp::htmlpp
    Upstream::httppp
    netplus::netplus
    Upstream::secureid
    cmdplus::cmdplus
    ${LIBUUID_LIBRARY}
    ${PostgreSQL_LIBRARIES}
    ${SQLite3_LIBRARIES}
    ${OPENLDAP_LIBRARIES}
    ${BROTLI_LIBRARIES}
    confplus
    Upstream::confplus
)

target_compile_options(blogidev PUBLIC "-fPIC")
+8 −8
Original line number Diff line number Diff line
@@ -87,18 +87,18 @@ void blogi::Plugin::loadPlugins(const char *path,PluginArgs *args){
                ppath.append(direntStruct->d_name);

                PluginData *ldplg=new PluginData();

                const char * dlsym_error=nullptr;                
                ldplg->pldata = dlopen(ppath.c_str(),RTLD_LAZY);
                if (!ldplg->pldata) {
                    delete ldplg;
                    libhttppp::HTTPException err;
                    err[libhttppp::HTTPException::Error] << "Cannot load library";

                if (!ldplg->pldata && (dlsym_error=dlerror()) ){
                        delete ldplg; libhttppp::HTTPException err; 
                        err[libhttppp::HTTPException::Error] << "Cannot load library: " << dlsym_error; 
                        throw err;
                }

                // load the symbols
                create_t* create_plugin= (create_t*) dlsym(ldplg->pldata, "create");
                const char* dlsym_error = dlerror();
                if (dlsym_error) {
                if ( !ldplg->pldata && (dlsym_error=dlerror()) ) {
                    delete ldplg;
                    libhttppp::HTTPException err;
                    err[libhttppp::HTTPException::Error]  << "Cannot load symbol create: " << dlsym_error << '\n';