FP control word enum.
[mono.git] / configure.in
index 88aa1fc3e73f293253249d5659fe1fdbf1a00a02..cfc5a897366f85d2c5ec13981e4305ca34026ec5 100644 (file)
@@ -171,16 +171,25 @@ 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=boehm
+gc=included
 use_included_gc=no
-AC_ARG_WITH(gc, [  --with-gc=boehm,included,none],[gc=$with_gc])
+
+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
@@ -191,44 +200,37 @@ case "x$gc" in
                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/libgc.la'
+               LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
 
                AC_DEFINE(HAVE_BOEHM_GC)
-               AC_DEFINE(USE_INCLUDED_LIBGC)
                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
@@ -236,6 +238,7 @@ 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
@@ -365,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 *****************************