From 999f9a0ac51273c970d7971cb25584e53dde47ac Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 11 May 2023 15:17:56 +0300 Subject: [PATCH] Update remove-intree-libraries.sh --- SOURCES/remove-intree-libraries.sh | 57 ++++++------------------------ 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/SOURCES/remove-intree-libraries.sh b/SOURCES/remove-intree-libraries.sh index ee02f60..201a220 100644 --- a/SOURCES/remove-intree-libraries.sh +++ b/SOURCES/remove-intree-libraries.sh @@ -1,59 +1,22 @@ #!/bin/sh -# Arguments: -TREE=${1} -TYPE=${2} - -ZIP_SRC=src/java.base/share/native/libzip/zlib/ -FREETYPE_SRC=src/java.desktop/share/native/libfreetype/ -JPEG_SRC=src/java.desktop/share/native/libjavajpeg/ -GIF_SRC=src/java.desktop/share/native/libsplashscreen/giflib/ -PNG_SRC=src/java.desktop/share/native/libsplashscreen/libpng/ -LCMS_SRC=src/java.desktop/share/native/liblcms/ - -if test "x${TREE}" = "x"; then - echo "$0 (MINIMAL|FULL)"; - exit 1; -fi - -if test "x${TYPE}" = "x"; then - TYPE=minimal; -fi - -if test "x${TYPE}" != "xminimal" -a "x${TYPE}" != "xfull"; then - echo "Type must be minimal or full"; - exit 2; -fi - -echo "Removing in-tree libraries from ${TREE}" -echo "Cleansing operation: ${TYPE}"; - -cd ${TREE} +ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib +JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg +GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib +PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng +LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms echo "Removing built-in libs (they will be linked)" -# On full runs, allow for zlib & freetype having already been deleted by minimal echo "Removing zlib" -if [ "x${TYPE}" = "xminimal" -a ! -d ${ZIP_SRC} ]; then +if [ ! -d ${ZIP_SRC} ]; then echo "${ZIP_SRC} does not exist. Refusing to proceed." exit 1 fi rm -rvf ${ZIP_SRC} -echo "Removing freetype" -if [ "x${TYPE}" = "xminimal" -a ! -d ${FREETYPE_SRC} ]; then - echo "${FREETYPE_SRC} does not exist. Refusing to proceed." - exit 1 -fi -rm -rvf ${FREETYPE_SRC} - -# Minimal is limited to just zlib and freetype so finish here -if test "x${TYPE}" = "xminimal"; then - echo "Finished."; - exit 0; -fi echo "Removing libjpeg" -if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that should definitely exist +if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed." exit 1 fi @@ -134,6 +97,9 @@ if [ ! -d ${LCMS_SRC} ]; then echo "${LCMS_SRC} does not exist. Refusing to proceed." exit 1 fi +# temporary change to move bundled LCMS +if [ ! true ]; then +rm -vf ${LCMS_SRC}/cmsalpha.c rm -vf ${LCMS_SRC}/cmscam02.c rm -vf ${LCMS_SRC}/cmscgats.c rm -vf ${LCMS_SRC}/cmscnvrt.c @@ -162,5 +128,4 @@ rm -vf ${LCMS_SRC}/cmsxform.c rm -vf ${LCMS_SRC}/lcms2.h rm -vf ${LCMS_SRC}/lcms2_internal.h rm -vf ${LCMS_SRC}/lcms2_plugin.h - - +fi