2002-08-30 Miguel de Icaza <miguel@ximian.com>
[mono.git] / configure.in
index 10a401b3f8c19418a8cd8b6ca88754f2519f598a..2e331fc67125bc8fbe6cda4f01e7e9ed1743e667 100644 (file)
@@ -1,8 +1,7 @@
-
 AC_INIT(README)
 AC_CANONICAL_SYSTEM
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono, 0.12)
+AM_INIT_AUTOMAKE(mono, 0.15)
 AM_MAINTAINER_MODE
 
 dnl ****************************************
@@ -14,9 +13,12 @@ case "$host" in
                platform_win32=yes
                AC_DEFINE(PLATFORM_WIN32)
                CC="gcc -mno-cygwin"
+               HOST_CC="gcc"
+               libdl=
                ;;
        *)
                platform_win32=no
+               libdl="-ldl"
                ;;
 esac
 AC_MSG_RESULT($platform_win32)
@@ -27,6 +29,12 @@ AC_PROG_CC
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
 
+AC_CHECK_PROG(BISON, bison,yes,no)
+if test "x$BISON" = "xno";
+then
+       AC_MSG_ERROR([You need to install bison])
+fi
+
 dnl may require a specific autoconf version
 dnl AC_PROG_CC_FOR_BUILD
 dnl CC_FOR_BUILD not automatically detected
@@ -47,9 +55,6 @@ AM_PROG_LIBTOOL
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h)
 
-AC_CHECK_HEADERS(iconv.h)
-AC_CHECK_HEADERS(giconv.h)
-
 # for mono/metadata/debug-symfile.c
 AC_CHECK_HEADERS(elf.h)
 
@@ -98,7 +103,7 @@ AC_SUBST(GLIB_LIBS)
 AC_SUBST(GMODULE_CFLAGS)
 AC_SUBST(GMODULE_LIBS)
 
-AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes")
+AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
 gc=auto
 AC_ARG_WITH(gc, [  --with-gc=boehm,none],[gc=$with_gc])
 
@@ -110,7 +115,7 @@ case "x$gc" in
 
                AC_DEFINE(HAVE_BOEHM_GC)
                AC_SUBST(HAVE_BOEHM_GC)
-               LIBS="$LIBS -lgc"
+               LIBS="$LIBS -lgc $libdl"
                ;;
        xnone)
                AC_MSG_WARN("Compiling mono without GC.")
@@ -123,7 +128,7 @@ dnl         # If libgc was found, use it.  Otherwise just warn.
                else
                        AC_DEFINE(HAVE_BOEHM_GC)
                        AC_SUBST(HAVE_BOEHM_GC)
-                       LIBS="$LIBS -lgc"
+                       LIBS="$LIBS -lgc $libdl"
                        gc="boehm"
                fi
 dnl            AC_MSG_WARN("Compiling mono without GC.")
@@ -366,7 +371,7 @@ if test x$platform_win32 = xno; then
                        ])
                ])
                CPPFLAGS=$orig_CPPFLAGS
-               CPPFLAGS="$CPPFLAGS $pthread_CFLAGS"
+               CPPFLAGS="$CPPFLAGS -D_REENTRANT $pthread_CFLAGS"
        ], [
                AC_MSG_ERROR([libpthread is required on non-win32 hosts])
        ])
@@ -475,27 +480,6 @@ if test "x$ac_cv_have_dev_random" = "xno" \
 ***]])
 fi
  
-if test "x$cross_compiling" = "xno"; then
-# check for new iconv version
-AC_MSG_CHECKING(for new iconv)
-AC_CACHE_VAL(new_iconv,[
-       AC_TRY_RUN([#include <stdio.h> 
-               #include <iconv.h>
-               int main()
-               {
-                 exit (iconv_open ("UTF-16le", "UTF-8") == (iconv_t)-1);
-               }
-               ],
-               new_iconv=yes,new_iconv=)])
-if test -n "$new_iconv"; then
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(HAVE_NEW_ICONV)
-else
-       AC_MSG_RESULT(no)
-fi
-fi
-
 AC_MSG_CHECKING([if inter-process shared handles are requested])
 AC_ARG_ENABLE(shared-handles, [  --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
 AC_MSG_RESULT($try_shared_handles)
@@ -513,7 +497,7 @@ i*86-*-*) TARGET=X86; arch_target=x86;;
 sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
 #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
 #m68k-*-linux*) TARGET=M68K;;
-powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
+macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
 arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
 esac
 
@@ -535,6 +519,9 @@ AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
 
+LIBC="libc.so.6"
+AC_SUBST(LIBC)
+
 AC_SUBST(arch_target)
 AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
@@ -568,6 +555,8 @@ scripts/Makefile
 man/Makefile
 doc/Makefile
 docs/Makefile
+data/Makefile
+mono.spec
 ])
 
 echo "