2005-04-08 Alp Toker <alp@atoker.com>
[mono.git] / configure.in
index 9e79754057a37610ef4a52a2e82d2e3bf01a463a..70e9e0f6f51b1fa99857c91078dfe5d27bf3e042 100644 (file)
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,1.1.3)
+AM_INIT_AUTOMAKE(mono,1.1.7)
 AM_MAINTAINER_MODE
 
 AC_PROG_LN_S
@@ -240,7 +240,7 @@ fi
 
 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
 
-AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
+AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h linux/rtc.h)
 
 AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
 
@@ -249,11 +249,18 @@ AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
 # for mono/metadata/debug-symfile.c
 AC_CHECK_HEADERS(elf.h)
 
+# for support
+AC_CHECK_HEADERS(poll.h)
+AC_CHECK_HEADERS(sys/poll.h)
+AC_CHECK_HEADERS(sys/wait.h)
+AC_CHECK_HEADERS(grp.h)
+AC_CHECK_HEADERS(syslog.h)
+
 # for mono/dis
 AC_CHECK_HEADERS(wchar.h)
 AC_CHECK_HEADERS(ieeefp.h)
 AC_MSG_CHECKING(for isinf)
-AC_TRY_COMPILE([#include <math.h>], [
+AC_TRY_LINK([#include <math.h>], [
        int f = isinf (1);
 ], [
        AC_MSG_RESULT(yes)
@@ -272,6 +279,18 @@ if test x"$GCC" = xyes; then
         WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
                # The runtime code does not respect ANSI C strict aliasing rules
                CFLAGS="$CFLAGS -fno-strict-aliasing"
+
+               ORIG_CFLAGS=$CFLAGS
+               CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+               AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
+               AC_TRY_COMPILE([], [
+                                                  void main () { }
+               ], [
+                  AC_MSG_RESULT(yes)
+               ], [
+                  AC_MSG_RESULT(no)
+                  CFLAGS=$ORIG_CFLAGS
+               ])
 else
        # The Sun Forte compiler complains about inline functions that access static variables
        # so disable all inlining.
@@ -296,6 +315,18 @@ mcs_topdir_from_srcdir='$(top_builddir)/'$mcsdir
 AC_SUBST([mcs_topdir])
 AC_SUBST([mcs_topdir_from_srcdir])
 
+AC_ARG_WITH([libgdiplus], 
+       [  --with-libgdiplus=installed|sibling|<path>   Override the libgdiplus used for System.Drawing tests (defaults to NO)], 
+       [], [with_libgdiplus=installed])
+
+case $with_libgdiplus in
+no|installed) libgdiplus_loc= ;;
+yes|sibling) libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la ;;
+/*) libgdiplus_loc=$with_libgdiplus ;;
+*) libgdiplus_loc=`pwd`/$with_libgdiplus ;;
+esac
+AC_SUBST([libgdiplus_loc])
+
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 if test "x$PKG_CONFIG" = "xno"; then
        AC_MSG_ERROR([You need to install pkg-config])
@@ -308,15 +339,15 @@ BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
 AC_SUBST(BUILD_GLIB_CFLAGS)
 AC_SUBST(BUILD_GLIB_LIBS)
 
-PKG_PATH=
+pkg_config_path=
 AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir],
        if test x$with_crosspkgdir = "x"; then
                if test -s $PKG_CONFIG_PATH; then
-                       PKG_PATH=$PKG_CONFIG_PATH
+                       pkg_config_path=$PKG_CONFIG_PATH
                fi
        else
-               PKG_PATH=$with_crosspkgdir
-               PKG_CONFIG_PATH=$PKG_PATH
+               pkg_config_path=$with_crosspkgdir
+               PKG_CONFIG_PATH=$pkg_config_path
                export PKG_CONFIG_PATH
        fi
 )
@@ -502,6 +533,19 @@ dnl
 
 if test x$platform_win32 = xno; then
 
+       dnl ******************************************************************
+       dnl *** Checks for the IKVM JNI interface library                  ***
+       dnl ******************************************************************
+       AC_ARG_WITH(ikvm-native, [  --with-ikvm-native=yes,no  build the IKVM JNI interface library],[with_ikvm_native=$withval],[with_ikvm_native=yes])
+
+       ikvm_native_dir=
+       if test x$with_ikvm_native = xyes; then
+               ikvm_native_dir=ikvm-native
+               jdk_headers_found="IKVM Native"
+       fi
+
+       AC_SUBST(ikvm_native_dir)
+
        AC_CHECK_FUNCS(getgrgid_r)
        AC_CHECK_FUNCS(getgrnam_r)
        AC_CHECK_FUNCS(getpwnam_r)
@@ -509,6 +553,7 @@ if test x$platform_win32 = xno; then
        AC_CHECK_FUNCS(getresuid)
        AC_CHECK_FUNCS(setresuid)
        AC_CHECK_FUNCS(kqueue)
+       AC_CHECK_FUNCS(backtrace_symbols)
 
        dnl ******************************************************************
        dnl *** Check for large file support                               ***
@@ -862,23 +907,23 @@ if test x$platform_win32 = xno; then
 
                                sa.sa_sigaction = sigsegv_signal_handler;
                                sigemptyset (&sa.sa_mask);
-                               sa.sa_flags = SA_SIGINFO | SA_STACK;
+                               sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
                                if (sigaction (SIGSEGV, &sa, NULL) == -1) {
-                                       perror ("lala");
+                                       perror ("sigaction");
                                        return;
                                }
 
                                sas.ss_sp = malloc (SIGSTKSZ);
                                sas.ss_size = SIGSTKSZ;
-                               sas.ss_flags = SS_ONSTACK;
+                               sas.ss_flags = 0;
                                if (sigaltstack (&sas, NULL) == -1) {
-                                       perror ("lala");
+                                       perror ("sigaltstack");
                                        return;
                                }
 
                                pthread_attr_init (&attr);
                                if (pthread_create(&id, &attr, loop, &attr) != 0) {
-                                       printf ("failed\n");
+                                       printf ("pthread_create\n");
                                        return;
                                }
 
@@ -990,46 +1035,16 @@ if test x$platform_win32 = xno; then
                AC_MSG_RESULT(no)
        ]) 
 
-       dnl *********************
-       dnl *** Check for AIO ***
-       dnl *********************
-       AC_MSG_CHECKING([for SIGEV_THREAD definition])
-       dnl Some systems (FreeBSD at least) may have aio_read
-       dnl but don't support/define SIGEV_THREAD.
-       AC_TRY_COMPILE([
-       #include <sys/signal.h>
-       ],[
-       int x = SIGEV_THREAD;
-       ],[
-               ac_cv_c_sigev_thread=yes
-               AC_MSG_RESULT(yes)
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       if test "$ac_cv_c_sigev_thread" = "yes" ; then
-               AC_CHECK_HEADERS(aio.h sys/aio.h)
-               AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
-               SIGVAL_PTR="undefined"
-               if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
-                       AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
-                                       #include <sys/signal.h>
-                                       ])
-                       AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
-                                       #include <sys/signal.h>
-                                       ])
-                       if test "$SIGVAL_PTR" = "undefined" ; then
-                               AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
-                       fi
-               fi
-               AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
-       fi
-
        dnl **********************************
        dnl *** Checks for MonoPosixHelper ***
        dnl **********************************
+       AC_CHECK_HEADERS(checklist.h)
+       AC_CHECK_HEADERS(fstab.h)
        AC_CHECK_HEADERS(sys/sendfile.h)
        AC_CHECK_HEADERS(sys/statvfs.h)
+       AC_CHECK_HEADERS(sys/vfstab.h)
+       AC_CHECK_FUNCS(getdomainname)
+       AC_CHECK_FUNCS(setdomainname)
        AC_CHECK_FUNCS(fgetgrent)
        AC_CHECK_FUNCS(fgetpwent)
        AC_CHECK_FUNCS(fgetpwent)
@@ -1037,6 +1052,7 @@ if test x$platform_win32 = xno; then
        AC_CHECK_FUNCS(posix_fadvise)
        AC_CHECK_FUNCS(posix_fallocate)
        AC_CHECK_FUNCS(posix_madvise)
+       AC_CHECK_FUNCS(vsnprintf)
        AC_CHECK_FUNCS(sendfile)
        AC_CHECK_FUNCS(sethostid)
        AC_CHECK_FUNCS(statfs)
@@ -1051,6 +1067,17 @@ if test x$platform_win32 = xno; then
                [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,, 
                [#include <sys/types.h>
                 #include <dirent.h>])
+
+       dnl *********************************
+       dnl *** Check for Console 2.0 I/O ***
+       dnl *********************************
+       AC_CHECK_HEADERS([curses.h])
+       AC_CHECK_HEADERS([term.h], [], [],
+       [#if HAVE_CURSES_H
+        #include <curses.h>
+        #endif
+       ])
+       AC_CHECK_HEADERS([termios.h])
 else
        jdk_headers_found=no
        AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
@@ -1207,7 +1234,7 @@ fi
 #
 ICU_CFLAGS=""
 ICU_LIBS=""
-enable_icu="no;  default"
+enable_glob="normal;  default"
 
 probe_icu=false
 AC_ARG_WITH(icu, [  --with-icu=yes/no],
@@ -1223,10 +1250,9 @@ AC_ARG_WITH(icu, [  --with-icu=yes/no],
 if $probe_icu; then
        AC_PATH_PROG(ICU_CONFIG, icu-config, no)
        if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
-               AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
-               enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
+               enable_glob="ICU not found, using non-ICU globalization code."
        else
-               enable_icu="yes. Version: `$ICU_CONFIG --version`"
+               enable_glob="ICU, unsupported. Version: `$ICU_CONFIG --version`"
                AC_DEFINE(HAVE_ICU)
                ICU_CFLAGS=`$ICU_CONFIG --cppflags`
                ICU_LIBS=`$ICU_CONFIG --ldflags`
@@ -1289,6 +1315,9 @@ case "$host" in
                interp_wanted=true
                arch_target=alpha;
               ;;
+       *-*-mingw*|*-*-cygwin*)
+               INTL="intl"
+               ;;
 #      ia64-*-linux* | ia64-*-hpux*)
 #              TARGET=IA64;
 #              arch_target=ia64;
@@ -1438,6 +1467,14 @@ if test "x$with_tls" = "x__thread"; then
    # Pass the information to libgc
        CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
        export CPPFLAGS
+       AC_MSG_CHECKING(if the tls_model attribute is supported)
+       AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
+               ], [
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tld_model available])
+               ], [
+                       AC_MSG_RESULT(no)
+       ])
 fi
 
 if test ${TARGET} = ARM; then
@@ -1468,7 +1505,7 @@ if test ${ACCESS_UNALIGNED} = no; then
        CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
 fi
 
-PREVIEW=no
+PREVIEW=yes
 AC_ARG_WITH(preview, [ --with-preview=yes,no     If you want to install the 2.0 FX preview],[
        if test x$with_preview = xyes; then
              PREVIEW=yes
@@ -1556,6 +1593,7 @@ AC_OUTPUT([
 Makefile
 mint.pc
 mono.pc
+scripts/mono-nunit.pc
 mono/Makefile
 mono/utils/Makefile
 mono/metadata/Makefile
@@ -1584,6 +1622,7 @@ mono/io-layer/Makefile
 mono/handles/Makefile
 mono/mini/Makefile
 mono/profiler/Makefile
+ikvm-native/Makefile
 scripts/Makefile
 man/Makefile
 web/Makefile
@@ -1608,19 +1647,24 @@ runtime/Makefile
   NONE | '${prefix}') exec_prefix=$prefix ;;
   esac
 
-  echo "prefix=$exec_prefix" > $srcdir/$mcsdir/build/config.make
+  echo "prefix=$prefix" > $srcdir/$mcsdir/build/config.make
+  echo "exec_prefix=$exec_prefix" >> $srcdir/$mcsdir/build/config.make
+  echo "mono_libdir=$exec_prefix/lib" >> $srcdir/$mcsdir/build/config.make
   echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$mcsdir/build/config.make
 )
 
+libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
+
 echo "
         mcs source:  $mcs_topdir
        GC:          $gc
-       ICU:         $enable_icu
+       Globalization:     $enable_glob
        TLS:         $with_tls
        SIGALTSTACK: $with_sigaltstack
        Engine:      $jit_status
        2.0 Alpha:   $PREVIEW
        JNI support: $jdk_headers_found
+       libgdiplus:  $libgdiplus_msg
        $disabled
 
 "