diff options
-rw-r--r-- | CMakeLists.txt | 40 | ||||
-rw-r--r-- | config.h.cmake | 14 | ||||
-rw-r--r-- | tdeabc/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tdecore/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tdecore/kdemacros.h.cmake | 1 | ||||
-rw-r--r-- | tdecore/kinstance.cpp | 14 | ||||
-rw-r--r-- | tdecore/kinstance.h | 12 | ||||
-rw-r--r-- | tdecore/tdeglobal.cpp | 4 |
8 files changed, 81 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 52ee5c17c..45f161b0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,8 @@ OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON ) OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) OPTION( WITH_INOTIFY "Enable inotify support for tdeio" ON ) OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) -option( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_ALL_OPTIONS} ) +option( WITH_TDEHWLIB "Enable TDE hwlib globally" ON ) +option( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_TDEHWLIB} ) option( WITH_HAL "Enable HAL support" OFF ) option( WITH_DEVKITPOWER "Enable DeviceKit Power support" OFF ) option( WITH_LOGINDPOWER "Enable Logind/Systemd Power support" OFF ) @@ -455,16 +456,29 @@ if( HAVE_RES_INIT ) endif( HAVE_RES_INIT) set( CMAKE_REQUIRED_LIBRARIES util ) -check_c_source_runs(" - #include <pty.h> - int main(int argc, char* argv) { - int master_fd, slave_fd; - int result; - result = openpty(&master_fd, &slave_fd, 0, 0, 0); - return 0; - }" - HAVE_OPENPTY -) +if( HAVE_PTY_H ) + check_c_source_runs(" + #include <pty.h> + int main(int argc, char* argv) { + int master_fd, slave_fd; + int result; + result = openpty(&master_fd, &slave_fd, 0, 0, 0); + return 0; + }" + HAVE_OPENPTY + ) +elseif( HAVE_UTIL_H ) + check_c_source_runs(" + #include <util.h> + int main(int argc, char* argv) { + int master_fd, slave_fd; + int result; + result = openpty(&master_fd, &slave_fd, 0, 0, 0); + return 0; + }" + HAVE_OPENPTY + ) +endif( ) if( HAVE_OPENPTY ) set( LIB_UTIL util ) endif( ) @@ -493,6 +507,10 @@ set( LTDL_OBJDIR \".\" ) set( KDELIBSUFF "${LIB_SUFFIX}" ) set( kde_socklen_t socklen_t ) +if( WITH_TDEHWLIB ) + set( __TDE_HAVE_TDEHWLIB 1 ) +endif( WITH_TDEHWLIB ) + ##### check for libdl ########################### diff --git a/config.h.cmake b/config.h.cmake index 7dcd1ae1f..b1e4eb30a 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -389,7 +389,7 @@ #cmakedefine HAVE_MEMORY_H 1 /* Define if you want MIT-SHM support */ -#undef HAVE_MITSHM +#cmakedefine HAVE_MITSHM @HAVE_MITSHM@ /* Define if you have mkdtemp */ #cmakedefine HAVE_MKDTEMP 1 @@ -822,13 +822,13 @@ /* Define to the name of the environment variable that determines the dynamic library search path. */ -#undef LTDL_SHLIBPATH_VAR +#cmakedefine LTDL_SHLIBPATH_VAR "@LTDL_SHLIBPATH_VAR@" /* Define to the extension used for shared libraries, say, ".so". */ #undef LTDL_SHLIB_EXT /* Define to the system default library search path. */ -#undef LTDL_SYSSEARCHPATH +#cmakedefine LTDL_SYSSEARCHPATH "@LTDL_SYSSEARCHPATH@" /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -927,10 +927,10 @@ #endif /* where rgb.txt is in */ -#undef X11_RGBFILE +#cmakedefine X11_RGBFILE "@X11_RGBFILE@" /* Defines the executable of xmllint */ -#undef XMLLINT +#cmakedefine XMLLINT "@XMLLINT@" /* Defined if your system has XRandR support */ #cmakedefine XRANDR_SUPPORT 1 @@ -1189,10 +1189,10 @@ int snprintf(char *str, size_t n, char const *fmt, ...); #undef __KDE_HAVE_GCC_VISIBILITY /* path to su */ -#define __PATH_SU "@__PATH_SU@" +#cmakedefine __PATH_SU "@__PATH_SU@" /* path to sudo */ -#define __PATH_SUDO "@__PATH_SUDO@" +#cmakedefine __PATH_SUDO "@__PATH_SUDO@" #if defined(__SVR4) && !defined(__svr4__) diff --git a/tdeabc/CMakeLists.txt b/tdeabc/CMakeLists.txt index 0cd900c08..1d2ae37a7 100644 --- a/tdeabc/CMakeLists.txt +++ b/tdeabc/CMakeLists.txt @@ -79,6 +79,13 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts ) +add_custom_target( + addressee_files + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/addressee.cpp + ${CMAKE_CURRENT_BINARY_DIR}/addressee.h + ${CMAKE_CURRENT_BINARY_DIR}/field.cpp +) ##### tdeabc ###################################### @@ -103,7 +110,7 @@ tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 1.2.0 LINK vcards-static vcard-shared tdeio-shared tderesources-shared - DEPENDENCIES addressee.h dcopidl + DEPENDENCIES addressee_files dcopidl DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index 508ca855b..85f5c99df 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -12,7 +12,12 @@ add_subdirectory( malloc ) add_subdirectory( network ) add_subdirectory( tdeconfig_compiler ) -add_subdirectory( tdehw ) + +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 ) add_subdirectory( svgicons ) @@ -25,7 +30,7 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/network - ${CMAKE_CURRENT_SOURCE_DIR}/tdehw + ${TDEHW_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/libltdl ${CMAKE_SOURCE_DIR}/tdefx @@ -128,10 +133,10 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 14.0.0 - EMBED tdecorenetwork-static tdehw-static + EMBED tdecorenetwork-static ${TDEHW_LIB} LINK ltdlc-static ${KDESVGICONS} DCOP-shared tdefx-shared ${ZLIB_LIBRARIES} ${LIBIDN_LIBRARIES} ${XCOMPOSITE_LIBRARIES} ICE SM ${GAMIN_LIBRARIES} - ${LIBBFD_LIBRARIES} util + ${LIBBFD_LIBRARIES} ${LIB_UTIL} DEPENDENCIES dcopidl dcopidl2cpp DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/tdecore/kdemacros.h.cmake b/tdecore/kdemacros.h.cmake index 766ca622a..083cc8c8d 100644 --- a/tdecore/kdemacros.h.cmake +++ b/tdecore/kdemacros.h.cmake @@ -21,6 +21,7 @@ #define _KDE_MACROS_H_ /* Set by configure */ +#cmakedefine __TDE_HAVE_TDEHWLIB 1 #cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 /** diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index 6760c95a0..cbdf86783 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -24,8 +24,10 @@ #include "tdelocale.h" #include "kcharsets.h" #include "kiconloader.h" +#ifdef __TDE_HAVE_TDEHWLIB #include "tdehardwaredevices.h" #include "tdenetworkconnections.h" +#endif #include "tdeaboutdata.h" #include "kstandarddirs.h" #include "kdebug.h" @@ -72,8 +74,10 @@ TDEInstance::TDEInstance( const TQCString& name) : _dirs (0L), _config (0L), _iconLoader (0L), +#ifdef __TDE_HAVE_TDEHWLIB _hardwaredevices (0L), _networkmanager (0L), +#endif _name( name ), _aboutData( new TDEAboutData( name, "", 0 ) ), m_configReadOnly(false) { DEBUG_ADD @@ -92,8 +96,10 @@ TDEInstance::TDEInstance( const TDEAboutData * aboutData ) : _dirs (0L), _config (0L), _iconLoader (0L), +#ifdef __TDE_HAVE_TDEHWLIB _hardwaredevices (0L), _networkmanager (0L), +#endif _name( aboutData->appName() ), _aboutData( aboutData ), m_configReadOnly(false) { DEBUG_ADD @@ -113,8 +119,10 @@ TDEInstance::TDEInstance( TDEInstance* src ) : _dirs ( src->_dirs ), _config ( src->_config ), _iconLoader ( src->_iconLoader ), +#ifdef __TDE_HAVE_TDEHWLIB _hardwaredevices ( src->_hardwaredevices ), _networkmanager ( src->_networkmanager ), +#endif _name( src->_name ), _aboutData( src->_aboutData ), m_configReadOnly(false) { DEBUG_ADD @@ -133,8 +141,10 @@ TDEInstance::TDEInstance( TDEInstance* src ) src->_dirs = 0L; src->_config = 0L; src->_iconLoader = 0L; +#ifdef __TDE_HAVE_TDEHWLIB src->_hardwaredevices = 0L; src->_networkmanager = 0L; +#endif src->_aboutData = 0L; delete src; } @@ -153,11 +163,13 @@ TDEInstance::~TDEInstance() delete _iconLoader; _iconLoader = 0; +#ifdef __TDE_HAVE_TDEHWLIB delete _hardwaredevices; _hardwaredevices = 0; delete _networkmanager; _networkmanager = 0; +#endif // delete _config; // Do not delete, stored in d->sharedConfig _config = 0; @@ -270,6 +282,7 @@ TDEIconLoader *TDEInstance::iconLoader() const return _iconLoader; } +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *TDEInstance::hardwareDevices() const { DEBUG_CHECK_ALIVE @@ -289,6 +302,7 @@ TDEGlobalNetworkManager *TDEInstance::networkManager() const return _networkmanager; } +#endif void TDEInstance::newIconLoader() const { diff --git a/tdecore/kinstance.h b/tdecore/kinstance.h index be60c943c..e0fdf73de 100644 --- a/tdecore/kinstance.h +++ b/tdecore/kinstance.h @@ -18,6 +18,9 @@ #ifndef _KINSTANCE_H #define _KINSTANCE_H +#include <tqstring.h> +#include "tdelibs_export.h" + class TDEStandardDirs; class TDEAboutData; class TDEConfig; @@ -27,11 +30,10 @@ class TQFont; class TDEInstancePrivate; class KMimeSourceFactory; class TDESharedConfig; +#ifdef __TDE_HAVE_TDEHWLIB class TDEHardwareDevices; class TDEGlobalNetworkManager; - -#include <tqstring.h> -#include "tdelibs_export.h" +#endif /** @@ -110,6 +112,7 @@ class TDECORE_EXPORT TDEInstance */ TDEIconLoader *iconLoader() const; +#ifdef __TDE_HAVE_TDEHWLIB /** * Returns a TDEHardwareDevices object. * @return the hardwaredevices object. @@ -121,6 +124,7 @@ class TDECORE_EXPORT TDEInstance * @return the networkmanager object. */ TDEGlobalNetworkManager *networkManager() const; +#endif /** * Re-allocate the global iconloader. @@ -168,8 +172,10 @@ private: mutable TDEConfig *_config; mutable TDEIconLoader *_iconLoader; +#ifdef __TDE_HAVE_TDEHWLIB mutable TDEHardwareDevices *_hardwaredevices; mutable TDEGlobalNetworkManager *_networkmanager; +#endif mutable void *_placeholder; TQCString _name; diff --git a/tdecore/tdeglobal.cpp b/tdecore/tdeglobal.cpp index f8639d526..8ef5f59db 100644 --- a/tdecore/tdeglobal.cpp +++ b/tdecore/tdeglobal.cpp @@ -34,8 +34,10 @@ #include <tdelocale.h> #include <kcharsets.h> #include <kiconloader.h> +#ifdef __TDE_HAVE_TDEHWLIB #include <tdehardwaredevices.h> #include <tdenetworkconnections.h> +#endif #include <kstandarddirs.h> #include <kinstance.h> #include "kstaticdeleter.h" @@ -81,6 +83,7 @@ TDEIconLoader *TDEGlobal::iconLoader() return _instance->iconLoader(); } +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *TDEGlobal::hardwareDevices() { MYASSERT(_instance); @@ -94,6 +97,7 @@ TDEGlobalNetworkManager *TDEGlobal::networkManager() return _instance->networkManager(); } +#endif TDEInstance *TDEGlobal::instance() { |