common/autoconf/toolchain.m4
changeset 14467 a973c0a1bd5d
parent 14465 d529faf5e36a
child 14614 3bb0a6b81bb9
--- a/common/autoconf/toolchain.m4	Wed Nov 28 13:40:17 2012 +0100
+++ b/common/autoconf/toolchain.m4	Wed Nov 28 13:48:36 2012 +0100
@@ -941,9 +941,11 @@
                     -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
-    # Only add client dir if client is being built. Otherwise server should
-    # be enough
-    if test "x$JVM_VARIANT_CLIENT" = xtrue; then
+    # Add server first if available. Linking aginst client does not always produce the same results.
+    # Only add client dir if client is being built. Default to server for other variants.
+    if test "x$JVM_VARIANT_SERVER" = xtrue; then
+        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+    elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
         LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
     else
         LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"