summaryrefslogtreecommitdiff
path: root/scripts/japi
blob: 52bcbc472a5f82cce8a49d12705ec3e87a7e99ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/sh

CLASSPATH_CVS=~/japi/classpath
JAPIZE_DIR=~/japitools-0.9
FTPROOT=~alpha/pub/gnu/classpath/nightly/tests
LOG=/tmp/japi.log
export PATH=${PATH}:/usr/java/j2sdk1.4.1/bin

rm -f /tmp/japi.log > /dev/null 2>&1

classpath_checkout ()
{
  if [ ! -d "${CLASSPATH_CVS}" ]; then
    mkdir --parents ${CLASSPATH_CVS}
    local dir=`dirname "${CLASSPATH_CVS}"`
    cd "${dir}"
    cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null
    if [ $? -ne 0 ]; then
      echo "Error checking out classpath"
      exit 1
    fi
  fi
}

classpath_update ()
{
  cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
  if [ $? -ne 0 ]; then
    echo "Error checking out classpath"
    exit 1
  fi
}

classpath_clean ()
{
  if [ -d "${CLASSPATH_CVS}/build" ]; then
    rm -rf "${CLASSPATH_CVS}/build"
  fi
#  if [ -d "${CLASSPATH_PREFIX}" ]; then
#    rm -rf "${CLASSPATH_PREFIX}"
#  fi
  mkdir --parents "${CLASSPATH_CVS}/build"
#  mkdir --parents "${CLASSPATH_PREFIX}"
}

classpath_configure ()
{
  cd "${CLASSPATH_CVS}"
  aclocal >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error running aclocal"
    exit 1
  fi
  autoheader >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error running autoheader"
    exit 1
  fi
  automake >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error running automake"
    exit 1
  fi
  autoconf >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error running autoconf"
    exit 1
  fi
  cd "${CLASSPATH_CVS}/build" && ../configure --with-gcj >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error configuring"
    exit 1
  fi
}

classpath_build ()
{
  cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1
  if [ $? -ne 0 ]; then
    echo "Error during make"
    exit 1
  fi
}


japize_classpath ()
{
  cd "${JAPIZE_DIR}/bin" && ./japize as classpath packages "${CLASSPATH_CVS}/build/lib/glibj.zip" +java +javax +org -java.awt.dnd.peer -java.awt.peer -org.apache -org.w3c.dom.css -org.w3c.dom.events -org.w3c.dom.html -org.w3c.dom.stylesheets -org.w3c.dom.traversal -org.w3c.dom.views -java.text.resources >> /tmp/japi.log 2>&1
  if [ $? -ne 0 ]; then
    echo "Error running japize"
    exit 1
  fi
  cp -f "${JAPIZE_DIR}/bin/classpath.japi.gz" /tmp
}

japicompat_classpath ()
{
  today=`date`
  echo "${today}" > /tmp/classpath-jdk11-compare.txt
  cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk11.japi.gz classpath.japi.gz >> /tmp/classpath-jdk11-compare.txt
  if [ $? -ne 0 ]; then
    echo "Error running japicompat"
    exit 1
  fi
  echo "${today}" > /tmp/classpath-jdk13-compare.txt
  cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk13.japi.gz classpath.japi.gz >> /tmp/classpath-jdk13-compare.txt
  if [ $? -ne 0 ]; then
    echo "Error running japicompat"
    exit 1
  fi
}

#--------------------------------------------------------------------
# Update Classpath CVS
#--------------------------------------------------------------------
classpath_checkout
classpath_update

#--------------------------------------------------------------------
# Build Classpath with GCJ 3.2
#--------------------------------------------------------------------
classpath_clean
classpath_configure
classpath_build

#--------------------------------------------------------------------
# Run japize on glibj.zip
#--------------------------------------------------------------------
japize_classpath

#--------------------------------------------------------------------
# Run japicompat against jdk13
#--------------------------------------------------------------------
japicompat_classpath