Blame SOURCES/remove-intree-libraries.sh

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