- GNU Objective-C runtime])],
-[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
- *,objc,*:*:yes:*target-boehm-gc*)
- AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
- ;;
-esac])
-
-# Make sure we only build Boehm's garbage collector if required.
-case ,${enable_languages},:${enable_objc_gc} in
- *,objc,*:yes)
- # Keep target-boehm-gc if requested for Objective-C.
- ;;
- *)
- # Otherwise remove target-boehm-gc depending on target-libjava.
- if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
- noconfigdirs="$noconfigdirs target-boehm-gc"
+ GNU Objective-C runtime])])
+AC_ARG_WITH([target-bdw-gc],
+[AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
+ [specify prefix directory for installed bdw-gc package.
+ Equivalent to --with-target-bdw-gc-include=PATH/include
+ plus --with-target-bdw-gc-lib=PATH/lib])])
+AC_ARG_WITH([target-bdw-gc-include],
+[AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
+ [specify directories for installed bdw-gc include files])])
+AC_ARG_WITH([target-bdw-gc-lib],
+[AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
+ [specify directories for installed bdw-gc library])])
+
+case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
+ AC_MSG_CHECKING([for bdw garbage collector])
+ if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
+ dnl no bdw-gw options, assume default locations
+ AC_MSG_RESULT([using bdw-gc in default locations])
+ else
+ dnl bdw-gw options, first error checking, complete checking in libobjc
+ if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
+ elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
+ else
+ AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])