1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
3 |
|
# Arguments: <JDK TREE> <MINIMAL|FULL> |
4 |
|
TREE=${1} |
5 |
|
TYPE=${2} |
6 |
|
|
7 |
ZIP_SRC=src/java.base/share/native/libzip/zlib/ |
ZIP_SRC=src/java.base/share/native/libzip/zlib/ |
8 |
JPEG_SRC=src/java.desktop/share/native/libjavajpeg/ |
JPEG_SRC=src/java.desktop/share/native/libjavajpeg/ |
9 |
GIF_SRC=src/java.desktop/share/native/libsplashscreen/giflib/ |
GIF_SRC=src/java.desktop/share/native/libsplashscreen/giflib/ |
10 |
PNG_SRC=src/java.desktop/share/native/libsplashscreen/libpng/ |
PNG_SRC=src/java.desktop/share/native/libsplashscreen/libpng/ |
11 |
LCMS_SRC=src/java.desktop/share/native/liblcms/ |
LCMS_SRC=src/java.desktop/share/native/liblcms/ |
12 |
|
|
13 |
cd openjdk |
if test "x${TREE}" = "x"; then |
14 |
|
echo "$0 <JDK_TREE> (MINIMAL|FULL)"; |
15 |
|
exit 1; |
16 |
|
fi |
17 |
|
|
18 |
|
if test "x${TYPE}" = "x"; then |
19 |
|
TYPE=minimal; |
20 |
|
fi |
21 |
|
|
22 |
|
if test "x${TYPE}" != "xminimal" -a "x${TYPE}" != "xfull"; then |
23 |
|
echo "Type must be minimal or full"; |
24 |
|
exit 2; |
25 |
|
fi |
26 |
|
|
27 |
|
echo "Removing in-tree libraries from ${TREE}" |
28 |
|
echo "Cleansing operation: ${TYPE}"; |
29 |
|
|
30 |
|
cd ${TREE} |
31 |
|
|
32 |
echo "Removing built-in libs (they will be linked)" |
echo "Removing built-in libs (they will be linked)" |
33 |
|
|
34 |
|
# On full runs, allow for zlib having already been deleted by minimal |
35 |
echo "Removing zlib" |
echo "Removing zlib" |
36 |
if [ ! -d ${ZIP_SRC} ]; then |
if [ "x${TYPE}" = "xminimal" -a ! -d ${ZIP_SRC} ]; then |
37 |
echo "${ZIP_SRC} does not exist. Refusing to proceed." |
echo "${ZIP_SRC} does not exist. Refusing to proceed." |
38 |
exit 1 |
exit 1 |
39 |
fi |
fi |
40 |
rm -rvf ${ZIP_SRC} |
rm -rvf ${ZIP_SRC} |
41 |
|
|
42 |
|
# Minimal is limited to just zlib so finish here |
43 |
|
if test "x${TYPE}" = "xminimal"; then |
44 |
|
echo "Finished."; |
45 |
|
exit 0; |
46 |
|
fi |
47 |
|
|
48 |
echo "Removing libjpeg" |
echo "Removing libjpeg" |
49 |
if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist |
if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that should definitely exist |
50 |
echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed." |
echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed." |
51 |
exit 1 |
exit 1 |
52 |
fi |
fi |