Improve build system targets to allow multiple application
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Wed, 28 Jan 2015 07:24:09 +0000 (08:24 +0100)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Wed, 28 Jan 2015 07:24:09 +0000 (08:24 +0100)
20 files changed:
CMakeLists.txt
cmake/generate_builddata.cmake
cmake/link_app.cmake
openwrt/oonf-dlep-proxy-git/Makefile
openwrt/oonf-dlep-radio-git/Makefile
openwrt/oonf-olsrd2-git/Makefile
src-api/core/CMakeLists.txt
src-api/core/app_data.h [moved from src/app_data.h.in with 100% similarity]
src-api/core/oonf_main.c
src/CMakeLists.txt
src/app_config.cmake [deleted file]
src/app_data.c.in
src/dlep-radio/CMakeLists.txt [new file with mode: 0644]
src/dlep-radio/dlep_config.cmake [new file with mode: 0644]
src/main.c
src/olsrd2/CMakeLists.txt [new file with mode: 0644]
src/olsrd2/olsrd2_config.cmake [new file with mode: 0644]
src/oonf/CMakeLists.txt [new file with mode: 0644]
src/oonf/OONF_APP_README [new file with mode: 0644]
src/oonf/oonf_config.cmake [new file with mode: 0644]

index 28c2dc7..523b1fa 100644 (file)
@@ -11,9 +11,6 @@ include (./cmake/lib_config.cmake)
 # include compiler flags
 include (./cmake/cc_flags.cmake)
 
-# set version
-SET(OONF_VERSION 0.6.0)
-
 ########################
 #### Doxygen target ####
 ########################
index 049526c..fd123a4 100755 (executable)
@@ -12,7 +12,19 @@ IF(NOT OONF_LIB_GIT)
          execute_process(COMMAND git describe --always --long --tags --dirty --match "v[0-9]*"
                  OUTPUT_VARIABLE OONF_LIB_GIT OUTPUT_STRIP_TRAILING_WHITESPACE)
   ENDIF()
-  
+ENDIF()
+
+IF(NOT OONF_VERSION)
+  SET(found_git false)
+  find_program(found_git git)
+
+  SET(OONF_VERSION "cannot read git repository")
+
+  IF(NOT ${found_git} STREQUAL "found_git-NOTFOUND")
+    # get git description WITH dirty flag
+    execute_process(COMMAND git describe --abbrev=0 --match "v[0-9]*"
+      OUTPUT_VARIABLE OONF_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  ENDIF()
 ENDIF()
 
 message ("Git commit: ${OONF_LIB_GIT}")
index f6be11f..425f50c 100644 (file)
@@ -2,63 +2,69 @@
 # earlier libraries can use the functions of later, not the
 # other way around
 
-# link static plugins
-message (STATUS "Static plugins for executables:")
+function (oonf_create_app executable static_plugins)
+    message (STATUS "Static plugins for ${executable} app:")
 
-# standard static linked targets
-SET(OBJECT_TARGETS )
-SET(EXTERNAL_LIBRARIES )
+    # standard static linked targets
+    SET(OBJECT_TARGETS )
+    SET(EXTERNAL_LIBRARIES )
 
-# run through list of static plugins
-FOREACH(plugin ${OONF_STATIC_PLUGINS})
-    IF(TARGET oonf_static_${plugin})
-        message (STATUS "    Found target: oonf_static_${plugin}")  
+    # generate configuration file
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../app_data.c.in ${PROJECT_BINARY_DIR}/${executable}_app_data.c)
 
-        # Remember object targets for static plugin
-        SET(OBJECT_TARGETS ${OBJECT_TARGETS} $<TARGET_OBJECTS:oonf_static_${plugin}>)
+    # run through list of static plugins
+    FOREACH(plugin ${static_plugins})
+        IF(TARGET oonf_static_${plugin})
+            message (STATUS "    Found target: oonf_static_${plugin}")
+
+            # Remember object targets for static plugin
+            SET(OBJECT_TARGETS ${OBJECT_TARGETS} $<TARGET_OBJECTS:oonf_static_${plugin}>)
         
-        # add static plugins to global dynamic target
-        ADD_DEPENDENCIES(dynamic oonf_static_${plugin})
+            # add static plugins to global dynamic target
+            ADD_DEPENDENCIES(dynamic oonf_static_${plugin})
         
-        # extract external libraries of plugin 
-        get_property(value TARGET oonf_${plugin} PROPERTY LINK_LIBRARIES)
-        FOREACH(lib ${value})
-            IF(NOT "${lib}" MATCHES "^oonf_")
-                message (STATUS "        Library: ${lib}")
-                SET(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${lib})
-            ENDIF()
-        ENDFOREACH(lib)
-    ELSE (TARGET oonf_static_${plugin})
-        message (FATAL_ERROR "    Did not found target: oonf_static_${plugin}")
-    ENDIF(TARGET oonf_static_${plugin})
-ENDFOREACH(plugin)
+            # extract external libraries of plugin
+            get_property(value TARGET oonf_${plugin} PROPERTY LINK_LIBRARIES)
+            FOREACH(lib ${value})
+                IF(NOT "${lib}" MATCHES "^oonf_")
+                    message (STATUS "        Library: ${lib}")
+                    SET(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${lib})
+                ENDIF()
+            ENDFOREACH(lib)
+        ELSE (TARGET oonf_static_${plugin})
+            message (FATAL_ERROR "    Did not found target: oonf_static_${plugin}")
+        ENDIF(TARGET oonf_static_${plugin})
+    ENDFOREACH(plugin)
 
-# create executables
-ADD_EXECUTABLE(${OONF_EXE}_dynamic ${OONF_SRCS}
-                                   ${OBJECT_TARGETS})
-ADD_EXECUTABLE(${OONF_EXE}_static  ${OONF_SRCS}
-                                   ${OBJECT_TARGETS}
-                                   $<TARGET_OBJECTS:oonf_static_common> 
-                                   $<TARGET_OBJECTS:oonf_static_config>
-                                   $<TARGET_OBJECTS:oonf_static_core>)
+    # create executables
+    ADD_EXECUTABLE(${executable}_dynamic ${CMAKE_CURRENT_SOURCE_DIR}/../main.c
+                                         ${PROJECT_BINARY_DIR}/${executable}_app_data.c
+                                         ${OBJECT_TARGETS})
+    ADD_EXECUTABLE(${executable}_static  ${CMAKE_CURRENT_SOURCE_DIR}/../main.c
+                                         ${PROJECT_BINARY_DIR}/${executable}_app_data.c
+                                         ${OBJECT_TARGETS}
+                                         $<TARGET_OBJECTS:oonf_static_common>
+                                         $<TARGET_OBJECTS:oonf_static_config>
+                                         $<TARGET_OBJECTS:oonf_static_core>)
 
-# Add executables to static/dynamic target
-ADD_DEPENDENCIES(dynamic ${OONF_EXE}_dynamic)
-ADD_DEPENDENCIES(static  ${OONF_EXE}_static)
+    # Add executables to static/dynamic target
+    ADD_DEPENDENCIES(dynamic ${executable}_dynamic)
+    ADD_DEPENDENCIES(static  ${executable}_static)
 
-# add path to install target
-INSTALL (TARGETS ${OONF_EXE}_dynamic DESTINATION bin)
-INSTALL (TARGETS ${OONF_EXE}_static  DESTINATION bin COMPONENT static_exe)
+    # add path to install target
+    INSTALL (TARGETS ${executable}_dynamic DESTINATION bin)
+    INSTALL (TARGETS ${executable}_static  DESTINATION bin COMPONENT static_exe)
 
-# link framework libraries to dynamic executable
-TARGET_LINK_LIBRARIES(${OONF_EXE}_dynamic PUBLIC oonf_core
-                                                 oonf_config
-                                                 oonf_common)
+    # link framework libraries to dynamic executable
+    TARGET_LINK_LIBRARIES(${executable}_dynamic PUBLIC oonf_core
+                                                       oonf_config
+                                                       oonf_common)
 
-# link external libraries directly to executable
-TARGET_LINK_LIBRARIES(${OONF_EXE}_dynamic PUBLIC ${EXTERNAL_LIBRARIES})
-TARGET_LINK_LIBRARIES(${OONF_EXE}_static  PUBLIC ${EXTERNAL_LIBRARIES})
+    # link external libraries directly to executable
+    TARGET_LINK_LIBRARIES(${executable}_dynamic PUBLIC ${EXTERNAL_LIBRARIES})
+    TARGET_LINK_LIBRARIES(${executable}_static  PUBLIC ${EXTERNAL_LIBRARIES})
 
-# link dlopen() library
-TARGET_LINK_LIBRARIES(${OONF_EXE}_dynamic PUBLIC ${CMAKE_DL_LIBS})
-TARGET_LINK_LIBRARIES(${OONF_EXE}_static  PUBLIC ${CMAKE_DL_LIBS})
+    # link dlopen() library
+    TARGET_LINK_LIBRARIES(${executable}_dynamic PUBLIC ${CMAKE_DL_LIBS})
+    TARGET_LINK_LIBRARIES(${executable}_static  PUBLIC ${CMAKE_DL_LIBS})
+endfunction(oonf_create_app)
index 7726d8e..60132fe 100644 (file)
@@ -42,19 +42,19 @@ define Package/dlep-proxy-git
        DEPENDS:=+librt +libnl-tiny +libuci
 endef
 
-Build/Compile=$(call Build/Compile/Default,static)
+Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
 Build/Install=
 
 define Build/Install
-       $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_proxy;
+       $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_proxy;
 endef
 
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
 
 define Package/dlep-proxy-git/install
-       $(INSTALL_BIN)  -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/dlep_proxy
-       $(INSTALL_BIN)  -D ./files/dlep.init              $(1)/etc/init.d/dlep
-       $(INSTALL_DATA) -D ./files/dlep.conf              $(1)/etc/dlep.conf
+       $(INSTALL_BIN)  -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_proxy
+       $(INSTALL_BIN)  -D ./files/dlep.init                  $(1)/etc/init.d/dlep
+       $(INSTALL_DATA) -D ./files/dlep.conf                  $(1)/etc/dlep.conf
 endef
 
 define Package/dlep-proxy-git/conffiles
index f3baafe..15af490 100644 (file)
@@ -42,19 +42,19 @@ define Package/dlep-radio-git
        DEPENDS:=+librt +libnl-tiny +libuci
 endef
 
-Build/Compile=$(call Build/Compile/Default,static)
+Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
 Build/Install=
 
 define Build/Install
-       $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_radio;
+       $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_radio;
 endef
 
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
 
 define Package/dlep-radio-git/install
-       $(INSTALL_BIN)  -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/dlep_radio
-       $(INSTALL_BIN)  -D ./files/dlep.init              $(1)/etc/init.d/dlep
-       $(INSTALL_DATA) -D ./files/dlep.conf              $(1)/etc/dlep.conf
+       $(INSTALL_BIN)  -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_radio
+       $(INSTALL_BIN)  -D ./files/dlep.init                  $(1)/etc/init.d/dlep
+       $(INSTALL_DATA) -D ./files/dlep.conf                  $(1)/etc/dlep.conf
 endef
 
 define Package/dlep-radio-git/conffiles
index 88d64f0..2a31dfc 100644 (file)
@@ -42,7 +42,7 @@ define Package/olsrd2-git
        DEPENDS:=+librt +libnl-tiny +libuci
 endef
 
-Build/Compile=$(call Build/Compile/Default,static)
+Build/Compile=$(call Build/Compile/Default,olsrd2_static)
 Build/Install=
 
 define Build/Install
index 1ce2fce..c8cd4cf 100644 (file)
@@ -12,7 +12,6 @@ ADD_CUSTOM_COMMAND (
         -DSRC=${CMAKE_CURRENT_SOURCE_DIR}/oonf_libdata.c.in
         -DDST=${GEN_DATA_C}
         -DOONF_VERSION=${OONF_VERSION}
-        -DCMAKE_SYSTEM=${CMAKE_SYSTEM}
         -DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}
         -DCMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX}
         -DOONF_LIB_GIT=${OONF_LIB_GIT}
similarity index 100%
rename from src/app_data.h.in
rename to src-api/core/app_data.h
index 514002f..0abf666 100644 (file)
@@ -166,7 +166,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
 
   /* initialize logger */
   if (oonf_log_init(appdata, _debug_early ? LOG_SEVERITY_DEBUG : LOG_SEVERITY_WARN)) {
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* prepare plugin initialization */
@@ -174,7 +174,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
 
   /* initialize configuration system */
   if (oonf_cfg_init(argc, argv, appdata->default_cfg_handler)) {
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* add custom configuration definitions */
@@ -184,7 +184,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
   return_code = parse_commandline(argc, argv, appdata, false);
   if (return_code != -1) {
     /* end OONFd now */
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* prepare for an error during initialization */
@@ -193,23 +193,23 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
   /* read global section early */
   if (oonf_cfg_update_globalcfg(true)) {
     OONF_WARN(LOG_MAIN, "Cannot read global configuration section");
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* configure logger */
   if (oonf_logcfg_apply(oonf_cfg_get_rawdb())) {
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* load plugins */
   if (oonf_cfg_loadplugins()) {
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* show schema if necessary */
   if (_display_schema) {
     return_code = display_schema();
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   /* check if we are root, otherwise stop */
@@ -217,7 +217,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
     if (geteuid() != 0) {
       OONF_WARN(LOG_MAIN, "You must be root(uid = 0) to run %s!\n",
           appdata->app_name);
-      goto olsrd_cleanup;
+      goto oonf_cleanup;
     }
   }
 
@@ -226,7 +226,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
     if (os_core_create_lockfile(config_global.lockfile)) {
       OONF_WARN(LOG_MAIN, "Could not acquire application lock '%s'",
           config_global.lockfile);
-      goto olsrd_cleanup;
+      goto oonf_cleanup;
     }
   }
 
@@ -235,7 +235,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
 
   /* apply configuration */
   if (oonf_cfg_apply()) {
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
   if (!oonf_cfg_is_running()) {
@@ -244,21 +244,26 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
      * or maybe the user decided otherwise and pressed CTRL-C
      */
     return_code = _end_oonf_signal ? 0 : 1;
-    goto olsrd_cleanup;
+    goto oonf_cleanup;
   }
 
+  if (!_handle_scheduling) {
+    OONF_WARN(LOG_MAIN, "No event scheduler present");
+    return_code = 1;
+    goto oonf_cleanup;
+  }
   /* see if we need to fork */
   if (config_global.fork && !_display_schema) {
     /* tell main process that we are finished with initialization */
     if (daemon(0,0) < 0) {
       OONF_WARN(LOG_MAIN, "Could not fork into background: %s (%d)",
           strerror(errno), errno);
-      goto olsrd_cleanup;
+      goto oonf_cleanup;
     }
 
     if (config_global.pidfile && *config_global.pidfile != 0) {
       if (_write_pidfile(config_global.pidfile)) {
-        goto olsrd_cleanup;
+        goto oonf_cleanup;
       }
     }
   }
@@ -272,7 +277,7 @@ oonf_main(int argc, char **argv, const struct oonf_appdata *appdata) {
   /* wait for 500 milliseconds and process socket events */
   _handle_scheduling();
 
-olsrd_cleanup:
+oonf_cleanup:
   /* free plugins */
   oonf_cfg_unconfigure_plugins();
   oonf_plugins_cleanup();
index 68cf700..803115f 100644 (file)
@@ -1,13 +1,4 @@
-# create application data for including
-include (./app_config.cmake)
-
-# generate configuration files
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app_data.h.in ${PROJECT_BINARY_DIR}/app_data.h)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app_data.c.in ${PROJECT_BINARY_DIR}/app_data.c)
-
-# add main program
-set(OONF_SRCS main.c 
-              ${PROJECT_BINARY_DIR}/app_data.c)
-
-# link framework libraries
-include(../cmake/link_app.cmake)
+# build framework
+add_subdirectory(dlep-radio)
+add_subdirectory(olsrd2)
+add_subdirectory(oonf)
\ No newline at end of file
diff --git a/src/app_config.cmake b/src/app_config.cmake
deleted file mode 100644 (file)
index 9e3eecd..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-###########################################
-#### Default Application configuration ####
-###########################################
-
-# set name of program the executable and library prefix
-set (OONF_APP OLSRd2)
-set (OONF_EXE olsrd2)
-
-# setup custom text before and after default help message
-set (OONF_HELP_PREFIX "OLSRv2 routing agent\\n")
-set (OONF_HELP_SUFFIX "Visit http://www.olsr.org\\n")
-
-# setup custom text after version string
-set (OONF_VERSION_TRAILER "Visit http://www.olsr.org\\n")
-
-# set to true to stop application running without root privileges (true/false)
-set (OONF_NEED_ROOT true)
-
-# name of default configuration handler
-set (OONF_APP_DEFAULT_CFG_HANDLER Compact)
-
-#################################
-####  set static subsystems  ####
-#################################
-
-IF (NOT OONF_STATIC_PLUGINS)
-    set (OONF_STATIC_PLUGINS class
-                             clock
-                             duplicate_set
-                             interface
-                             layer2
-                             packet_socket
-                             rfc5444
-                             socket
-                             stream_socket
-                             telnet
-                             timer
-                             viewer
-                             os_clock
-                             os_socket
-                             os_interface
-                             os_routing
-                             os_system
-                             cfg_compact
-                             layer2info
-                             nl80211_listener
-                             systeminfo
-                             nhdp
-                             ff_dat_metric
-                             link_config
-                             neighbor_probing
-                             nhdpinfo
-                             olsrv2
-                             olsrv2info
-                             )
-ENDIF (NOT OONF_STATIC_PLUGINS)
index c0d80d9..b876635 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "core/oonf_appdata.h"
 #include "core/os_core.h"
-#include "app_data.h"
+#include "core/app_data.h"
 
 static struct oonf_appdata _appdata = {
   .app_name = "${OONF_APP}",
diff --git a/src/dlep-radio/CMakeLists.txt b/src/dlep-radio/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4e111ef
--- /dev/null
@@ -0,0 +1,8 @@
+# create application data for including
+include (./dlep_config.cmake)
+
+# link framework libraries
+include(../../cmake/link_app.cmake)
+
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
\ No newline at end of file
diff --git a/src/dlep-radio/dlep_config.cmake b/src/dlep-radio/dlep_config.cmake
new file mode 100644 (file)
index 0000000..12a3556
--- /dev/null
@@ -0,0 +1,45 @@
+###########################################
+#### Default Application configuration ####
+###########################################
+
+# set name of program the executable and library prefix
+set (OONF_APP "DLEP Radio")
+set (OONF_EXE dlep_radio)
+
+# setup custom text before and after default help message
+set (OONF_HELP_PREFIX "DLEP Radio daemon\\n")
+set (OONF_HELP_SUFFIX "Visit http://www.olsr.org\\n")
+
+# setup custom text after version string
+set (OONF_VERSION_TRAILER "Visit http://www.olsr.org\\n")
+
+# set to true to stop application running without root privileges (true/false)
+set (OONF_NEED_ROOT true)
+
+# name of default configuration handler
+set (OONF_APP_DEFAULT_CFG_HANDLER Compact)
+
+#################################
+####  set static subsystems  ####
+#################################
+
+set (OONF_STATIC_PLUGINS class
+                         clock
+                         interface
+                         layer2
+                         packet_socket
+                         socket
+                         stream_socket
+                         telnet
+                         timer
+                         viewer
+                         os_clock
+                         os_socket
+                         os_interface
+                         os_system
+                         cfg_compact
+                         layer2info
+                         nl80211_listener
+                         systeminfo
+                         dlep_radio
+                         )
index 075f04e..f0b3267 100644 (file)
@@ -42,7 +42,7 @@
 #include "common/common_types.h"
 #include "core/oonf_main.h"
 
-#include "app_data.h"
+#include "core/app_data.h"
 
 int
 main(int argc, char **argv) {
diff --git a/src/olsrd2/CMakeLists.txt b/src/olsrd2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..79cf973
--- /dev/null
@@ -0,0 +1,8 @@
+# create application data for including
+include (./olsrd2_config.cmake)
+
+# link framework libraries
+include(../../cmake/link_app.cmake)
+
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
\ No newline at end of file
diff --git a/src/olsrd2/olsrd2_config.cmake b/src/olsrd2/olsrd2_config.cmake
new file mode 100644 (file)
index 0000000..298841c
--- /dev/null
@@ -0,0 +1,54 @@
+###########################################
+#### Default Application configuration ####
+###########################################
+
+# set name of program the executable and library prefix
+set (OONF_APP OLSRd2)
+set (OONF_EXE olsrd2)
+
+# setup custom text before and after default help message
+set (OONF_HELP_PREFIX "OLSRv2 routing agent\\n")
+set (OONF_HELP_SUFFIX "Visit http://www.olsr.org\\n")
+
+# setup custom text after version string
+set (OONF_VERSION_TRAILER "Visit http://www.olsr.org\\n")
+
+# set to true to stop application running without root privileges (true/false)
+set (OONF_NEED_ROOT true)
+
+# name of default configuration handler
+set (OONF_APP_DEFAULT_CFG_HANDLER Compact)
+
+#################################
+####  set static subsystems  ####
+#################################
+
+set (OONF_STATIC_PLUGINS class
+                         clock
+                         duplicate_set
+                         interface
+                         layer2
+                         packet_socket
+                         rfc5444
+                         socket
+                         stream_socket
+                         telnet
+                         timer
+                         viewer
+                         os_clock
+                         os_socket
+                         os_interface
+                         os_routing
+                         os_system
+                         cfg_compact
+                         layer2info
+                         nl80211_listener
+                         systeminfo
+                         nhdp
+                         ff_dat_metric
+                         link_config
+                         neighbor_probing
+                         nhdpinfo
+                         olsrv2
+                         olsrv2info
+                         )
diff --git a/src/oonf/CMakeLists.txt b/src/oonf/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2a2b6ea
--- /dev/null
@@ -0,0 +1,8 @@
+# create application data for including
+include (./oonf_config.cmake)
+
+# link framework libraries
+include(../../cmake/link_app.cmake)
+
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
\ No newline at end of file
diff --git a/src/oonf/OONF_APP_README b/src/oonf/OONF_APP_README
new file mode 100644 (file)
index 0000000..8442ed0
--- /dev/null
@@ -0,0 +1,12 @@
+The OONF App executable loads everything from dynamic libraries, including the subsystems.
+
+Because of this you should run it with the following minimal configuration:
+
+[global]
+    plugin   class
+    plugin   clock
+    plugin   socket
+    plugin   timer
+    plugin   os_clock
+    plugin   os_socket
+    plugin   os_system
diff --git a/src/oonf/oonf_config.cmake b/src/oonf/oonf_config.cmake
new file mode 100644 (file)
index 0000000..edcb53d
--- /dev/null
@@ -0,0 +1,26 @@
+###########################################
+#### Default Application configuration ####
+###########################################
+
+# set name of program the executable and library prefix
+set (OONF_APP "Minimal OONF Daemon")
+set (OONF_EXE oonf)
+
+# setup custom text before and after default help message
+set (OONF_HELP_PREFIX "OONF Daemon daemon\\n")
+set (OONF_HELP_SUFFIX "Visit http://www.olsr.org\\n")
+
+# setup custom text after version string
+set (OONF_VERSION_TRAILER "Visit http://www.olsr.org\\n")
+
+# set to true to stop application running without root privileges (true/false)
+set (OONF_NEED_ROOT false)
+
+# name of default configuration handler
+set (OONF_APP_DEFAULT_CFG_HANDLER Compact)
+
+#################################
+####  set static subsystems  ####
+#################################
+
+set (OONF_STATIC_PLUGINS cfg_compact)