changeset 3973:c871cd15d513

Allow system LCMS2 to be used to build and enable by default in generic profile.
author andrew
date Wed, 04 May 2011 11:21:58 +0100
parents 8ae719dd77c0
children 6a3e0bc5471d
files make/jdk_generic_profile.sh make/sun/cmm/lcms/FILES_c_unix.gmk make/sun/cmm/lcms/Makefile
diffstat 3 files changed, 33 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/jdk_generic_profile.sh	Tue May 03 14:32:18 2011 +0100
+++ b/make/jdk_generic_profile.sh	Wed May 04 11:21:58 2011 +0100
@@ -2,6 +2,7 @@
 
 #
 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -378,3 +379,24 @@
     export LLVM_LIBS
   fi
 fi
+
+# Export variables for system LCMS
+# LCMS_CFLAGS and LCMS_LIBS tell the compiler how to compile and
+# link against lcms2
+pkgconfig=$(which pkg-config 2>/dev/null)
+if [ -x "${pkgconfig}" ] ; then
+  if [ "${LCMS_CFLAGS}" = "" ] ; then
+    LCMS_CFLAGS=$("${pkgconfig}" --cflags lcms2)
+  fi
+  if [ "${LCMS_LIBS}" = "" ] ; then
+    LCMS_LIBS=$("${pkgconfig}" --libs lcms2)
+  fi
+fi
+if [ "${LCMS_LIBS}" = "" ] ; then
+    LIBFFI_LIBS="-llcms2"
+fi
+export LCMS_CFLAGS
+export LCMS_LIBS
+
+# IcedTea defaults; use system libraries
+export USE_SYSTEM_LCMS=true
--- a/make/sun/cmm/lcms/FILES_c_unix.gmk	Tue May 03 14:32:18 2011 +0100
+++ b/make/sun/cmm/lcms/FILES_c_unix.gmk	Wed May 04 11:21:58 2011 +0100
@@ -1,5 +1,6 @@
 #
 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,6 +24,7 @@
 # questions.
 #
 
+ifndef USE_SYSTEM_LCMS
 FILES_c = \
     cmscam02.c \
     cmscgats.c \
@@ -47,5 +49,8 @@
     cmstypes.c \
     cmsvirt.c \
     cmswtpnt.c \
-    cmsxform.c \
+    cmsxform.c
+endif
+
+FILES_c += \
     LCMS.c
--- a/make/sun/cmm/lcms/Makefile	Tue May 03 14:32:18 2011 +0100
+++ b/make/sun/cmm/lcms/Makefile	Wed May 04 11:21:58 2011 +0100
@@ -1,5 +1,6 @@
 #
 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,7 +26,7 @@
 
 BUILDDIR = ../../..
 PACKAGE = sun.java2d.cmm.lcms
-LIBRARY = lcms
+LIBRARY = javalcms
 PRODUCT = sun
 
 include $(BUILDDIR)/common/Defs.gmk
@@ -93,8 +94,9 @@
 	$(RM) $(OBJDIR)/cmm.h
 
 else
-OTHER_LDLIBS = $(LIBM) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt 
+OTHER_LDLIBS = $(LIBM) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt $(LCMS_LIBS)
 CPPFLAGS += -I$(SHARE_SRC)/native/sun/java2d \
-            -I$(SHARE_SRC)/native/sun/awt/debug
+            -I$(SHARE_SRC)/native/sun/awt/debug \
+	    $(LCMS_CFLAGS)
 endif