dnl libgc checks
dnl
-dnl AC_CONFIG_SUBDIRS(libgc)
+AC_CONFIG_SUBDIRS(libgc)
gc_headers=no
gc=included
use_included_gc=no
-AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=included])
+
+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)
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_GC_H)
AC_DEFINE(USE_INCLUDED_LIBGC)
+
+ # The included libgc contains GCJ support
+ AC_DEFINE(HAVE_GC_GCJ_MALLOC)
;;
xnone)
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
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 *****************************