summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/lib/split-for-gcj.sh
blob: bda7fda8805bca695fe80b045cc906377c097c21 (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
#! /bin/sh

# Split in multiple parts for gcj.  This uses a somewhat hacky
# procedure for finding the package of a given file.
echo "Splitting for gcj"
rm -f Makefile.deps > /dev/null 2>&1
test -d lists || mkdir lists
for dir in java javax gnu org; do
   for file in `cat classes | fgrep /$dir/`; do
      pkg=`echo "$file " | sed -n -e "s,^.*/\($dir/.*\)/[^/]*$,\1,p"`
      list=lists/`echo $pkg | sed -e 's,/,-,g'`
      echo "$file" >> ${list}.list.1
      f2=`echo "$file" | sed -n -e "s,^.*/\($dir/.*\)$,\1,p"`
      f2=${f2%.java}.class
      echo "$f2: ${list}.stamp" >> Makefile.deps
      echo "${list}.list: $file" >> Makefile.deps
   done
done

# Only update a .list file if it changed.
for file in lists/*.list.1; do
   real=${file%.1}
   if ! cmp -s $real $file; then
      mv $file $real
   else
      rm $file
   fi
done
OpenPOWER on IntegriCloud