diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-05-07 03:36:45 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-05-07 03:36:45 +0200 |
commit | c7b651a6ca408afe6dbf22e782fa1b3bca8468d0 (patch) | |
tree | b82b2222f7b154fe15054e224c4f942c2e1efea2 | |
parent | 44ad33926031a2aae1c515488fc2eded94fd6c8f (diff) | |
download | tdelibs-c7b651a6ca408afe6dbf22e782fa1b3bca8468d0.tar.gz tdelibs-c7b651a6ca408afe6dbf22e782fa1b3bca8468d0.zip |
Build tdehw library as a standalone library.
This causes tdecore API change!
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | tdecore/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tdecore/kinstance.cpp | 42 | ||||
-rw-r--r-- | tdecore/tdehw/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 7 | ||||
-rw-r--r-- | tdecore/tdehw/tdenetworkconnections.cpp | 7 |
5 files changed, 52 insertions, 15 deletions
diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index eed7dee58..22c3bbc88 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -17,7 +17,6 @@ add_subdirectory( tests ) if( WITH_TDEHWLIB ) add_subdirectory( tdehw ) set( TDEHW_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tdehw ) - set( TDEHW_LIB tdehw-static ) endif( WITH_TDEHWLIB ) if( WITH_LIBART ) @@ -140,8 +139,8 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} - VERSION 14.0.0 - EMBED tdecorenetwork-static ${TDEHW_LIB} + VERSION 14.1.0 + EMBED tdecorenetwork-static LINK DCOP-shared tdefx-shared ICE SM ${ZLIB_LIBRARIES} LINK_PRIVATE ltdlc-static ${KDESVGICONS} ${XCOMPOSITE_LIBRARIES} ${LIBIDN_LIBRARIES} ${LIBBFD_LIBRARIES} ${LIB_UTIL} ${GAMIN_LIBRARIES} diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index cbdf86783..8ae747948 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -25,6 +25,8 @@ #include "kcharsets.h" #include "kiconloader.h" #ifdef __TDE_HAVE_TDEHWLIB +#include "klibloader.h" +#include "tdeversion.h" #include "tdehardwaredevices.h" #include "tdenetworkconnections.h" #endif @@ -285,22 +287,42 @@ TDEIconLoader *TDEInstance::iconLoader() const #ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *TDEInstance::hardwareDevices() const { - DEBUG_CHECK_ALIVE - if( _hardwaredevices == 0 ) { - _hardwaredevices = new TDEHardwareDevices( ); - } + DEBUG_CHECK_ALIVE + if (_hardwaredevices == 0) + { + TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR); + KLibrary *lib = KLibLoader::self()->library(libName.latin1()); + if (lib) + { + TDEHardwareDevices* (*create)() = (TDEHardwareDevices* (*)())lib->symbol("create_tdeHardwareDevices"); + if (create) + { + _hardwaredevices = create(); + } + } + } - return _hardwaredevices; + return _hardwaredevices; } TDEGlobalNetworkManager *TDEInstance::networkManager() const { - DEBUG_CHECK_ALIVE - if( _networkmanager == 0 ) { - _networkmanager = new TDEGlobalNetworkManager( ); - } + DEBUG_CHECK_ALIVE + if (_networkmanager == 0) + { + TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR); + KLibrary *lib = KLibLoader::self()->library(libName.latin1()); + if (lib) + { + TDEGlobalNetworkManager* (*create)() = (TDEGlobalNetworkManager* (*)())lib->symbol("create_tdeGlobalNetworkManager"); + if (create) + { + _networkmanager = create(); + } + } + } - return _networkmanager; + return _networkmanager; } #endif diff --git a/tdecore/tdehw/CMakeLists.txt b/tdecore/tdehw/CMakeLists.txt index 737d0557c..d314b055f 100644 --- a/tdecore/tdehw/CMakeLists.txt +++ b/tdecore/tdehw/CMakeLists.txt @@ -124,7 +124,9 @@ set( ${target}_SRCS disksHelper.cpp ) -tde_add_library( ${target} STATIC_PIC AUTOMOC +tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} - LINK udev ${TDENM_LIBRARIES} ${TDEUPOWER_LIBRARIES} ${TDEHW_CUSTOM_LIBRARIES} + VERSION 14.1.0 + LINK_PRIVATE udev tdecore-shared ${TDENM_LIBRARIES} ${TDEUPOWER_LIBRARIES} ${TDEHW_CUSTOM_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 28a0f44d2..441db942d 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -119,6 +119,13 @@ unsigned int reverse_bits(unsigned int x) // Helper function implemented in tdestoragedevice.cpp TQString decodeHexEncoding(TQString str); +extern "C" { + KDE_EXPORT TDEHardwareDevices* create_tdeHardwareDevices() + { + return new TDEHardwareDevices(); + } +} + TDEHardwareDevices::TDEHardwareDevices() { // Initialize members pci_id_map = 0; diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp index 2961c8737..0cf1823a1 100644 --- a/tdecore/tdehw/tdenetworkconnections.cpp +++ b/tdecore/tdehw/tdenetworkconnections.cpp @@ -40,6 +40,13 @@ /* TDENetworkSearchDomain */ /*================================================================================================*/ +extern "C" { + KDE_EXPORT TDEGlobalNetworkManager* create_tdeGlobalNetworkManager() + { + return new TDEGlobalNetworkManager(); + } +} + TDENetworkSearchDomain::TDENetworkSearchDomain() { m_isIPV6 = false; } |