Blame SOURCES/remove-intree-libraries.sh

2578b9
#!/bin/sh
2578b9
2578b9
# Arguments: <JDK TREE> <MINIMAL|FULL>
2578b9
TREE=${1}
2578b9
TYPE=${2}
2578b9
2578b9
ZIP_SRC=src/java.base/share/native/libzip/zlib/
2578b9
JPEG_SRC=src/java.desktop/share/native/libjavajpeg/
2578b9
GIF_SRC=src/java.desktop/share/native/libsplashscreen/giflib/
2578b9
PNG_SRC=src/java.desktop/share/native/libsplashscreen/libpng/
2578b9
LCMS_SRC=src/java.desktop/share/native/liblcms/
2578b9
2578b9
if test "x${TREE}" = "x"; then
2578b9
    echo "$0 <JDK_TREE> (MINIMAL|FULL)";
2578b9
    exit 1;
2578b9
fi
2578b9
2578b9
if test "x${TYPE}" = "x"; then
2578b9
    TYPE=minimal;
2578b9
fi
2578b9
2578b9
if test "x${TYPE}" != "xminimal" -a "x${TYPE}" != "xfull"; then
2578b9
    echo "Type must be minimal or full";
2578b9
    exit 2;
2578b9
fi
2578b9
2578b9
echo "Removing in-tree libraries from ${TREE}"
2578b9
echo "Cleansing operation: ${TYPE}";
2578b9
2578b9
cd ${TREE}
2578b9
2578b9
echo "Removing built-in libs (they will be linked)"
2578b9
2578b9
# On full runs, allow for zlib having already been deleted by minimal
2578b9
echo "Removing zlib"
2578b9
if [ "x${TYPE}" = "xminimal" -a ! -d ${ZIP_SRC} ]; then
2578b9
	echo "${ZIP_SRC} does not exist. Refusing to proceed."
2578b9
	exit 1
2578b9
fi	
2578b9
rm -rvf ${ZIP_SRC}
2578b9
2578b9
# Minimal is limited to just zlib so finish here
2578b9
if test "x${TYPE}" = "xminimal"; then
2578b9
    echo "Finished.";
2578b9
    exit 0;
2578b9
fi
2578b9
2578b9
echo "Removing libjpeg"
2578b9
if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that should definitely exist
2578b9
	echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed."
2578b9
	exit 1
2578b9
fi	
2578b9
2578b9
rm -vf ${JPEG_SRC}/jcomapi.c
2578b9
rm -vf ${JPEG_SRC}/jdapimin.c
2578b9
rm -vf ${JPEG_SRC}/jdapistd.c
2578b9
rm -vf ${JPEG_SRC}/jdcoefct.c
2578b9
rm -vf ${JPEG_SRC}/jdcolor.c
2578b9
rm -vf ${JPEG_SRC}/jdct.h
2578b9
rm -vf ${JPEG_SRC}/jddctmgr.c
2578b9
rm -vf ${JPEG_SRC}/jdhuff.c
2578b9
rm -vf ${JPEG_SRC}/jdhuff.h
2578b9
rm -vf ${JPEG_SRC}/jdinput.c
2578b9
rm -vf ${JPEG_SRC}/jdmainct.c
2578b9
rm -vf ${JPEG_SRC}/jdmarker.c
2578b9
rm -vf ${JPEG_SRC}/jdmaster.c
2578b9
rm -vf ${JPEG_SRC}/jdmerge.c
2578b9
rm -vf ${JPEG_SRC}/jdphuff.c
2578b9
rm -vf ${JPEG_SRC}/jdpostct.c
2578b9
rm -vf ${JPEG_SRC}/jdsample.c
2578b9
rm -vf ${JPEG_SRC}/jerror.c
2578b9
rm -vf ${JPEG_SRC}/jerror.h
2578b9
rm -vf ${JPEG_SRC}/jidctflt.c
2578b9
rm -vf ${JPEG_SRC}/jidctfst.c
2578b9
rm -vf ${JPEG_SRC}/jidctint.c
2578b9
rm -vf ${JPEG_SRC}/jidctred.c
2578b9
rm -vf ${JPEG_SRC}/jinclude.h
2578b9
rm -vf ${JPEG_SRC}/jmemmgr.c
2578b9
rm -vf ${JPEG_SRC}/jmemsys.h
2578b9
rm -vf ${JPEG_SRC}/jmemnobs.c
2578b9
rm -vf ${JPEG_SRC}/jmorecfg.h
2578b9
rm -vf ${JPEG_SRC}/jpegint.h
2578b9
rm -vf ${JPEG_SRC}/jpeglib.h
2578b9
rm -vf ${JPEG_SRC}/jquant1.c
2578b9
rm -vf ${JPEG_SRC}/jquant2.c
2578b9
rm -vf ${JPEG_SRC}/jutils.c
2578b9
rm -vf ${JPEG_SRC}/jcapimin.c
2578b9
rm -vf ${JPEG_SRC}/jcapistd.c
2578b9
rm -vf ${JPEG_SRC}/jccoefct.c
2578b9
rm -vf ${JPEG_SRC}/jccolor.c
2578b9
rm -vf ${JPEG_SRC}/jcdctmgr.c
2578b9
rm -vf ${JPEG_SRC}/jchuff.c
2578b9
rm -vf ${JPEG_SRC}/jchuff.h
2578b9
rm -vf ${JPEG_SRC}/jcinit.c
2578b9
rm -vf ${JPEG_SRC}/jconfig.h
2578b9
rm -vf ${JPEG_SRC}/jcmainct.c
2578b9
rm -vf ${JPEG_SRC}/jcmarker.c
2578b9
rm -vf ${JPEG_SRC}/jcmaster.c
2578b9
rm -vf ${JPEG_SRC}/jcparam.c
2578b9
rm -vf ${JPEG_SRC}/jcphuff.c
2578b9
rm -vf ${JPEG_SRC}/jcprepct.c
2578b9
rm -vf ${JPEG_SRC}/jcsample.c
2578b9
rm -vf ${JPEG_SRC}/jctrans.c
2578b9
rm -vf ${JPEG_SRC}/jdtrans.c
2578b9
rm -vf ${JPEG_SRC}/jfdctflt.c
2578b9
rm -vf ${JPEG_SRC}/jfdctfst.c
2578b9
rm -vf ${JPEG_SRC}/jfdctint.c
2578b9
rm -vf ${JPEG_SRC}/jversion.h
2578b9
rm -vf ${JPEG_SRC}/README
2578b9
2578b9
echo "Removing giflib"
2578b9
if [ ! -d ${GIF_SRC} ]; then
2578b9
	echo "${GIF_SRC} does not exist. Refusing to proceed."
2578b9
	exit 1
2578b9
fi	
2578b9
rm -rvf ${GIF_SRC}
2578b9
2578b9
echo "Removing libpng"
2578b9
if [ ! -d ${PNG_SRC} ]; then
2578b9
	echo "${PNG_SRC} does not exist. Refusing to proceed."
2578b9
	exit 1
2578b9
fi	
2578b9
rm -rvf ${PNG_SRC}
2578b9
2578b9
echo "Removing lcms"
2578b9
if [ ! -d ${LCMS_SRC} ]; then
2578b9
	echo "${LCMS_SRC} does not exist. Refusing to proceed."
2578b9
	exit 1
2578b9
fi
2578b9
rm -vf ${LCMS_SRC}/cmscam02.c
2578b9
rm -vf ${LCMS_SRC}/cmscgats.c
2578b9
rm -vf ${LCMS_SRC}/cmscnvrt.c
2578b9
rm -vf ${LCMS_SRC}/cmserr.c
2578b9
rm -vf ${LCMS_SRC}/cmsgamma.c
2578b9
rm -vf ${LCMS_SRC}/cmsgmt.c
2578b9
rm -vf ${LCMS_SRC}/cmshalf.c
2578b9
rm -vf ${LCMS_SRC}/cmsintrp.c
2578b9
rm -vf ${LCMS_SRC}/cmsio0.c
2578b9
rm -vf ${LCMS_SRC}/cmsio1.c
2578b9
rm -vf ${LCMS_SRC}/cmslut.c
2578b9
rm -vf ${LCMS_SRC}/cmsmd5.c
2578b9
rm -vf ${LCMS_SRC}/cmsmtrx.c
2578b9
rm -vf ${LCMS_SRC}/cmsnamed.c
2578b9
rm -vf ${LCMS_SRC}/cmsopt.c
2578b9
rm -vf ${LCMS_SRC}/cmspack.c
2578b9
rm -vf ${LCMS_SRC}/cmspcs.c
2578b9
rm -vf ${LCMS_SRC}/cmsplugin.c
2578b9
rm -vf ${LCMS_SRC}/cmsps2.c
2578b9
rm -vf ${LCMS_SRC}/cmssamp.c
2578b9
rm -vf ${LCMS_SRC}/cmssm.c
2578b9
rm -vf ${LCMS_SRC}/cmstypes.c
2578b9
rm -vf ${LCMS_SRC}/cmsvirt.c
2578b9
rm -vf ${LCMS_SRC}/cmswtpnt.c
2578b9
rm -vf ${LCMS_SRC}/cmsxform.c
2578b9
rm -vf ${LCMS_SRC}/lcms2.h
2578b9
rm -vf ${LCMS_SRC}/lcms2_internal.h
2578b9
rm -vf ${LCMS_SRC}/lcms2_plugin.h
2578b9
2578b9