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_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} )

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

@ -18,3 +18,6 @@
/* Defined if you have the <iwlib.h> header */
#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)
tde_add_library( knemo_backends STATIC_PIC AUTOMOC
SOURCES
backendbase.cpp
nettoolsbackend.cpp
sysbackend.cpp
${_SRC_}
LINK
tdeio-shared
${IW_LIBRARIES}

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

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

Loading…
Cancel
Save