--- configure.ac.pre-bgc 2016-09-30 23:20:44.000000000 +0200 +++ configure.ac 2016-09-30 23:28:35.952184178 +0200 @@ -161,6 +161,7 @@ target_libraries="target-libgcc \ target-libssp \ target-libquadmath \ target-libgfortran \ + target-boehm-gc \ target-libffi \ target-libobjc \ target-libada \ @@ -2054,6 +2055,28 @@ for dir in $configdirs $build_configdirs fi done +# Check for Boehm's garbage collector +AC_ARG_ENABLE(objc-gc, +[AS_HELP_STRING([--enable-objc-gc], + [enable use of Boehm's garbage collector with the + 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. + noconfigdirs="$noconfigdirs target-boehm-gc" + ;; +esac + # Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++ case ,${enable_languages}, in *,c++,*)