diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 6c4c954bdf6..b27fb1dfdea 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,7 @@ target_libraries="target-libgcc \ target-newlib \ target-libgomp \ target-libcilkrts \ + target-liboffloadmic \ target-libatomic \ target-libitm \ target-libstdc++-v3 \ @@ -456,6 +457,42 @@ ENABLE_LIBSTDCXX=default) noconfigdirs="$noconfigdirs target-libstdc++-v3" fi] +# If this is accelerator compiler and its target is intelmic we enable +# target liboffloadmic by default. If this is compiler with offloading +# for intelmic we enable host liboffloadmic by default. Otherwise +# liboffloadmic is disabled by default. +AC_ARG_ENABLE([liboffloadmic], +AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]], + [build liboffloadmic @<:@ARG={no,host,target}@:>@]), +[case "$enableval" in + no | host | target) + enable_liboffloadmic=$enableval ;; + *) + AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;; +esac], +[if test "${ENABLE_AS_ACCELERATOR_FOR}" != "no"; then + case "${target}" in + *-intelmic-* | *-intelmicemul-*) + enable_liboffloadmic=target + extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target" + ;; + *) + enable_liboffloadmic=no + ;; + esac +else + case "${enable_offload_targets}" in + *-intelmic-* | *-intelmicemul-*) + enable_liboffloadmic=host + extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host" + ;; + *) + enable_liboffloadmic=no + ;; + esac +fi]) +AC_SUBST(extra_liboffloadmic_configure_flags) + # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -541,6 +578,22 @@ if test -d ${srcdir}/libcilkrts; then fi fi +# Disable liboffloadmic on unsupported systems. +if test -d ${srcdir}/liboffloadmic; then + if test x$enable_liboffloadmic != xno; then + AC_MSG_CHECKING([for liboffloadmic support]) + if (srcdir=${srcdir}/liboffloadmic; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-liboffloadmic" + else + AC_MSG_RESULT([yes]) + fi + fi +fi + # Disable libitm on unsupported systems. if test -d ${srcdir}/libitm; then if test x$enable_libitm = x; then @@ -2063,7 +2116,7 @@ case ,${enable_languages},:${enable_objc_gc} in ;; esac -# Disable libcilkrts, libitm, libsanitizer, libvtv if we're not building C++ +# Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++ case ,${enable_languages}, in *,c++,*) # Disable libcilkrts, libitm, libsanitizer if we're not building libstdc++ @@ -2075,7 +2128,7 @@ case ,${enable_languages}, in esac ;; *) - noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer target-libvtv" + noconfigdirs="$noconfigdirs target-libcilkrts target-liboffloadmic target-libitm target-libsanitizer target-libvtv" ;; esac |