Better check for epoll().
[silc.git] / lib / configure.ad
index 865589dd8e52123c39e6b43db4969ceb11fca58b..6da5e7c572f3581f8d5d0f68443dd448b760bc9c 100644 (file)
@@ -4,7 +4,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2005 Pekka Riikonen
+#  Copyright (C) 2005, 2007 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
@@ -69,7 +69,7 @@ SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
 #  - If functions were added, increment [LIB]_AGE
 #  - If functions were removed, set [LIB]_AGE to 0
 #
-# where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where 
+# where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where
 # "functions" means functions public interfaces (API).
 #
 # The LIB_BASE_VERSION defines the SILC software major.minor version and
@@ -107,6 +107,30 @@ AC_SUBST(LIBSILCSERVER_CURRENT)
 AC_SUBST(LIBSILCSERVER_REVISION)
 AC_SUBST(LIBSILCSERVER_AGE)
 
+# Check for big-endian machines
+AC_C_BIGENDIAN
+
+# Check for epoll_wait and verify that epoll_create works
+AC_CHECK_FUNC(epoll_wait,
+  [
+    AC_RUN_IFELSE(
+      [
+        #include <sys/epoll.h>
+        int main()
+        {
+          int ret = epoll_create(5);
+          if (ret < 0)
+            return 1;
+          close(ret);
+          return 0;
+        }
+      ],
+      [
+        AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
+      ],
+    )
+  ])
+
 #ifdef SILC_DIST_SIM
 # SIM modules directory
 #
@@ -147,6 +171,49 @@ AC_ARG_ENABLE(stack-trace,
   )
 #endif SILC_DIST_TOOLKIT
 
+#ifdef SILC_DIST_INPLACE
+#
+# Profiling options (never delivered to distributions)
+#
+AC_MSG_CHECKING(whether to enable gprof)
+AC_ARG_ENABLE(gprof,
+  [  --enable-gprof          enable gprof profiling],
+  [
+    case "${enableval}" in
+      yes)
+        AC_MSG_RESULT(yes)
+        SILC_ADD_CFLAGS(-pg)
+        LIBS="$LIBS -pg"
+        ;;
+      *)
+        AC_MSG_RESULT(no)
+        ;;
+    esac
+  ],
+  [
+    AC_MSG_RESULT(no)
+  ])
+
+AC_MSG_CHECKING(whether to enable gcov)
+AC_ARG_ENABLE(gcov,
+  [  --enable-gcov           enable gcov],
+  [
+    case "${enableval}" in
+      yes)
+        AC_MSG_RESULT(yes)
+        SILC_ADD_CFLAGS(-fprofile-arcs)
+        LIBS="$LIBS -lgcov"
+        ;;
+      *)
+        AC_MSG_RESULT(no)
+        ;;
+    esac
+  ],
+  [
+    AC_MSG_RESULT(no)
+  ])
+#endif SILC_DIST_INPLACE
+
 #
 # Makefile outputs
 #
@@ -154,7 +221,6 @@ AC_CONFIG_FILES(
 lib/Makefile
 lib/contrib/Makefile
 lib/silccore/Makefile
-lib/silccrypt/Makefile
 #ifdef SILC_DIST_SIM
 lib/silcsim/Makefile
 #endif SILC_DIST_SIM
@@ -162,16 +228,12 @@ lib/silcske/Makefile
 lib/silcutil/Makefile
 lib/silcutil/unix/Makefile
 lib/silcutil/win32/Makefile
-lib/silcutil/beos/Makefile
-lib/silcutil/os2/Makefile
-lib/silcutil/epoc/Makefile
 lib/silcapputil/Makefile
 #ifdef SILC_DIST_SFTP
 lib/silcsftp/Makefile
 #endif SILC_DIST_SFTP
 #ifdef SILC_DIST_INPLACE
 lib/silcutil/tests/Makefile
-lib/silccrypt/tests/Makefile
 lib/silccore/tests/Makefile
 lib/silcsftp/tests/Makefile
 #endif SILC_DIST_INPLACE