Use _GNU_SOURCE on Linux systems.
[silc.git] / configure.ad
index dfa3df0efe76a5e21773e5c0cd06a31f7420b2fb..8ee9d61b87f5e4e494e6f19de149346b9fd56ebb 100644 (file)
@@ -33,6 +33,10 @@ AC_PATH_PROG(sedpath, sed)
 # Put here any platform specific stuff
 #
 case "$target" in
+  *-*-linux*)
+    check_threads=true
+    CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
+    ;;
   *-*-freebsd*)
     check_threads=true
     ;;
@@ -95,8 +99,26 @@ __SILC_HAVE_SIM=""
 __SILC_ENABLE_DEBUG=""
 
 #ifdef SILC_DIST_TOOLKIT
-toolkitver=`echo $VERSION | sed 's/\.//g'`
-__SILC_PACKAGE_VERSION="#define __SILC_TOOLKIT_VERSION $toolkitver"
+toolkitver=`echo $VERSION | sed 's/\./ /g'`
+maj=0
+min=0
+bld=0
+for v in $toolkitver
+do
+  if test $maj -eq 0; then
+    maj=$v
+    continue
+  fi
+  if test $min -eq 0; then
+    min=$v
+    continue
+  fi
+  if test $bld -eq 0; then
+    bld=$v
+    continue
+  fi
+done
+__SILC_PACKAGE_VERSION="#define __SILC_TOOLKIT_VERSION SILC_VERSION($maj,$min,$bld)"
 #endif SILC_DIST_TOOLKIT
 
 AC_PROG_RANLIB