updates.
[silc.git] / configure.in.pre
index 0731f1cb8ac120d3e5cce5bf183a15ba9b86d192..293fa1e99a1b2ca27c5bdc092681f849730c4d49 100644 (file)
@@ -26,9 +26,6 @@ CFLAGS="-Wall $CFLAGS"
 #
 AC_CANONICAL_SYSTEM
 case "$target" in
-  *-*-linux*|*-*-mklinux*)
-    CFLAGS="-D_GNU_SOURCE $CFLAGS"
-    ;;
   *)
     ;;
 esac
@@ -49,7 +46,6 @@ AC_SUBST(LN_S)
 # Distribution definition. ./prepare will automatically add here a correct
 # value. Do not edit!
 AC_DEFINE(SILC_DIST_DEFINE)
-AM_CONDITIONAL(SILC_DIST_DEFINE, test xtrue = xtrue)
 
 # XXX
 # Compiler flags
@@ -109,14 +105,6 @@ AC_DEFUN(AC_CHECK_CURSES,[
        AC_SUBST(CURSES_LIBS)
        AC_SUBST(CURSES_INCLUDEDIR)
 
-       AC_ARG_WITH(sco,
-         [  --with-sco              Use this to turn on SCO-specific code],[
-         if test x$withval = xyes; then
-               AC_DEFINE(SCO_FLAVOR)
-               CFLAGS="$CFLAGS -D_SVID3"
-         fi
-       ])
-
        AC_ARG_WITH(sunos-curses,
          [  --with-sunos-curses     Used to force SunOS 4.x curses],[
          if test x$withval = xyes; then
@@ -349,6 +337,7 @@ AC_ARG_WITH(etcdir,
   esac ],
 )
 AC_SUBST(ETCDIR)
+AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
 
 # help directory
 HELPDIR="help"
@@ -366,6 +355,7 @@ AC_ARG_WITH(helpdir,
   esac ],
 )
 AC_SUBST(HELPDIR)
+AC_DEFINE_UNQUOTED(SILC_HELPDIR, "$HELPDIR")
 
 # doc directory
 DOCDIR="doc"
@@ -383,6 +373,7 @@ AC_ARG_WITH(docdir,
   esac ],
 )
 AC_SUBST(DOCDIR)
+AC_DEFINE_UNQUOTED(SILC_DOCDIR, "$DOCDIR")
 
 # SIM modules directory
 MODULESDIR="modules"
@@ -400,6 +391,7 @@ AC_ARG_WITH(simdir,
   esac ],
 )
 AC_SUBST(MODULESDIR)
+AC_DEFINE_UNQUOTED(SILC_MODULESDIR, "$MODULESDIR")
 
 # Logs directory
 LOGSDIR="logs"
@@ -417,23 +409,7 @@ AC_ARG_WITH(logsdir,
   esac ],
 )
 AC_SUBST(LOGSDIR)
-
-# Debug checking
-AC_MSG_CHECKING(for enabled debugging)
-AC_ARG_ENABLE(debug,
-[  --enable-debug          Enable debugging (warning: it is heavy!)],
-[ case "${enableval}" in
-  yes) 
-    AC_MSG_RESULT(yes)
-    AC_DEFINE(SILC_DEBUG)
-    CFLAGS="-O -g $CFLAGS"
-    ;;
-  *)
-    AC_MSG_RESULT(no)
-    CFLAGS="-O2 -g $CFLAGS"
-    ;;
-esac ], CFLAGS="-O2 -g $CFLAGS"
-        AC_MSG_RESULT(no))
+AC_DEFINE_UNQUOTED(SILC_LOGSDIR, "$LOGSDIR")
 
 # SOCKS4 support checking
 AC_MSG_CHECKING(whether to support SOCKS4)
@@ -534,44 +510,25 @@ if test "x$socks" = "x5"; then
   AC_DEFINE(Rgethostbyname, SOCKSgethostbyname)
 fi
 
-# GMP Library checking
-AC_MSG_CHECKING(whether to compile GMP)
-AC_ARG_WITH(gmp,
-[  --with-gmp              Build the GMP in the SILC source tree],
-[ case "${withval}" in
-  yes) 
-    AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval = xyes)
-    AC_MSG_RESULT(yes)
-    ;;
-  *)
-    AC_CHECK_HEADER(gmp.h,
-      AC_CHECK_LIB(gmp, __gmpz_init,
-        AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval = yes)
-        LIBS="$LIBS -L/usr/lib -L/usr/local/lib -lgmp"
-        AC_MSG_RESULT(GMP will not be compiled),
-        AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval != yes)
-        AC_MSG_RESULT(GMP will be compiled)
-      ),
-      AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval != yes)
-      AC_MSG_RESULT(GMP will be compiled)
-    )
-    ;;
-esac ], [
-  AC_CHECK_HEADER(gmp.h,
-    AC_CHECK_LIB(gmp, __gmpz_init,
-      build_gmp=false
-      AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
-      LIBS="$LIBS -L/usr/lib -L/usr/local/lib -lgmp"
-      AC_MSG_RESULT(GMP will not be compiled),
-      build_gmp=true
-      AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
-      AC_MSG_RESULT(GMP will be compiled)
-    ),
-    build_gmp=true
-    AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
-    AC_MSG_RESULT(GMP will be compiled)
+#
+# MP library checking. First check whether system has GMP. If it has that
+# then use it. If not then compile the MPI library in the source tree.
+#
+mp_gmp=false
+AC_CHECK_HEADER(gmp.h,
+  AC_CHECK_LIB(gmp, __gmpz_init,
+    mp_gmp=true
+    AC_DEFINE(SILC_MP_GMP)
+    LIBS="$LIBS -L/usr/lib -L/usr/local/lib -lgmp"
+    AC_MSG_RESULT(Using GMP as MP library)
   )
-])
+)
+AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
+if test x$mp_gmp = xfalse; then
+  AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse)
+  AC_DEFINE(SILC_MP_NSS_MPI)
+  AC_MSG_RESULT(Using NSS MPI as MP library)
+fi
 
 AC_ARG_WITH(silcd-config-file,
 [  --with-silcd-config-file[=PATH]
@@ -579,13 +536,37 @@ AC_ARG_WITH(silcd-config-file,
                           server [/etc/silc/silcd.conf]],
 [ AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval") ])
 
+# Native WIN32 compilation under cygwin
+AC_ARG_WITH(win32,
+[  --with-win32            Compile native WIN32 code (-mno-cygwin)],
+[ AC_DEFINE(SILC_WIN32)
+  AM_CONDITIONAL(SILC_WIN32, test xtrue = xtrue)
+  CFLAGS="-mno-cygwin $CFLAGS" ])
+
+# Debug checking
+AC_MSG_CHECKING(for enabled debugging)
+AC_ARG_ENABLE(debug,
+[  --enable-debug          Enable debugging (warning: it is heavy!)],
+[ case "${enableval}" in
+  yes) 
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(SILC_DEBUG)
+    CFLAGS="-O -g $CFLAGS"
+    ;;
+  *)
+    AC_MSG_RESULT(no)
+    CFLAGS="-O2 -g $CFLAGS"
+    ;;
+esac ], CFLAGS="-O2 -g $CFLAGS"
+        AC_MSG_RESULT(no))
+
 #
 # Other configure scripts
 #
 AC_CONFIG_SUBDIRS(irssi)
 AC_CONFIG_SUBDIRS(lib/dotconf)
-AC_CONFIG_SUBDIRS(lib/silcmath/gmp)
 AC_CONFIG_SUBDIRS(lib/trq)
+AC_CONFIG_SUBDIRS(lib/silcmath/mpi)
 #AC_CONFIG_SUBDIRS(lib/zlib)
 
 SILC_TOP_SRCDIR=`pwd`
@@ -617,5 +598,7 @@ lib/silcsim/Makefile
 lib/silcsim/modules/Makefile
 lib/silcske/Makefile
 lib/silcutil/Makefile
+lib/silcutil/unix/Makefile
+lib/silcutil/win32/Makefile
 silc/Makefile
 silcd/Makefile)