Blame SOURCES/remove-intree-libraries.sh

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