Blame SOURCES/remove-intree-libraries.sh

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