* HttpChannel.cs, HttpClientChannel.cs, HttpHelper.cs, HttpServer.cs,
[mono.git] / configure.in
index d4652f727760455966f869e8f71be5843559f2ea..cfc5a897366f85d2c5ec13981e4305ca34026ec5 100644 (file)
@@ -15,6 +15,7 @@ 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
@@ -23,6 +24,7 @@ case "$host" in
                HOST_CC="gcc"
                CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
                libdl=
+               libgc_threads=win32
                ;;
        *-*-*netbsd*)
                platform_win32=no
@@ -32,6 +34,7 @@ case "$host" in
                libmono_ldflags="-pthread"
                AC_DEFINE(NEED_LINK_UNLINK)
                libdl=
+               libgc_threads=pthreads
                ;;
        *-*-*freebsd*|*-*-*openbsd*)
                platform_win32=no
@@ -42,6 +45,7 @@ case "$host" in
                AC_DEFINE(NEED_LINK_UNLINK)
                AC_DEFINE(PTHREAD_POINTER_ID)
                libdl=
+               libgc_threads=pthreads
                ;;
        *-*-linux*)
                platform_win32=no
@@ -49,12 +53,14 @@ case "$host" in
                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
@@ -65,6 +71,7 @@ case "$host" in
                AC_DEFINE(NEED_LINK_UNLINK)
                AC_DEFINE(PTHREAD_POINTER_ID)
                libdl=
+               libgc_threads=no
                ;;
        *)
                AC_MSG_WARN([*** Please add $host to configure.in checks!])
@@ -157,14 +164,32 @@ AC_SUBST(GLIB_LIBS)
 AC_SUBST(GMODULE_CFLAGS)
 AC_SUBST(GMODULE_LIBS)
 
+dnl
+dnl libgc checks
+dnl
+
+AC_CONFIG_SUBDIRS(libgc)
+
 gc_headers=no
-AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
-AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
-gc=auto
-AC_ARG_WITH(gc, [  --with-gc=boehm,none],[gc=$with_gc])
+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|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
@@ -174,30 +199,50 @@ case "x$gc" in
 
                AC_DEFINE(HAVE_BOEHM_GC)
                AC_SUBST(HAVE_BOEHM_GC)
-               LIBS="$LIBS -lgc $libdl"
+               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)
+
+               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
-                       if test "x$gc_headers" != "xyes"; then
-                               AC_MSG_ERROR("Found libgc but not its header files! You may need to install them by hand.")
-                       fi
-                       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
 
-if test "x$gc" = xboehm; then
-       AC_CHECK_FUNCS(GC_gcj_malloc)
-fi
+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 ******************************************************************
@@ -323,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 <netinet/in.h>], [
+                       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 *****************************
@@ -573,7 +630,6 @@ 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