URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [lib/] [gen-classlist.sh.in] - Rev 781
Compare with Previous | Blame | View Log
#! @SHELL@# @configure_input@# Make sure sorting is done the same on all configurations# Note the use of sort -r below. This is done explicitly to work around# a gcj bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21418)LC_ALL=C; export LC_ALLLANG=C; export LANGabs_top_builddir=`cd "${top_builddir}"; pwd`abs_top_srcdir=`cd "@top_srcdir@"; pwd`echo "Adding java source files from srcdir '${abs_top_srcdir}'."# We construct 'classes.1' as a series of lines. Each line# has three fields, which are separated by spaces. The first# field is the package of this class (separated by "/"s).# The second field is the absolute pathname of the top-level directory# for this file. E.g., it might look like# "/home/jezebel/classpath/vm/reference".# The third field is the file name, like "java/lang/Object.java".# We do this because it makes splitting for the gcj build much# cheaper.(cd @top_srcdir@@FIND@ java javax gnu org sun -follow -name '*.java' -print |sort -r | sed -e 's,/\([^/]*\)$, \1,' |while read pkg file; doecho $pkg ${abs_top_srcdir} $pkg/$filedone) > ${top_builddir}/lib/classes.1# The same, but for the external code.for dir in \${abs_top_srcdir}/external/w3c_dom \${abs_top_srcdir}/external/sax \${abs_top_srcdir}/external/relaxngDatatype \${abs_top_srcdir}/external/jsr166 \; do(cd $dirfor subdir in java javax gnu org sun; doif test -d $subdir; then@FIND@ $subdir -follow -name '*.java' -print |sort -r | sed -e 's,/\([^/]*\)$, \1,' |while read pkg file; doecho $pkg $dir $pkg/$filedonefidone)done >> ${top_builddir}/lib/classes.1# Generate files for the VM classes.: > vm.omit: > vm.addvm_dirlist=`echo "@vm_classes@" | sed -e 's/:/ /g'`for dir in $vm_dirlist; doecho "Adding java source files from VM directory $dir"(cd $dirfor subdir in java javax gnu org com sun; doif test -d $subdir; then@FIND@ $subdir -name '*.java' -printfidone) | sed -e 's,/\([^/]*\)$, \1,' |while read pkg file; doecho $pkg $dir $pkg/$file >> vm.addecho $pkg/$file >> vm.omitdonedone# Only include generated files once.if test "$abs_top_builddir" != "$abs_top_srcdir"; thenecho "Adding generated files in builddir '${top_builddir}'."# Currently the only generated files are in gnu.*.(cd ${top_builddir}; @FIND@ gnu -follow -name '*.java' -print) |sort | sed -e 's,/\([^/]*\)$, \1,' |while read pkg file; doecho $pkg $top_builddir $pkg/$filedone >> ${top_builddir}/lib/classes.1ficat $1.omit vm.omit > tmp.omitfor dir in $vm_dirlist; doif test -f $dir/$1.omit; thencat $dir/$1.omit >> tmp.omitfidone# Mangle the omit expressions into a script suitable for old awk.# Exploit the fact that many omissions are not regular expressions:# assume a single file is listed if it does not contain '*', '$',# and ends in '.java'.sed_omit_hash='1i\BEGIN {\omit[""] = 1$a\}/[*$]/d/\.java$/!ds|^| omit["|s|$|"] = 1|'sed_omit_main_loop='1i\{\if (omit[$3]) next$a\print\}/^[^*$]*\.java$/ds|/|\\/|gs|^| if ($3 ~ /|s|$|/) next|'sed "$sed_omit_hash" <tmp.omit >tmp.awksed "$sed_omit_main_loop" <tmp.omit >>tmp.awk@AWK@ -f tmp.awk < ${top_builddir}/lib/classes.1 > ${top_builddir}/lib/classes.tmpmv ${top_builddir}/lib/classes.tmp ${top_builddir}/lib/classes.1vm_omitlist=for dir in $vm_dirlist; doif test -f $dir/$1.omit; thenvm_omitlist="$vm_omitlist $dir/$1.omit"fidonecat $vm_omitlist | sed "$sed_omit_hash" > tmp.awkcat $vm_omitlist | sed "$sed_omit_main_loop" >> tmp.awk@AWK@ -f tmp.awk < vm.add >>${top_builddir}/lib/classes.1rm -f vm.omit vm.add tmp.omit tmp.awknew=if test -f ${top_builddir}/lib/classes.2; thenp=`diff ${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1`if test "$p" != ""; thennew="true"fielsenew="true"fiif test "$new" = "true"; thencp ${top_builddir}/lib/classes.1 ${top_builddir}/lib/classes.2# Strip the package part.sed -e 's/^[^ ]* //' -e 's, ,/,' < ${top_builddir}/lib/classes.1 \> ${top_builddir}/lib/classesecho "JAVA_SRCS = \\" > ${top_builddir}/lib/java.depfor i in `cat ${top_builddir}/lib/classes` ; doecho $i "\\" >> ${top_builddir}/lib/java.depdonefiexit 0
