Imported Upstream version 0.3.3
[anytun.git] / src / configure
index 5381010..bcadb99 100755 (executable)
@@ -143,22 +143,36 @@ fi
 
 rm -f include.mk
 case $TARGET in 
-       Linux)
-               rm -rf tunDevice.cpp
-               ln -sf linux/tunDevice.cpp 
+  Linux)
+    rm -f tunDevice.cpp
+    ln -sf linux/tunDevice.cpp 
+    rm -f signalHandler.hpp
+    ln -sf posix/signalHandler.hpp
+    rm -f sysExec.hpp
+    ln -sf posix/sysExec.hpp
+    rm -f daemonService.h daemonService.cpp
+    ln -sf posix/posixDaemon.h daemonService.h
+    ln -sf posix/posixDaemon.cpp daemonService.cpp
     echo "loading Linux specific TUN Device"
-       ;;
-       OpenBSD|FreeBSD|NetBSD)
-               rm -rf tunDevice.cpp
-               ln -sf bsd/tunDevice.cpp 
+  ;;
+  OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD)
+    rm -f tunDevice.cpp
+    ln -sf bsd/tunDevice.cpp 
+    rm -f signalHandler.hpp
+    ln -sf posix/signalHandler.hpp
+    rm -f sysExec.hpp
+    ln -sf posix/sysExec.hpp
+    rm -f daemonService.h daemonService.cpp
+    ln -sf posix/posixDaemon.h daemonService.h
+    ln -sf posix/posixDaemon.cpp daemonService.cpp
     echo "loading BSD specific TUN Device"
     CXXFLAGS=$CXXFLAGS' -I/usr/local/include'
     LDFLAGS=$LDFLAGS' -L/usr/local/lib'
-       ;;
-       *)
-               echo "Plattform not supported"
+  ;;
+  *)
+    echo "platform not supported"
     exit 1
-       ;;
+  ;;
 esac
 
 case $CRYPTO_LIB in
@@ -241,4 +255,33 @@ else
   echo "not installing example files"
 fi
 
+VERSION=`cat ../version`
+if which svn >/dev/null; then
+  SVN_REV=`svn info | grep "^Revision: " | awk '{print($2)}'`
+  if [ -n "$SVN_REV" ]; then
+    VERSION="$VERSION (svn$SVN_REV)"
+  fi
+fi
+HOSTNAME=`hostname`
+DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
+
+cat >> version.h <<EOF
+/* 
+ * anytun version info
+ *
+ * this file was created automatically
+ * do not edit this file directly
+ * use ./configure instead
+ */
+
+#ifndef ANYTUN_version_h_INCLUDED
+#define ANYTUN_version_h_INCLUDED
+
+#define VERSION_STRING_0 " version $VERSION"
+#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
+
+#endif
+
+EOF
+
 exit 0