jdk/make/jdk_generic_profile.sh
changeset 13567 b124faa29aef
parent 9035 1255eb81cc2f
child 14091 e5c8662f325d
--- a/jdk/make/jdk_generic_profile.sh	Thu Aug 09 17:49:43 2012 +0200
+++ b/jdk/make/jdk_generic_profile.sh	Wed Aug 15 14:35:36 2012 +0100
@@ -378,3 +378,22 @@
     export LLVM_LIBS
   fi
 fi
+
+# Export variables for system zlib
+# ZLIB_CFLAGS and ZLIB_LIBS tell the compiler how to compile and
+# link against zlib
+pkgconfig=$(which pkg-config 2>/dev/null)
+if [ -x "${pkgconfig}" ] ; then
+  if [ "${ZLIB_CFLAGS}" = "" ] ; then
+    ZLIB_CFLAGS=$("${pkgconfig}" --cflags zlib)
+  fi
+  if [ "${ZLIB_LIBS}" = "" ] ; then
+    ZLIB_LIBS=$("${pkgconfig}" --libs zlib)
+  fi
+fi
+if [ "${ZLIB_LIBS}" = "" ] ; then
+    ZLIB_LIBS="-lz"
+fi
+export ZLIB_CFLAGS
+export ZLIB_LIBS
+