X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=configure.in;h=cfc5a897366f85d2c5ec13981e4305ca34026ec5;hb=06a578bc8d5629a6cd92d08948bb9747ad4253a1;hp=732c67da35e782fa2db3102923b9b593355a67b4;hpb=3452e61122f75f16243c4a59f11d7a708a9972e4;p=mono.git diff --git a/configure.in b/configure.in index 732c67da35e..cfc5a897366 100644 --- a/configure.in +++ b/configure.in @@ -1,37 +1,77 @@ AC_INIT(README) AC_CANONICAL_SYSTEM AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(mono, 0.16) +AM_INIT_AUTOMAKE(mono,0.24) AM_MAINTAINER_MODE +# +# These are the flags that need to be stored in the mono.pc file for +# compiling code that will embed Mono +# +libmono_cflags="" +libmono_ldflags="" +AC_SUBST(libmono_cflags) +AC_SUBST(libmono_ldflags) + # Thread configuration inspired by sleepycat's db AC_MSG_CHECKING([host platform characteristics]) +libgc_threads=no case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes AC_DEFINE(PLATFORM_WIN32) CC="gcc -mno-cygwin" HOST_CC="gcc" - CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS" + CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS" + libdl= + libgc_threads=win32 + ;; + *-*-*netbsd*) + platform_win32=no + CPPFLAGS="$CPPFLAGS -D_REENTRANT" + libmono_cflags="-D_REENTRANT" + LDFLAGS="$LDFLAGS -pthread" + libmono_ldflags="-pthread" + AC_DEFINE(NEED_LINK_UNLINK) libdl= + libgc_threads=pthreads ;; - *-*-*bsd*) + *-*-*freebsd*|*-*-*openbsd*) platform_win32=no CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + libmono_cflags="-D_THREAD_SAFE" LDFLAGS="$LDFLAGS -pthread" + libmono_ldflags="-pthread" AC_DEFINE(NEED_LINK_UNLINK) AC_DEFINE(PTHREAD_POINTER_ID) libdl= + libgc_threads=pthreads ;; *-*-linux*) platform_win32=no - CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT" + CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions" + libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT" + libmono_ldflags="-lpthread" libdl="-ldl" + libgc_threads=pthreads ;; *-*-solaris*) platform_win32=no CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT" AC_DEFINE(NEED_LINK_UNLINK) + libmono_cflags="-D_REENTRANT" + libgc_threads=solaris + ;; + *-*-darwin*) + platform_win32=no + CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE" + libmono_cflags="-D_THREAD_SAFE" + LDFLAGS="$LDFLAGS -pthread" + libmono_ldflags="-pthread" + AC_DEFINE(NEED_LINK_UNLINK) + AC_DEFINE(PTHREAD_POINTER_ID) + libdl= + libgc_threads=no ;; *) AC_MSG_WARN([*** Please add $host to configure.in checks!]) @@ -71,7 +111,7 @@ AC_HEADER_STDC AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL -AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h) +AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h) # for mono/metadata/debug-symfile.c AC_CHECK_HEADERS(elf.h) @@ -124,37 +164,86 @@ AC_SUBST(GLIB_LIBS) AC_SUBST(GMODULE_CFLAGS) AC_SUBST(GMODULE_LIBS) -AC_CHECK_HEADERS(gc.h gc/gc.h) -AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl) -gc=auto -AC_ARG_WITH(gc, [ --with-gc=boehm,none],[gc=$with_gc]) +dnl +dnl libgc checks +dnl + +AC_CONFIG_SUBDIRS(libgc) + +gc_headers=no +gc=included +use_included_gc=no + +if test -d $srcdir/libgc ; then + gc_default=included +else + gc_default=boehm +fi + +AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default]) +LIBGC_CFLAGS= +LIBGC_LIBS= +libgc_dir= case "x$gc" in - xboehm|xyes) + xboehm|xbohem|xyes) + AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes) + AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl) + if test "x$found_boehm" != "xyes"; then AC_MSG_ERROR("GC requested but libgc not found!") fi + if test "x$gc_headers" != "xyes"; then + AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.") + fi + + AC_DEFINE(HAVE_BOEHM_GC) + AC_SUBST(HAVE_BOEHM_GC) + LIBGC_LIBS="-lgc $libdl" + + AC_CHECK_FUNCS(GC_gcj_malloc) + ;; + + xincluded) + found_boehm=yes + gc_headers=yes + use_included_gc=yes + libgc_dir=libgc + + LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include' + LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la' AC_DEFINE(HAVE_BOEHM_GC) AC_SUBST(HAVE_BOEHM_GC) - LIBS="$LIBS -lgc $libdl" + + AC_DEFINE(HAVE_GC_H) + AC_DEFINE(USE_INCLUDED_LIBGC) + + # The included libgc contains GCJ support + AC_DEFINE(HAVE_GC_GCJ_MALLOC) ;; + xnone) AC_MSG_WARN("Compiling mono without GC.") ;; *) - # If libgc was found, use it. Otherwise just warn. - if test "x$found_boehm" != "xyes"; then - AC_MSG_WARN("Compiling mono without GC.") - else - AC_DEFINE(HAVE_BOEHM_GC) - AC_SUBST(HAVE_BOEHM_GC) - LIBS="$LIBS -lgc $libdl" - gc="boehm" - fi + AC_MSG_ERROR([Invalid argument to --with-gc.]) ;; esac +we_are_embedded_in_mono=yes +export we_are_embedded_in_mono +export libgc_threads + +AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes) +AC_SUBST(LIBGC_CFLAGS) +AC_SUBST(LIBGC_LIBS) +AC_SUBST(libgc_dir) + +dnl +dnl End of libgc checks +dnl + if test x$platform_win32 = xno; then dnl ****************************************************************** dnl *** Check for large file support *** @@ -279,8 +368,20 @@ if test x$platform_win32 = xno; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_STRUCT_IP_MREQN) ], [ - # We'll just have to use struct ip_mreq + # We'll just have to try and use struct ip_mreq AC_MSG_RESULT(no) + AC_MSG_CHECKING(for struct ip_mreq) + AC_TRY_COMPILE([#include ], [ + struct ip_mreq mreq; + mreq.imr_interface.s_addr = 0; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_STRUCT_IP_MREQ) + ], [ + # No multicast support + AC_MSG_RESULT(no) + ]) ]) dnl ***************************** @@ -361,24 +462,24 @@ if test x$platform_win32 = xno; then dnl ******************************** dnl *** Checks for timezone stuff ** dnl ******************************** - AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, + AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, AC_TRY_COMPILE([ #include - ], [ - timezone = 1; - ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)) - if test $ac_cv_var_timezone = yes; then - AC_DEFINE(HAVE_TIMEZONE) + ], [ + struct tm tm; + tm.tm_gmtoff = 1; + ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)) + if test $ac_cv_struct_tm_gmtoff = yes; then + AC_DEFINE(HAVE_TM_GMTOFF) else - AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, + AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, AC_TRY_COMPILE([ #include - ], [ - struct tm tm; - tm.tm_gmtoff = 1; - ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)) - if test $ac_cv_struct_tm_gmtoff = yes; then - AC_DEFINE(HAVE_TM_GMTOFF) + ], [ + timezone = 1; + ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)) + if test $ac_cv_var_timezone = yes; then + AC_DEFINE(HAVE_TIMEZONE) else AC_ERROR(unable to find a way to determine timezone) fi @@ -464,14 +565,17 @@ fi TARGET="unknown" ACCESS_UNALIGNED="yes" +JIT_SUPPORTED=no + case "$host" in #mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";; -i*86-*-*) TARGET=X86; arch_target=x86;; +i*86-*-*) TARGET=X86; arch_target=x86; JIT_SUPPORTED=yes;; sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";; #alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";; #m68k-*-linux*) TARGET=M68K;; -macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;; +macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv* | powerpc-*-darwin*) TARGET=POWERPC; arch_target=ppc; JIT_SUPPORTED=yes;; arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";; +s390-*-linux*) TARGET=S390; arch_target=s390; ACCESS_UNALIGNED="no";; esac if test ${TARGET} = unknown; then @@ -491,6 +595,9 @@ AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA) AM_CONDITIONAL(M68K, test x$TARGET = xM68K) AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC) AM_CONDITIONAL(ARM, test x$TARGET = xARM) +AM_CONDITIONAL(S390, test x$TARGET = xS390) + +AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes) LIBC="libc.so.6" AC_SUBST(LIBC) @@ -498,6 +605,7 @@ AC_SUBST(LIBC) AC_SUBST(arch_target) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) +AC_SUBST(LDFLAGS) AC_OUTPUT([ Makefile @@ -514,15 +622,17 @@ mono/os/unix/Makefile mono/arch/x86/Makefile mono/arch/ppc/Makefile mono/arch/sparc/Makefile +mono/arch/s390/Makefile mono/arch/arm/Makefile +mono/arch/alpha/Makefile mono/interpreter/Makefile mono/tests/Makefile mono/benchmark/Makefile mono/monoburg/Makefile mono/monograph/Makefile -mono/jit/Makefile mono/io-layer/Makefile mono/handles/Makefile +mono/mini/Makefile runtime/Makefile scripts/Makefile man/Makefile