Small fixes to allow compilation with OpenBSD
authorCharlie Root <root@cerberus.fkie.fraunhofer.de>
Thu, 17 Apr 2014 12:00:35 +0000 (14:00 +0200)
committerCharlie Root <root@cerberus.fkie.fraunhofer.de>
Thu, 17 Apr 2014 12:00:35 +0000 (14:00 +0200)
Makefile
make/hash_source.sh
src/bsd/dummy.c

index 66fe7d4..f35a020 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,7 @@ builddata.txt:
 
 # only overwrite it when it doesn't exists or when it has changed
 src/builddata.c: builddata.txt
-       $(MAKECMDPREFIX)if [ ! -f "$@" ] || [ -n "$$(diff "$<" "$@")" ]; then cp -a -v "$<" "$@"; fi
+       $(MAKECMDPREFIX)if [ ! -f "$@" ] || [ -n "$$(diff "$<" "$@")" ]; then cp -p "$<" "$@"; fi
 
 .PHONY: help libs clean_libs libs_clean clean distclean uberclean install_libs uninstall_libs libs_install libs_uninstall install_bin uninstall_bin install_olsrd uninstall_olsrd install uninstall build_all install_all uninstall_all clean_all gui clean_gui cfgparser_install cfgparser_clean
 
index d41d41c..5c41c57 100755 (executable)
@@ -10,11 +10,12 @@ buildDataTxt="$1"
 version="$2"
 verbose="$3"
 
-
 md5Command="md5sum"
 osName="$(uname)"
 if [ "x$osName" = "xDarwin" ] ; then
   md5Command="md5"
+elif [ "x$osName" = "xOpenBSD" ] ; then
+  md5Command="md5"
 fi
 
 
@@ -26,7 +27,6 @@ sourceHash="$(cat $(find . -name *.[ch] | grep -v -E '[/\\]?builddata.c$') | "$m
 hostName="$(hostname)"
 buildDate="$(date +"%Y-%m-%d %H:%M:%S")"
 
-
 tmpBuildDataTxt="$(mktemp -t olsrd.hash_source.XXXXXXXXXX)"
 cat > "$tmpBuildDataTxt" << EOF
 const char olsrd_version[] = "olsr.org - $version-git_$gitSha-hash_$sourceHash";
@@ -38,16 +38,16 @@ EOF
 if [ ! -e "$buildDataTxt" ]; then
   echo "[CREATE] $buildDataTxt"
   if [ "$verbose" = "0" ]; then
-    cp -a "$tmpBuildDataTxt" "$buildDataTxt"
+    cp -p "$tmpBuildDataTxt" "$buildDataTxt"
   else
-    cp -a -v "$tmpBuildDataTxt" "$buildDataTxt"
+    cp -p -v "$tmpBuildDataTxt" "$buildDataTxt"
   fi
 elif [ -n "$(diff -I "^const char build_date\[\].*\$" "$tmpBuildDataTxt" "$buildDataTxt" | sed 's/"/\\"/g')" ]; then
   echo "[UPDATE] $buildDataTxt"
   if [ "$verbose" = "0" ]; then
-    cp -a "$tmpBuildDataTxt" "$buildDataTxt"
+    cp -p "$tmpBuildDataTxt" "$buildDataTxt"
   else
-    cp -a -v "$tmpBuildDataTxt" "$buildDataTxt"
+    cp -p -v "$tmpBuildDataTxt" "$buildDataTxt"
   fi
 fi
 rm -f "$tmpBuildDataTxt"
index d1aca7e..ca80202 100644 (file)
@@ -23,7 +23,7 @@ void olsr_os_cleanup_iptunnel(const char * name __attribute__((unused))) {
 }
 
 struct olsr_iptunnel_entry *olsr_os_add_ipip_tunnel(union olsr_ip_addr *target __attribute__ ((unused)),
-    bool transportV4 __attribute__ ((unused)), char *name) {
+    bool transportV4 __attribute__ ((unused)), char *name __attribute__((unused))) {
   return NULL;
 }