common/autoconf/hotspot.m4
changeset 42510 406dfb60de57
parent 39947 0ec49c6ce9b8
child 42531 37ee95196b17
--- a/common/autoconf/hotspot.m4	Wed Nov 09 15:32:39 2016 +0100
+++ b/common/autoconf/hotspot.m4	Thu Nov 24 15:27:33 2016 +0100
@@ -111,8 +111,23 @@
     AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
   fi
 
+  # The "main" variant is the one used by other libs to link against during the
+  # build.
+  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
+    MAIN_VARIANT_PRIO_ORDER="server client minimal"
+    for variant in $MAIN_VARIANT_PRIO_ORDER; do
+      if HOTSPOT_CHECK_JVM_VARIANT($variant); then
+        JVM_VARIANT_MAIN="$variant"
+        break
+      fi
+    done
+  else
+    JVM_VARIANT_MAIN="$JVM_VARIANTS"
+  fi
+
   AC_SUBST(JVM_VARIANTS)
   AC_SUBST(VALID_JVM_VARIANTS)
+  AC_SUBST(JVM_VARIANT_MAIN)
 
   if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
     # zero behaves as a platform and rewrites these values. This is really weird. :(