Browse Source

Make the Nettools backend optional.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/5/head
gregory guy 5 months ago
parent
commit
b414931502
No known key found for this signature in database GPG Key ID: 2CC84A1CC6823AF8
  1. 1
      CMakeLists.txt
  2. 49
      ConfigureChecks.cmake
  3. 3
      config.h.cmake
  4. 12
      src/knemod/backends/CMakeLists.txt
  5. 6
      src/knemod/backends/daemonregistry.h
  6. 18
      src/knemod/backends/kcmregistry.h

1
CMakeLists.txt

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

49
ConfigureChecks.cmake

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

3
config.h.cmake

@ -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

12
src/knemod/backends/CMakeLists.txt

@ -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}

6
src/knemod/backends/daemonregistry.h

@ -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 }
};

18
src/knemod/backends/kcmregistry.h

@ -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 " \
"direct system calls to the Linux kernel." ) },
{ "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.") },
{ "Sys", i18n( "Uses the sys filesystem available in 2.6 kernels and " \
"direct system calls to the Linux kernel." ) },
#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