sgwdynspeed: use Git SHA from builddata
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 13 Apr 2016 13:20:37 +0000 (15:20 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 13 Apr 2016 15:02:01 +0000 (17:02 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/sgwdynspeed/Makefile
lib/sgwdynspeed/src/olsrdPlugin.c
lib/sgwdynspeed/src/sgwDynSpeed.h

index 3b54085..931e6ab 100644 (file)
@@ -26,8 +26,7 @@ default_target install clean:
 
 else
 
-GIT_SHA = $(shell git describe 2> /dev/null || echo "Unknown")
-CFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" -DPLUGIN_VER=\"$(PLUGIN_VER)\"
+CFLAGS += -DPLUGIN_VER=\"$(PLUGIN_VER)\"
 
 .PHONY: all default_target install uninstall clean doc doc-clean java java-instal java-uninstall
 
index de64a33..51e7531 100644 (file)
@@ -5,6 +5,7 @@
 
 /* OLSRD includes */
 #include "olsr.h"
+#include "builddata.h"
 
 /* System includes */
 #include <stdbool.h>
  */
 int olsrd_plugin_init(void) {
        bool retval = initSgwDynSpeed();
-       if (retval) {
-               olsr_printf(0, "%s\n", SGWDYNSPEED_PLUGIN_NAME_LONG
-#ifdef GIT_SHA
-                               " (" GIT_SHA ")"
-#endif /* GIT_SHA */
-                               );
-       }
        return (retval ? 1 : 0);
 }
 
@@ -75,6 +69,8 @@ static void __attribute__ ((destructor)) sgwDynSpeed_fini(void);
  Shared library entrypoint for initialisation
  */
 static void sgwDynSpeed_init(void) {
+  /* Print plugin info to stdout */
+  olsr_printf(0, "%s (%s)\n", SGWDYNSPEED_PLUGIN_NAME_LONG, git_descriptor);
 }
 
 /**
index bee8a4e..e93ed75 100644 (file)
  */
 
 /** The long plugin name */
-#define SGWDYNSPEED_PLUGIN_NAME_LONG                   "OLSRD Smart Gateway Dynamic Speed plugin"
+#define SGWDYNSPEED_PLUGIN_NAME_LONG  "OLSRD sgwdynspeed plugin"
 
 /** The short plugin name / abbreviation */
-#define SGWDYNSPEED_PLUGIN_ABBR                                        "SGWDYNSPEED"
+#define SGWDYNSPEED_PLUGIN_ABBR       "SGWDYNSPEED"
 
 /*
  *  Interface