D: Do not add target_libs if phobos is disabled
authorJohannes Pfau <johannespfau@gmail.com>
Thu, 25 Apr 2019 11:22:27 +0000 (11:22 +0000)
committerJohannes Pfau <jpfau@gcc.gnu.org>
Thu, 25 Apr 2019 11:22:27 +0000 (11:22 +0000)
From-SVN: r270571

gcc/d/ChangeLog
gcc/d/config-lang.in

index a0a3266f1a2537e4eb31f973dee4b6910d69667e..d5b53679c8c354f9761aed3f5d34538d75b642a0 100644 (file)
@@ -1,3 +1,7 @@
+2019-04-25  Johannes Pfau  <johannespfau@gmail.com>
+
+       * config-lang.in: Do not add target_libs if phobos is disabled.
+
 2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
            Robin Dapp  <rdapp@linux.ibm.com>
 
index 3fe1ac42f926c73525328140c9cba0dd3b28cc92..a3f78c7e6f9b9d87f2b104e202c42c2fff8f9ee4 100644 (file)
@@ -25,7 +25,25 @@ language="d"
 
 compilers="d21\$(exeext)"
 
-target_libs="target-libphobos target-zlib target-libbacktrace"
+phobos_target_deps="target-zlib target-libbacktrace"
+phobos_target_libs="target-libphobos $phobos_target_deps"
+
+case "${noconfigdirs}" in
+  # Check if phobos was disabled as unsupported
+  *target-libphobos*)
+    disabled_target_libs="$disabled_target_libs $phobos_target_deps"
+    ;;
+  *)
+    # The --disable-<component> handler in configure.ac is called after
+    # config-lang.in. So when using --disable-libphobos, it has not been
+    # added to noconfigdirs here yet
+    if test x${enable_libphobos} != xno; then
+      target_libs="$phobos_target_libs"
+    else
+      disabled_target_libs="$disabled_target_libs $phobos_target_libs"
+    fi
+    ;;
+esac
 
 gtfiles="\$(srcdir)/d/d-tree.h \$(srcdir)/d/d-builtins.cc \$(srcdir)/d/d-lang.cc \$(srcdir)/d/modules.cc \$(srcdir)/d/typeinfo.cc"