You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by dl...@apache.org on 2005/10/28 11:16:06 UTC

svn commit: r329169 - in /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM: config.sh roster.sh

Author: dlydick
Date: Fri Oct 28 02:15:45 2005
New Revision: 329169

URL: http://svn.apache.org/viewcvs?rev=329169&view=rev
Log:
Replaced build script support with new and
flexible Makefile support.

Split roster generation out into 'roster.sh',
which is also supported by the Makefiles.

Added:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh   (with props)
Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/config.sh

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/config.sh
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/config.sh?rev=329169&r1=329168&r2=329169&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/config.sh (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/config.sh Fri Oct 28 02:15:45 2005
@@ -22,7 +22,7 @@
 # <b>(4)</b> Startup Library (bootclasspath) Java classes
 # </li>
 # <li>
-# <b>(5)</b> Source code build-- Invokes 'build.sh', which may be
+# <b>(5)</b> Source code build-- Invokes 'make' which may be
 #                         used for all further compilations.
 # </li>
 # </ul>
@@ -218,10 +218,10 @@
 echo ""
 echo "Over the course of the development cycle, you may add or delete"
 echo "source files:  Java source, C source, C headers, perhaps shell"
-echo "scripts.  When this is done, the 'build.sh' scripts will"
-echo "automatically pick up the changes after this script is run."
-echo "The changes will be made available to the 'doxygen' and 'gcc'"
-echo "as coordinated by the 'config/config_roster*' files, and"
+echo "scripts.  When this is done, the 'make' process will autmatically"
+echo "pick up the changes after this script is run.  The changes"
+echo "will be made available to the 'doxygen' and 'gcc' as"
+echo "coordinated by the 'config/config_roster*' files, and"
 echo "without assistance required from users."
 echo ""
 echo "The 'README' file in this directory contains much useful"
@@ -232,20 +232,45 @@
 echo ""
 echo "This project was originally developed on a Solaris 9 platform."
 echo "All C code was originally compiled there with the GCC C compiler."
-echo "Your GCC compiler is located in"
+echo "Your GCC compiler is located in:"
 echo ""
 echo "\$ which gcc"
 which gcc
 echo ""
-echo "If not found, the source be located at www.gnu.org.  Please use"
-echo "version 3.3.2 or newer.  There are also compiled binary editions"
-echo "of GCC available from numerous hardware vendors and/or their"
-echo "user groups."
+echo "Please use version 3.3.2 or newer."
 echo ""
 $echon "ready... $echoc"
 read dummy
 echo ""
-echo "The 'build.sh dox' facility extracts the documentation from the"
+echo "The project is built with GNU 'make'.  It is found in:"
+echo ""
+echo "\$ which make"
+which make
+echo ""
+echo "Please use version 3.80 or newer.  If one or both of these"
+echo "programs is not installed, the source may be located at"
+echo "www.gnu.org.  There are also compiled binary editions of"
+echo "the GNU programs 'gcc' and 'make'  available from numerous"
+echo "hardware vendors and/or their user groups."
+echo ""
+$echon "ready... $echoc"
+read dummy
+echo ""
+echo "The 'C' source code for the project may have its dependencies"
+echo "checked at compilation time by the common utility 'makedepend."
+echo ""
+echo "\$ which makedepend"
+which makedepend
+echo ""
+echo "This is commonly available on many platforms and is available"
+echo "in several versions, all of which accomplish the same task."
+echo "Its absence will not interfere with correct compilation, but"
+echo "a message may appear warning that is is missing."
+echo ""
+$echon "ready... $echoc"
+read dummy
+echo ""
+echo "The 'make dox' facility extracts the documentation from the"
 echo "source code using 'doxygen'.  On your system, it is located in:"
 echo ""
 echo "\$ which doxygen"
@@ -278,13 +303,13 @@
 echo ""
 echo "This documentation may also be derived from the source code at"
 echo "any time by invoking the top-level project build option"
-echo "'build.sh dox' or 'build.sh all'."
+echo "'make dox' or 'make all'."
 echo ""
 echo "Developers working only on documentation may wish to _not_"
 echo "install it, while most others may wish to do so for a starting"
 echo "point for their work.  (Remember that documentation of source"
 echo "files, functions, data types, and data structures is all part"
-echo "of the development process.  Running 'build.sh dox' will refresh"
+echo "of the development process.  Running 'make dox' will refresh"
 echo "the documentation suite with your current work.)"
 echo ""
 $echon "more... $echoc"
@@ -292,7 +317,7 @@
 echo ""
 echo "Once installed in the 'doc' directory, this information will"
 echo "promptly be moved to a 'doc.ORIG' directory as a read-only"
-echo "reference that is not changed during 'build.sh' operations."
+echo "reference that is not changed during 'make' operations."
 echo "All documentation builds write their output to the 'doc'"
 echo "directory, leaving 'doc.ORIG' untouched.  If you will be"
 echo "regularly working with documentation changes, or if you do"
@@ -718,6 +743,31 @@
 "Valid operating system-specific JDK header file directory:  $osJDKdir"
 
 echo ""
+echo "$PGMNAME:  Choose a compiler"
+echo ""
+echo "            gcc--   Uses GNU 'C' compiler"
+echo "            other-- Use anything not on this list, default 'gcc'"
+
+while true
+do
+    echo ""
+    $echon "C compiler: [gcc,other] $echoc"
+    read ccompiler
+
+    case $ccompiler in
+        gcc)     CCOMPILER="GCC";;
+        other)   CCOMPILER="OTHER";;
+
+        *)       echo ""
+                 echo "C compiler '$ccompiler' invalid"
+                 echo ""
+                 continue;;
+    esac
+    break
+done
+
+
+echo ""
 echo "$PGMNAME:  Choose a heap allocation method:"
 echo ""
 echo "            simple-- Uses malloc(3) and free(3) only"
@@ -836,11 +886,11 @@
 echo ""
 echo "The code may be partitioned into several components and built"
 echo "either all at once and/or by its various parts.  The top-level"
-echo "build script has these same options, and using 'build.sh cfg'"
+echo "build script has these same options, and using 'make cfg'"
 echo "will build what is requested here in addition to individual"
-echo "selections.  The default option is 'build.sh cfg'.  Choosing"
+echo "selections.  The default option is 'make cfg'.  Choosing"
 echo "'all' declares that all components are to be built by the"
-echo "default build option 'build.sh cfg'."
+echo "default build option 'make cfg'."
 echo ""
 $echon "more... $echoc"
 read dummy
@@ -868,7 +918,7 @@
 echo "for creating the JVM in a binary and adding test cases."
 echo ""
 
-SHOULDBUILD="Should 'build.sh' construct"
+SHOULDBUILD="Should 'make' construct"
 MSG80ALL="all:  $SHOULDBUILD the entire code tree?"
 MSG80JVM="jvm:  $SHOULDBUILD the main develoment area?"
 MSG80LIB="lib:  $SHOULDBUILD the static JVM library?"
@@ -892,12 +942,10 @@
 
     case $buildall in
         y|ye|yes|Y|YE|YES)
-           BUILD_ALLCODE=1
+           # All 'BUILD_xxx' vars are set to 1 above
            ;;
 
         n|no|N|NO)
-           BUILD_ALLCODE=0
-
            echo  ""
            $echon "$MSG80JVM [y,n] $echoc"
            read buildjvm
@@ -959,7 +1007,7 @@
 echo "generated, it gets stored into the 'doc' directory without regard"
 echo "for previous contents.  It may be generated either through the"
 echo "pre-configured build process (per above question) or by direct"
-echo "action from the top-level build command 'build.sh dox'.  When"
+echo "action from the top-level build command 'make dox'.  When"
 echo "time comes to generate documentation, there are several formats"
 echo "available.  Most options may be used in combination to yield only"
 echo "the desired formats.  Choosing 'all' configures every format."
@@ -1020,7 +1068,7 @@
 
 
 
-SHOULDBUILD="Should 'build.sh dox' build"
+SHOULDBUILD="Should 'make dox' build"
 MSG80ALL="all:    $SHOULDBUILD docs in every format?"
 MSG80HTML="html:   $SHOULDBUILD HTML format docs (doc/html) ?"
 MSG80LATEX="latex:  $SHOULDBUILD Latex info format docs (doc/latex) ?"
@@ -1097,7 +1145,7 @@
 echo ""
 
 echo ""
-MSG80="the configured components after configuration?"
+MSG80="the configured components after configuration"
 $echon "Do you wish to build ${MSG80}? [y,n] $echoc"
 read buildnow
 echo ""
@@ -1135,7 +1183,7 @@
             echo "This latter also contains the source distribution."
             echo ""
             echo "The documentation can be generated from the source"
-            echo "itself using 'build.sh dox' at any time."
+            echo "itself using 'make dox' at any time."
             echo ""
             $echon "ready... $echoc"
             read dummy
@@ -1201,6 +1249,10 @@
 #
 # (Phase 2 did setup and run all above.)
 #
+if test -d config/.
+then
+    chmod -R +w config/.
+fi
 rm -rf config
 if test -d config/.
 then
@@ -1502,6 +1554,30 @@
     echo "#define CONFIG_HACKED_BOOTCLASSPATH \"$PGMDIR/bootclasspath\""
     echo ""
 
+  if test -z "$CCOMPILER"
+  then
+    echo ""
+    echo "/*!"
+    echo " * @internal There is no C compiler configured"
+    echo " *"
+    echo " */"
+  else
+    echo ""
+    echo "/*!"
+    echo " * @def CONFIG_CCOMPILER_$CCOMPILER"
+    echo " * @brief C Compiler"
+    echo " *"
+    echo " * This value may be @b gcc or @b other."
+    echo " *"
+    echo " * @b gcc means use GNU C compiler"
+    echo " *"
+    echo " * @b other means use the default as specified in"
+    echo " *          @link ./MakeRules ./MakeRules@endlink"
+    echo " *"
+    echo " */"
+    echo "#define CONFIG_CCOMPILER_$CCOMPILER"
+  fi
+
   if test -z "$HEAPALLOC"
   then
     echo ""
@@ -1577,244 +1653,27 @@
 
 # Set up include path for the current tree, the configuration,
 # the JVM tree, and the JDK tree.
-INCLUDE_PATHS="\
-  -Iinclude \
-  -I$PGMDIR/config \
-  -I$PGMDIR/jvm/include \
-  -I$JAVA_HOME/include \
-  -I$JAVA_HOME/include/$osJDKdir"
-
-CONSTANT_GCC_OPTIONS="-O0 -g3 -Wall -fmessage-length=0 -ansi"
-
-ALWAYS_REQUIRED_GCC_OPTIONS="\
-  -m$WORDWIDTH \
-  $INCLUDE_PATHS \
-  $CONSTANT_GCC_OPTIONS"
-
-ALWAYS_REQUIRED_GCCLD_OPTIONS="-m$WORDWIDTH -lpthread -lm"
-
-# Formerly needed:            -fpack-struct   ... Try to NEVER need it!
-USUALLY_REQUIRED_GCC_OPTIONS=""
-
-COAG="config/config_opts_always.gcc"
-(
-    echo "$ALWAYS_REQUIRED_GCC_OPTIONS"
-
-) > $COAG
-
-chmod -w $COAG
-
-COUG="config/config_opts_usually.gcc"
-(
-    echo "$USUALLY_REQUIRED_GCC_OPTIONS"
-
-) > $COUG
-
-chmod -w $COUG
-
-LOAG="config/config_opts_always.gccld"
-(
-    echo "$ALWAYS_REQUIRED_GCCLD_OPTIONS"
-
-) > $LOAG
-
-chmod -w $LOAG
-
-USEDOX="for 'dox.sh'"
-USEDOXBLD="for 'dox.sh' and 'build.sh'"
-USEBLDCLN="for 'build.sh' and 'clean.sh'"
-
-CRCD="config/config_roster_c.dox"
-(
-    echo "#"
-    echo "# Roster of source files $USEDOXBLD"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT=\\"
-    for f in `ls -1 jvm/src/*.c`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CRCD
-
-chmod -w $CRCD
-
-CRHD="config/config_roster_h.dox"
-(
-    echo "#"
-    echo "# Roster of header files $USEDOX"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT+=\\"
-    echo "    config/config.h \\"
-    for f in main/src/main.c `ls -1 jvm/src/*.h`
-    do
-        echo "    $f \\"
-    done
-
-    for f in `ls -1 jvm/include/*.h`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CRHD
-
-chmod -w $CRHD
+JAVA_INCLUDE_PATHS="-I$(JAVA_HOME)/include \
+  -I$(JAVA_HOME)/include/$osJDKdir"
 
-CJCD="config/config_roster_jni_c.dox"
-(
-    echo "#"
-    echo "# Roster of JNI sample C source files $USEDOXBLD"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT+=\\"
-    for f in `ls -1 jni/src/harmony/generic/0.0/src/*.c`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CJCD
-
-chmod -w $CJCD
-
-CJHD="config/config_roster_jni_h.dox"
-(
-    echo "#"
-    echo "# Roster of JNI sample C header files $USEDOX"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT+=\\"
-    for f in `ls -1 jni/src/harmony/generic/0.0/include/*.h`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CJHD
-
-chmod -w $CJHD
-
-CJJD="config/config_roster_jni_java.dox"
-(
-    echo "#"
-    echo "# Roster of JNI sample Java source files $USEDOXBLD"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT+=\\"
-    for f in \
-        `find jni/src/harmony/generic/0.0/src -name \*.java -print`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CJJD
-
-chmod -w $CJJD
-
-CTJD="config/config_roster_test_java.dox"
-(
-    echo "#"
-    echo "# Roster of test Java source files $USEDOXBLD"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
-    echo "#"
-    echo "INPUT+=\\"
-    for f in \
-        `find test/src -name \*.java -print`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CTJD
+USEDOX="for 'dox.sh' and 'gmake dox'"
+USEBLDCLN="for 'gmake all' and 'gmake clean'"
 
-chmod -w $CTJD
-
-CUSD="config/config_roster_sh.dox"
+CBSD="config/config_build_steps.sh"
+CBSM="config/config_build_steps.mak"
 (
     echo "#"
-    echo "# Roster of shell scripts $USEDOX"
+    echo "# Code build steps configured by user"
+    echo "# $USEBLDCLN"
     echo "#"
     echo "# Auto-generated by $PGMNAME"
     echo "# on $THISDATE:"
     echo "# DO NOT MODIFY!"
     echo "#"
-    echo "INPUT+=\\"
-    # Have ./*.sh listed _LAST_ due to Doxygen bug that points
-    # reference to them off to last `basename X` in list.
-    # Unfortunately, this bug also produces blank documentation,
-    # but at least the annotations are present and point to the
-    # right page. The bug has something to do with multiple files
-    # named 'build.sh' et al and having one of these in the top-level
-    # directory.  It wants more path name clarification, but does
-    # not seem to like even absolute path names.  The other scripts
-    # in the top-level directory are properly parsed.
-    #
-    # Notice that 'jvm/*.sh' have the relative path prefix './' attached
-    # to the front of the @@file directive.  This is to avoid an
-    # interesting sensitivity in Doxygen that got confused between
-    # 'jvm/filename.sh' and 'libjvm/filename.sh' and failed to produce
-    # the "File List" entry for the 'jvm/*.sh' files in question,
-    # namely its build scripts.  By marking them './jvm/build.sh' et al,
-    # this behavior went away.  This same comment may be found in each
-    # of those scripts.
-    #
-    # Even with them listed last, the '@ f i l e' directive still
-    # must have an absolute path name for the documentation to
-    # be properly parsed.
-    #
-    for f in `ls -1 */build.sh */clean.sh */common.sh; \
-              ls -1 jni/src/*/*/*/build.sh; \
-              ls -1 jni/src/*/*/*/clean.sh; \
-              ls -1 jni/src/*/*/*/common.sh; \
-              ls -1 $PGMDIR/[A-Z]*; \
-              ls -1 $PGMDIR/*.sh`
-    do
-        echo "    $f \\"
-    done
-    echo ""
-    echo "# EOF"
-
-) > $CUSD
-
-chmod -w $CUSD
-
-CBSD="config/config_build_steps.sh"
+) | tee $CBSD > $CBSM
 (
-    echo "#"
-    echo "# Code build steps configured by user $USEBLDCLN"
-    echo "#"
-    echo "# Auto-generated by $PGMNAME"
-    echo "# on $THISDATE:"
-    echo "# DO NOT MODIFY!"
+    echo "CONFIG_REPOSITORY=\"https://svn.apache.org/repos/asf/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/\""
+    echo "export CONFIG_REPOSITORY"
     echo "#"
     echo "CONFIG_WORDWIDTH=\"$wordwidth\""
     echo "export CONFIG_WORDWIDTH"
@@ -1828,7 +1687,18 @@
     echo "CONFIG_RELEASE_LEVEL=\"$RELEASE_LEVEL\""
     echo "export CONFIG_RELEASE_LEVEL"
     echo "#"
-    echo "CONFIG_BUILD_ALLCODE=$BUILD_ALLCODE"
+    echo \
+      "CONFIG_BUILD_HTML_ADJUST_NETSCAPE47X=$BUILD_HTML_ADJ_NETSCAPE47X"
+    echo "export CONFIG_BUILD_HTML_ADJUST_NETSCAPE47X"
+    echo "#"
+) >> $CBSD
+(
+    echo "CONFIG_WORDWIDTH=$wordwidth"
+    echo "#"
+    echo "JAVA_INCLUDE_PATHS:=$JAVA_INCLUDE_PATHS"
+    echo "#"
+) >> $CBSM
+(
     echo "CONFIG_BUILD_JVM=$BUILD_JVM"
     echo "CONFIG_BUILD_LIB=$BUILD_LIB"
     echo "CONFIG_BUILD_MAIN=$BUILD_MAIN"
@@ -1836,15 +1706,13 @@
     echo "CONFIG_BUILD_JNI=$BUILD_JNI"
     echo "CONFIG_BUILD_DOX=$BUILD_DOX"
     echo "#"
- echo "CONFIG_BUILD_HTML_ADJUST_NETSCAPE47X=$BUILD_HTML_ADJ_NETSCAPE47X"
-    echo "#"
     echo "# EOF"
+) | tee -a $CBSD >> $CBSM
 
-) > $CBSD
-
-chmod -w $CBSD
+chmod -w $CBSD $CBSM
 
 CDSD="config/config_dox_setup.dox"
+CDSM="config/config_dox_setup.mak"
 (
     echo "#"
     echo "# documentation build steps configured by user $USEDOX"
@@ -1863,9 +1731,20 @@
     echo ""
     echo "# EOF"
 
-) > $CDSD
+) | tee $CDSD > $CDSM
+
+chmod -w $CDSD $CDSM
+
+(
+    roster.sh
+    echo "$PGMNAME:  Compile configuration:         $CFGH"
+    echo "$PGMNAME:  Code build steps:              $CBSD"
+    echo "                                           $CBSM"
+    echo "$PGMNAME:  Documentation build steps:     $CDSD"
+    echo "                                           $CDSM"
+    echo ""
+) | more
 
-chmod -w $CDSD
 
 #############################
 #
@@ -2073,74 +1952,8 @@
 
 #############################
 #
-# END set up 'bootclasspath' directory.  Now report config results:
+# END set up 'bootclasspath' directory.
 #
-(
-    BLDS="build.sh ... in selected locations"
-    CLNS="clean.sh ... in selected locations"
-    CMNS="common.sh ... in selected locations"
-
-    echo ""
-
-    # Change to 'if true' if auto-generated file result printout desired
-    if false
-    then
-        echo "Auto-generated compile header definitions:"
-        echo ""
-        echo "---"
-        cat $CFGH
-        echo "---"
-        echo ""
-        echo "Auto-generated compiler invocation options:"
-        echo "    "
-        echo "--- GCC options always required:"
-        cat $COAG
-        echo "--- GCC options usually required:"
-        cat $COUG
-        echo "--- GCC linker options always required:"
-        cat $LOAG
-        echo "--- Source files:"
-        cat $CRCD
-        echo "--- Header files"
-        cat $CRHD
-        echo "--- JNI sample C source files:"
-        cat $CJCD
-        echo "--- JNI sample C header files:"
-        cat $CJHD
-        echo "--- JNI sample Java source files:"
-        cat $CJJD
-        echo "--- Test Java source files:"
-        cat $CTJD
-        echo "--- utility shell scripts"
-        cat $CUSD
-        echo "--- code build steps"
-        cat $CBSD
-        echo "--- documentation build steps"
-        cat $CDSD
-        echo "--- project build steps"
-    else
-        echo "$PGMNAME:  Compile configuration:         $CFGH"
-        echo "$PGMNAME:  GCC options always used:       $COAG"
-        echo "$PGMNAME:  GCC options usually used:      $COUG"
-        echo "$PGMNAME:  GCC linker opts (always):      $LOAG"
-        echo "$PGMNAME:  Source files:                  $CRCD"
-        echo "$PGMNAME:  Header files:                  $CRHD"
-        echo "$PGMNAME:  Sample JNI C source files:     $CJCD"
-        echo "$PGMNAME:  Sample JNI C header files:     $CJHD"
-        echo "$PGMNAME:  Sample JNI Java source files:  $CJJD"
-        echo "$PGMNAME:  Test Java source files:        $CTJD"
-        echo "$PGMNAME:  Utility shell scripts:         $CUSD"
-        echo "$PGMNAME:  Code build steps:              $CBSD"
-        echo "$PGMNAME:  Documentation build steps:     $CDSD"
-    fi
-
-    echo "$PGMNAME:  Build scripts:                 $BLDS"
-    echo "$PGMNAME:  Clean build scripts:           $CLNS"
-    echo "$PGMNAME:  Common build scripts:          $CMNS"
-    echo ""
-) | more
-
-
 echo ""
 $echon "$PGMNAME: Starting to build... $echoc"
 sleep 3
@@ -2156,7 +1969,7 @@
 echo ""
 echo "$PGMNAME:  Cleaning out entire tree of anything left over"
 echo ""
-./clean.sh all
+make clean
 rc=$?
 
 
@@ -2165,7 +1978,7 @@
         echo ""
         echo "$PGMNAME:  Building configured components"
         echo ""
-        ./build.sh cfg
+        make cfg
         rc=$?
         ;;
     *)  ;;

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh?rev=329169&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh Fri Oct 28 02:15:45 2005
@@ -0,0 +1,344 @@
+#!/bin/sh
+#
+#!
+# @file ./roster.sh
+#
+# @brief Boot JVM configuration file roster generator.
+#
+# Shell script to enumerate the files in the project for use by
+# configuration script @link ./config.sh ./config.sh@endlink and
+# for when files are added or deleted.  This information is used
+# by all every @link ./Makefile Makefile@endlink and by the
+# document compiler @c @b doxygen .
+#
+# Remember that if you add a Java source file, a C source or header
+# file, or a shell script, or @e any other type of file that needs
+# to either be compiled or incorporated into the documentation, you
+# should run this script again so that the @b config directory roster
+# locates the update.  This way, 'doxygen' will automatically
+# incorporate it into the documentation suite.
+#
+# @todo  HARMONY-6-roster.sh-1 A Windows .BAT version of this
+#        script needs to be written
+#
+#
+# @section Control
+#
+# \$URL: https://svn.apache.org/repos/asf/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh $
+#
+# \$Id: roster.sh 327202 2005-10-21 14:50:11Z dlydick $
+#
+# Copyright 2005 The Apache Software Foundation
+# or its licensors, as applicable.
+#
+# Licensed under the Apache License, Version 2.0 ("the License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+# either express or implied.
+#
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# @version \$LastChangedRevision: 327202 $
+#
+# @date \$LastChangedDate: 2005-10-21 09:50:11 -0500 (Fri, 21 Oct 2005) $
+#
+# @author \$LastChangedBy: dlydick $
+#
+# @section Reference
+#
+#/ /* 
+# (Use  #! and #/ with dox_filter.sh to fool Doxygen into
+# parsing this non-source text file for the documentation set.
+# Use the above open comment to force termination of parsing
+# since it is not a Doxygen-style 'C' comment.)
+#
+#
+###################################################################
+#
+# Script setup
+#
+
+# `dirname $0` for shells without that utility
+PGMDIR=`expr "${0:-.}/" : '\(/\)/*[^/]*//*$'  \| \
+             "${0:-.}/" : '\(.*[^/]\)//*[^/][^/]*//*$' \| .`
+PGMDIR=`cd $PGMDIR; pwd`
+
+# `basename $0` for shells without that utility
+PGMNAME=`expr "/${0:-.}" : '\(.*[^/]\)/*$' : '.*/\(..*\)' \|\
+              "/${0:-.}" : '\(.*[^/]\)/*$' : '.*/\(..*\)' \| \
+              "/${0:-.}" : '.*/\(..*\)'`
+
+THISDATE=`date`
+
+if test ! -d config
+then
+    echo "$PGMNAME:  Directory '$PGMDIR/config' not found."
+    echo "$PGMNAME:  Please first run '$PGMDIR/config.sh'."
+    exit 1
+fi
+
+###################################################################
+#
+# Create project roster files
+#
+USEDOX="for 'dox.sh' and 'gmake dox'"
+USEDOXBLD="for 'dox.sh' and 'gmake all' and 'gmake clean'"
+
+CRCD="config/config_roster_c.dox"
+CRCM="config/config_roster_c.mak"
+rm -f $CRCD $CRCM
+(
+    echo "#"
+    echo "# Roster of source files"
+    echo "# $USEDOXBLD"
+    echo "#"
+    echo "# for directory jvm/src"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+    echo "INPUT=\\"
+    for f in jvm/src/*.c
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee $CRCD | \
+    grep -v jvm/src/main.c | \
+    sed 's/^INPUT=/C_SOURCES:=/;s,jvm/src/,,' > $CRCM
+
+chmod -w $CRCD $CRCM
+
+CRHD="config/config_roster_h.dox"
+CRHM="config/config_roster_h.mak"
+rm -f $CRHD $CRHM
+(
+    echo "#"
+    echo "# Roster of header files $USEDOX"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+    echo "INPUT+=\\"
+    echo "    config/config.h \\"
+    for f in main/src/main.c jvm/src/*.h
+    do
+        echo "    $f \\"
+    done
+
+    for f in jvm/include/*.h
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee $CRHD | sed 's/^INPUT+=/C_HEADERS:=/;s,jvm/src/,,'       | \
+                grep -v main/src/main.c                          | \
+                sed 's,    jvm/src/,    ../../jvm/src/,'         | \
+                sed 's,    jvm/include/,    ../../jvm/include/,' | \
+                sed 's,config/config.h,../../config/config.h,' > $CRHM
+
+chmod -w $CRHD $CRHM
+
+CJCD="config/config_roster_jni_c.dox"
+CJCM="config/config_roster_jni_c.mak"
+rm -f $CJCD $CJCM
+(
+    echo "#"
+    echo "# Roster of JNI sample C source files"
+    echo "# $USEDOXBLD"
+    echo "#"
+    echo "# for directory jni/src/harmony/generic/0.0/src"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+) | tee $CJCD > $CJCM
+
+    echo "INPUT+=\\"     >> $CJCD
+    echo "C_SOURCES:=\\" >> $CJCM
+
+(
+    for f in jni/src/harmony/generic/0.0/src/*.c
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee -a $CJCD | sed 's,jni/src/harmony/generic/0.0/src/,,' >> $CJCM
+
+chmod -w $CJCD $CJCM
+
+CJHD="config/config_roster_jni_h.dox"
+CJHM="config/config_roster_jni_h.mak"
+rm -f $CJHD $CJHM
+(
+    echo "#"
+    echo "# Roster of JNI sample C header files $USEDOX"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+    echo "INPUT+=\\"
+    for f in jni/src/harmony/generic/0.0/include/*.h
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee $CJHD | \
+    sed 's/^INPUT+=/C_HEADERS:=/' | \
+    sed 's,jni/src/harmony/generic/0.0/include,../include,' \
+  > $CJHM
+
+chmod -w $CJHD $CJHM
+
+CJJD="config/config_roster_jni_java.dox"
+CJJM="config/config_roster_jni_java.mak"
+rm -f $CJJD $CJJM
+(
+    echo "#"
+    echo "# Roster of JNI sample Java source files"
+    echo "# $USEDOXBLD"
+    echo "#"
+    echo "# for directory jni/src/harmony/generic/0.0/src"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+) | tee $CJJD > $CJJM
+
+    echo "INPUT+=\\"        >> $CJJD
+    echo "JAVA_SOURCES:=\\" >> $CJJM
+
+(
+    for f in \
+        `find jni/src/harmony/generic/0.0/src -name \*.java -print`
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee -a $CJJD | sed 's/INPUT+=/JAVA_SOURCES:=/' | \
+                   sed 's,jni/src/harmony/generic/0.0/src/,,' >> $CJJM
+
+chmod -w $CJJD $CJJM
+
+CTJD="config/config_roster_test_java.dox"
+CTJM="config/config_roster_test_java.mak"
+rm -f $CTJD $CTJM
+(
+    echo "#"
+    echo "# Roster of test Java source files $USEDOXBLD"
+    echo "# Also include org.apache.harmony utility classes for doxygen"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+    echo "INPUT+=\\"
+    echo "    org/apache/harmony/Copyright.java \\"
+    for f in `find test/src -name \*.java -print`
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) | tee $CTJD | \
+    grep -v org/apache/harmony | \
+    sed 's/INPUT+=/JAVA_SOURCES=/;s,test/src/,,'> $CTJM
+
+chmod -w $CTJD $CTJM
+
+CUSD="config/config_roster_sh.dox"
+rm -f $CUSD
+(
+    echo "#"
+    echo "# Roster of shell scripts $USEDOX"
+    echo "#"
+    echo "# Auto-generated by $PGMNAME"
+    echo "# on $THISDATE:"
+    echo "# DO NOT MODIFY!"
+    echo "#"
+    echo "INPUT+=\\"
+    # Have [A-Z]* listed _LAST_ due to Doxygen bug that points
+    # reference to them off to last `basename X` in list.
+    # Unfortunately, this bug also produces blank documentation,
+    # but at least the annotations are present and point to the
+    # right page. The bug has something to do with multiple files
+    # named 'Makefile' et al and having one of these in the top-level
+    # directory.  It wants more path name clarification, but does
+    # not seem to like even absolute path names.  The other scripts
+    # in the top-level directory are properly parsed.
+    #
+    # Notice that '_project_/src/Makefile' files have the relative path
+    # prefix './' attached to the front of the @@file directive.  This
+    # is to avoid an interesting sensitivity in Doxygen that got
+    # confused between 'jvm/src/Makefile' and 'main/src/Makefile'
+    # and failed to produce the "File List" entry for
+    # 'jvm/src/Makefile'.  By marking them './jvm/src/Makefile' et al,
+    # this behavior went away.
+    #
+    # Even with them listed last, the <b>@@file</b> directive still
+    # must have an absolute path name for the documentation to
+    # be properly parsed.  (See also comments in
+    # @link ./INSTALL ./INSTALL@endlink).
+    #
+    for f in *.sh \
+             `find . -name Makefile -print | grep -v "^\./Makefile" | \
+                                             sed 's,^\.\/,,' | \
+                                             sort` \
+             [A-Z]*
+    do
+        echo "    $f \\"
+    done
+    echo ""
+    echo "# EOF"
+
+) > $CUSD
+
+chmod -w $CUSD
+
+    echo ""
+    echo "$PGMNAME:  Source files:                  $CRCD"
+    echo "                                           $CRCM"
+    echo "$PGMNAME:  Header files:                  $CRHD"
+    echo "                                           $CRHM"
+    echo "$PGMNAME:  Sample JNI C source files:     $CJCD"
+    echo "                                           $CJCM"
+    echo "$PGMNAME:  Sample JNI C header files:     $CJHD"
+    echo "                                           $CJHM"
+    echo "$PGMNAME:  Sample JNI Java source files:  $CJJD"
+    echo "                                           $CJCM"
+    echo "$PGMNAME:  Test Java source files:        $CTJD"
+    echo "                                           $CTJM"
+    echo "$PGMNAME:  Utility shell scripts:         $CUSD"
+    echo ""
+
+
+###################################################################
+#
+# Done.
+#
+exit 0
+#
+# EOF

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/roster.sh
------------------------------------------------------------------------------
    svn:executable = *