Processor checks.
[silc.git] / configure.ad
index 5d62cf4c5768ea65c1df51fb7c7cf1b661571717..a4a9d403a8fa4b33f6260f2a4a1889b2886a4149 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2000 - 2005 Pekka Riikonen
+#  Copyright (C) 2000 - 2006 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -44,6 +44,25 @@ case "$target" in
     ;;
 esac
 
+# Get CPU
+case "$host_cpu" in
+  i386)
+    AC_DEFINE([SILC_I386], [], [SILC_I386])
+    ;;
+  i?86)
+    AC_DEFINE([SILC_I486], [], [SILC_I486])
+    ;;
+  x86_64)
+    AC_DEFINE([SILC_X86_64], [], [SILC_X86_64])
+    ;;
+  powerpc*)
+    AC_DEFINE([SILC_POWERPC], [], [SILC_POWERPC])
+    ;;
+  ia64)
+    AC_DEFINE([SILC_IA64], [], [SILC_IA64])
+    ;;
+esac
+
 # Control compiler optimizations
 CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
 
@@ -451,13 +470,13 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
   fi
 
   # Check libs to link against
-  f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silcincludes.h`
+  f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silc.h`
   if test -n "$f"; then
     LIBS="$LIBS -lpthread"
     check_threads=false
     has_threads=true
   fi
-  f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silcincludes.h`
+  f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silc.h`
   if test -n "$f"; then
     LIBS="$LIBS -ldl"
   fi
@@ -468,6 +487,9 @@ else
 #ifdef SILC_DIST_CLIENTLIB
   PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true)
 #endif SILC_DIST_CLIENTLIB
+#ifdef SILC_DIST_SERVERLIB
+  PKG_CHECK_MODULES(SILCSERVER, silcserver, compile_libs=false, compile_libs=true)
+#endif SILC_DIST_SERVERLIB
 
   if test x$compile_libs = xfalse; then
     LIBSUBDIR=
@@ -477,6 +499,10 @@ else
     LIBS="$LIBS $SILCCLIENT_LIBS"
     CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
 #endif SILC_DIST_CLIENTLIB
+#ifdef SILC_DIST_SERVERLIB
+    LIBS="$LIBS $SILCSERVER_LIBS"
+    CFLAGS="$CFLAGS $SILCSERVER_CFLAGS"
+#endif SILC_DIST_SERVERLIB
   fi
 fi
 #endif SILC_DIST_TOOLKIT
@@ -1091,7 +1117,7 @@ Makefile.defines
 Makefile.defines_int
 includes/Makefile
 includes/silcversion.h
-includes/silcincludes.h
+includes/silc.h
 #endif SILC_DIST_COMPILER
 #ifdef SILC_DIST_APPS
 apps/Makefile