Make the Nettools backend optional.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/5/head
gregory guy 3 years ago
parent defa7b64d7
commit b414931502
No known key found for this signature in database
GPG Key ID: 2CC84A1CC6823AF8

@ -43,6 +43,7 @@ tde_setup_paths( )
option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
option( WITH_NETTOOLS "Enable net-tools backend support" OFF )
option( WITH_LIBIW "Enable build with libiw" ${WITH_ALL_OPTIONS} ) option( WITH_LIBIW "Enable build with libiw" ${WITH_ALL_OPTIONS} )

@ -25,30 +25,31 @@ if( WITH_GCC_VISIBILITY )
endif( WITH_GCC_VISIBILITY ) endif( WITH_GCC_VISIBILITY )
##### search for programs ##### net-tools support
message( STATUS "Checking for ifconfig" ) if( WITH_NETTOOLS )
find_program( PATH_IFCONFIG "ifconfig" DOC "Path for the ifconfig program" ) find_program( PATH_IFCONFIG "ifconfig" DOC "Path for the ifconfig program" )
if( NOT PATH_IFCONFIG ) find_program( PATH_ROUTE "route" DOC "Path for the route program" )
tde_message_fatal( "Program ifconfig is required but was not found on your system." ) find_program( PATH_IWCONFIG "iwconfig" DOC "Path for the iwconfig program" )
endif( )
message( STATUS "Checking for ifconfig - found ${PATH_IFCONFIG}" ) if( PATH_IFCONFIG-NOTFOUND )
tde_message_fatal( "Program ifconfig is required but was not found on your system." )
message( STATUS "Checking for route" ) endif()
find_program( PATH_ROUTE "route" DOC "Path for the route program" ) message( STATUS "Checking for ifconfig - found ${PATH_IFCONFIG}" )
if( NOT PATH_ROUTE )
message( STATUS "Checking for route - not found" ) if( PATH_ROUTE-NOTFOUND )
else( ) message( STATUS "Checking for route - not found" )
message( STATUS "Checking for route - found ${PATH_ROUTE}" ) else()
endif( ) message( STATUS "Checking for route - found ${PATH_ROUTE}" )
endif()
message( STATUS "Checking for iwconfig" )
find_program( PATH_IWCONFIG "iwconfig" DOC "Path for the iwconfig program" ) if( PATH_IWCONFIG-NOTFOUND )
if( NOT PATH_IWCONFIG ) message( STATUS "Checking for iwconfig - not found" )
message( STATUS "Checking for iwconfig - not found" ) else()
else( ) message( STATUS "Checking for iwconfig - found ${PATH_IWCONFIG}" )
message( STATUS "Checking for iwconfig - found ${PATH_IWCONFIG}" ) endif()
endif( ) set( WITH_NETTOOLS 1 )
endif( WITH_NETTOOLS )
##### support for libiw ##### support for libiw

@ -18,3 +18,6 @@
/* Defined if you have the <iwlib.h> header */ /* Defined if you have the <iwlib.h> header */
#cmakedefine HAVE_LIBIW @HAVE_LIBIW@ #cmakedefine HAVE_LIBIW @HAVE_LIBIW@
/* Defined if you build with the Nettools backend */
#cmakedefine WITH_NETTOOLS

@ -14,14 +14,20 @@ link_directories(
) )
set( _SRC_ backendbase.cpp
sysbackend.cpp
)
if( WITH_NETTOOLS )
list( APPEND _SRC_ nettoolsbackend.cpp )
endif()
##### knemo_backends (static) ##### knemo_backends (static)
tde_add_library( knemo_backends STATIC_PIC AUTOMOC tde_add_library( knemo_backends STATIC_PIC AUTOMOC
SOURCES SOURCES
backendbase.cpp ${_SRC_}
nettoolsbackend.cpp
sysbackend.cpp
LINK LINK
tdeio-shared tdeio-shared
${IW_LIBRARIES} ${IW_LIBRARIES}

@ -20,6 +20,10 @@
#ifndef DAEMONREGISTRY_H #ifndef DAEMONREGISTRY_H
#define DAEMONREGISTRY_H #define DAEMONREGISTRY_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tqstring.h> #include <tqstring.h>
#include <tdelocale.h> #include <tdelocale.h>
@ -47,7 +51,9 @@ struct DaemonRegistryEntry
DaemonRegistryEntry DaemonRegistry[] = DaemonRegistryEntry DaemonRegistry[] =
{ {
{ "Sys", SysBackend::createInstance }, { "Sys", SysBackend::createInstance },
#if defined( WITH_NETTOOLS )
{ "Nettools", NetToolsBackend::createInstance }, { "Nettools", NetToolsBackend::createInstance },
#endif
{ TQString(), 0 } { TQString(), 0 }
}; };

@ -20,6 +20,10 @@
#ifndef KCMREGISTRY_H #ifndef KCMREGISTRY_H
#define KCMREGISTRY_H #define KCMREGISTRY_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tqstring.h> #include <tqstring.h>
#include <tdelocale.h> #include <tdelocale.h>
@ -42,13 +46,13 @@ struct KCMRegistryEntry
KCMRegistryEntry KCMRegistry[] = KCMRegistryEntry KCMRegistry[] =
{ {
{ "Sys", { "Sys", i18n( "Uses the sys filesystem available in 2.6 kernels and " \
i18n( "Uses the sys filesystem available in 2.6 kernels and " \ "direct system calls to the Linux kernel." ) },
"direct system calls to the Linux kernel." ) }, #if defined( WITH_NETTOOLS )
{ "Nettools", { "Nettools", i18n( "Uses the tools from the net-tools package like ifconfig, " \
i18n( "Uses the tools from the net-tools package like ifconfig, " \ "iwconfig and route to read the necessary information " \
"iwconfig and route to read the necessary information " \ "from the ouput of these commands.") },
"from the ouput of these commands.") }, #endif
{ TQString(), TQString() } { TQString(), TQString() }
}; };

Loading…
Cancel
Save