4 # Make sure sorting is done the same on all configurations
5 # Note the use of sort -r below. This is done explicitly to work around
6 # a gcj bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21418)
7 LC_ALL
=C
; export LC_ALL
10 abs_top_builddir
=`cd "${top_builddir}"; pwd`
11 abs_top_srcdir
=`cd "@top_srcdir@"; pwd`
13 echo "Adding java source files from srcdir '${abs_top_srcdir}'."
15 # We construct 'classes.1' as a series of lines. Each line
16 # has three fields, which are separated by spaces. The first
17 # field is the package of this class (separated by "/"s).
18 # The second field is the absolute pathname of the top-level directory
19 # for this file. E.g., it might look like
20 # "/home/jezebel/classpath/vm/reference".
21 # The third field is the file name, like "java/lang/Object.java".
22 # We do this because it makes splitting for the gcj build much
25 @FIND@ java javax gnu org sun
-follow -name '*.java' -print |
26 sort -r |
sed -e 's,/\([^/]*\)$, \1,' |
27 while read pkg
file; do
28 echo $pkg ${abs_top_srcdir} $pkg/$file
29 done) > ${top_builddir}/lib
/classes
.1
31 # The same, but for the external code.
33 ${abs_top_srcdir}/external
/w3c_dom \
34 ${abs_top_srcdir}/external
/sax \
35 ${abs_top_srcdir}/external
/relaxngDatatype \
36 ${abs_top_srcdir}/external
/jsr166 \
39 for subdir
in java javax gnu org sun
; do
40 if test -d $subdir; then
41 @FIND@
$subdir -follow -name '*.java' -print |
42 sort -r |
sed -e 's,/\([^/]*\)$, \1,' |
43 while read pkg
file; do
44 echo $pkg $dir $pkg/$file
48 done >> ${top_builddir}/lib
/classes
.1
50 # Generate files for the VM classes.
53 vm_dirlist
=`echo "@vm_classes@" | sed -e 's/:/ /g'`
54 for dir
in $vm_dirlist; do
55 echo "Adding java source files from VM directory $dir"
57 for subdir
in java javax gnu org com sun
; do
58 if test -d $subdir; then
59 @FIND@
$subdir -name '*.java' -print
61 done) |
sed -e 's,/\([^/]*\)$, \1,' |
62 while read pkg
file; do
63 echo $pkg $dir $pkg/$file >> vm.add
64 echo $pkg/$file >> vm.omit
68 # Only include generated files once.
69 if test "$abs_top_builddir" != "$abs_top_srcdir"; then
70 echo "Adding generated files in builddir '${top_builddir}'."
71 # Currently the only generated files are in gnu.*.
72 (cd ${top_builddir}; @FIND@ gnu
-follow -name '*.java' -print) |
73 sort |
sed -e 's,/\([^/]*\)$, \1,' |
74 while read pkg
file; do
75 echo $pkg $top_builddir $pkg/$file
76 done >> ${top_builddir}/lib
/classes
.1
80 cat $1.omit vm.omit
> tmp.omit
81 for dir
in $vm_dirlist; do
82 if test -f $dir/$1.omit
; then
83 cat $dir/$1.omit
>> tmp.omit
87 # Mangle the omit expressions into a script suitable for old awk.
88 # Exploit the fact that many omissions are not regular expressions:
89 # assume a single file is listed if it does not contain '*', '$',
90 # and ends in '.java'.
113 sed "$sed_omit_hash" <tmp.omit
>tmp.
awk
114 sed "$sed_omit_main_loop" <tmp.omit
>>tmp.
awk
115 @AWK@
-f tmp.
awk < ${top_builddir}/lib
/classes
.1 > ${top_builddir}/lib
/classes.tmp
116 mv ${top_builddir}/lib
/classes.tmp
${top_builddir}/lib
/classes
.1
119 for dir
in $vm_dirlist; do
120 if test -f $dir/$1.omit
; then
121 vm_omitlist
="$vm_omitlist $dir/$1.omit"
124 cat $vm_omitlist |
sed "$sed_omit_hash" > tmp.
awk
125 cat $vm_omitlist |
sed "$sed_omit_main_loop" >> tmp.
awk
126 @AWK@
-f tmp.
awk < vm.add
>>${top_builddir}/lib
/classes
.1
128 rm -f vm.omit vm.add tmp.omit tmp.
awk
131 if test -f ${top_builddir}/lib
/classes
.2; then
132 p
=`diff ${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1`
133 if test "$p" != ""; then
140 if test "$new" = "true"; then
141 cp ${top_builddir}/lib
/classes
.1 ${top_builddir}/lib
/classes
.2
142 # Strip the package part.
143 sed -e 's/^[^ ]* //' -e 's, ,/,' < ${top_builddir}/lib
/classes
.1 \
144 > ${top_builddir}/lib
/classes
145 echo "JAVA_SRCS = \\" > ${top_builddir}/lib
/java.dep
146 for i
in `cat ${top_builddir}/lib/classes` ; do
147 echo $i "\\" >> ${top_builddir}/lib
/java.dep