8006676: Integrate Nashorn into new build system

Mon, 28 Jan 2013 16:29:34 -0400

author
jlaskey
date
Mon, 28 Jan 2013 16:29:34 -0400
changeset 877
3dc55f0c1b6f
parent 595
8209c91b751d
child 878
ecd447139a39

8006676: Integrate Nashorn into new build system
Reviewed-by: jlaskey
Contributed-by: james.laskey@oracle.com

common/autoconf/generated-configure.sh file | annotate | diff | comparison | revisions
common/autoconf/source-dirs.m4 file | annotate | diff | comparison | revisions
common/autoconf/spec.gmk.in file | annotate | diff | comparison | revisions
common/bin/compare.sh file | annotate | diff | comparison | revisions
common/makefiles/Main.gmk file | annotate | diff | comparison | revisions
common/makefiles/MakeBase.gmk file | annotate | diff | comparison | revisions
make/nashorn-rules.gmk file | annotate | diff | comparison | revisions
make/scripts/hgforest.sh file | annotate | diff | comparison | revisions
     1.1 --- a/common/autoconf/generated-configure.sh	Tue Jan 22 21:02:06 2013 -0800
     1.2 +++ b/common/autoconf/generated-configure.sh	Mon Jan 28 16:29:34 2013 -0400
     1.3 @@ -738,6 +738,7 @@
     1.4  OVERRIDE_SRC_ROOT
     1.5  ADD_SRC_ROOT
     1.6  JDK_TOPDIR
     1.7 +NASHORN_TOPDIR
     1.8  HOTSPOT_TOPDIR
     1.9  JAXWS_TOPDIR
    1.10  JAXP_TOPDIR
    1.11 @@ -15627,6 +15628,7 @@
    1.12  JAXP_TOPDIR="$SRC_ROOT/jaxp"
    1.13  JAXWS_TOPDIR="$SRC_ROOT/jaxws"
    1.14  HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
    1.15 +NASHORN_TOPDIR="$SRC_ROOT/nashorn"
    1.16  JDK_TOPDIR="$SRC_ROOT/jdk"
    1.17  
    1.18  
    1.19 @@ -15637,6 +15639,7 @@
    1.20  
    1.21  
    1.22  
    1.23 +
    1.24  ###############################################################################
    1.25  #
    1.26  # Pickup additional source for a component from outside of the source root
    1.27 @@ -15867,6 +15870,19 @@
    1.28      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $HOTSPOT_TOPDIR" >&5
    1.29  $as_echo "yes with $HOTSPOT_TOPDIR" >&6; }
    1.30  fi
    1.31 +if test "x$with_override_nashorn" != x; then
    1.32 +    CURDIR="$PWD"
    1.33 +    cd "$with_override_nashorn"
    1.34 +    NASHORN_TOPDIR="`pwd`"
    1.35 +    cd "$CURDIR"
    1.36 +    if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then
    1.37 +        as_fn_error $? "You have to override nashorn with a full nashorn repo!" "$LINENO" 5
    1.38 +    fi
    1.39 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if nashorn should be overridden" >&5
    1.40 +$as_echo_n "checking if nashorn should be overridden... " >&6; }
    1.41 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $NASHORN_TOPDIR" >&5
    1.42 +$as_echo "yes with $NASHORN_TOPDIR" >&6; }
    1.43 +fi
    1.44  if test "x$with_override_jdk" != x; then
    1.45      CURDIR="$PWD"
    1.46      cd "$with_override_jdk"
     2.1 --- a/common/autoconf/source-dirs.m4	Tue Jan 22 21:02:06 2013 -0800
     2.2 +++ b/common/autoconf/source-dirs.m4	Mon Jan 28 16:29:34 2013 -0400
     2.3 @@ -33,12 +33,14 @@
     2.4  JAXP_TOPDIR="$SRC_ROOT/jaxp"
     2.5  JAXWS_TOPDIR="$SRC_ROOT/jaxws"
     2.6  HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
     2.7 +NASHORN_TOPDIR="$SRC_ROOT/nashorn"
     2.8  JDK_TOPDIR="$SRC_ROOT/jdk"
     2.9  AC_SUBST(LANGTOOLS_TOPDIR)
    2.10  AC_SUBST(CORBA_TOPDIR)
    2.11  AC_SUBST(JAXP_TOPDIR)
    2.12  AC_SUBST(JAXWS_TOPDIR)
    2.13  AC_SUBST(HOTSPOT_TOPDIR)
    2.14 +AC_SUBST(NASHORN_TOPDIR)
    2.15  AC_SUBST(JDK_TOPDIR)
    2.16  ])
    2.17  
    2.18 @@ -233,7 +235,18 @@
    2.19      fi
    2.20      AC_MSG_CHECKING([if hotspot should be overridden])
    2.21      AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
    2.22 -fi    
    2.23 +fi
    2.24 +if test "x$with_override_nashorn" != x; then
    2.25 +    CURDIR="$PWD"
    2.26 +    cd "$with_override_nashorn"
    2.27 +    NASHORN_TOPDIR="`pwd`"
    2.28 +    cd "$CURDIR"
    2.29 +    if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then
    2.30 +        AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!])
    2.31 +    fi
    2.32 +    AC_MSG_CHECKING([if nashorn should be overridden])
    2.33 +    AC_MSG_RESULT([yes with $NASHORN_TOPDIR])
    2.34 +fi
    2.35  if test "x$with_override_jdk" != x; then
    2.36      CURDIR="$PWD"
    2.37      cd "$with_override_jdk"
     3.1 --- a/common/autoconf/spec.gmk.in	Tue Jan 22 21:02:06 2013 -0800
     3.2 +++ b/common/autoconf/spec.gmk.in	Mon Jan 28 16:29:34 2013 -0400
     3.3 @@ -141,6 +141,7 @@
     3.4  JAXP_TOPDIR:=@JAXP_TOPDIR@
     3.5  JAXWS_TOPDIR:=@JAXWS_TOPDIR@
     3.6  HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
     3.7 +NASHORN_TOPDIR:=@NASHORN_TOPDIR@
     3.8  COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
     3.9  
    3.10  # Location where build customization files may be found
    3.11 @@ -230,6 +231,7 @@
    3.12  JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
    3.13  HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
    3.14  JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
    3.15 +NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
    3.16  IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
    3.17  JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
    3.18  
    3.19 @@ -238,6 +240,7 @@
    3.20  JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
    3.21  JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
    3.22  HOTSPOT_DIST=@HOTSPOT_DIST@
    3.23 +NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
    3.24  
    3.25  BUILD_HOTSPOT=@BUILD_HOTSPOT@
    3.26  
     4.1 --- a/common/bin/compare.sh	Tue Jan 22 21:02:06 2013 -0800
     4.2 +++ b/common/bin/compare.sh	Mon Jan 28 16:29:34 2013 -0400
     4.3 @@ -350,9 +350,15 @@
     4.4      OTHER_DIR=$2
     4.5      WORK_DIR=$3
     4.6      ZIP_FILE=$4
     4.7 +    # Optionally provide different name for other zipfile
     4.8 +    OTHER_ZIP_FILE=$5
     4.9  
    4.10      THIS_ZIP=$THIS_DIR/$ZIP_FILE
    4.11 -    OTHER_ZIP=$OTHER_DIR/$ZIP_FILE
    4.12 +    if [ -n "$OTHER_ZIP_FILE" ]; then
    4.13 +        OTHER_ZIP=$OTHER_DIR/$OTHER_ZIP_FILE
    4.14 +    else
    4.15 +        OTHER_ZIP=$OTHER_DIR/$ZIP_FILE
    4.16 +    fi
    4.17  
    4.18      THIS_SUFFIX="${THIS_ZIP##*.}"
    4.19      OTHER_SUFFIX="${OTHER_ZIP##*.}"
    4.20 @@ -962,6 +968,9 @@
    4.21      echo "[FILTER]            List filenames in the image to compare, works for jars, zips, libs and execs"
    4.22      echo "Example:"
    4.23      echo "bash ./common/bin/compareimages.sh CodePointIM.jar"
    4.24 +    echo ""
    4.25 +    echo "-2zips <file1> <file2> Compare two zip files only"
    4.26 +    echo ""
    4.27      exit 10
    4.28  fi
    4.29  
    4.30 @@ -1023,6 +1032,13 @@
    4.31          -execs)
    4.32              CMP_EXECS=true
    4.33              ;;
    4.34 +        -2zips)
    4.35 +            CMP_2_ZIPS=true
    4.36 +            THIS_FILE=$2
    4.37 +            OTHER_FILE=$3
    4.38 +            shift
    4.39 +            shift
    4.40 +            ;;
    4.41          *)
    4.42              CMP_NAMES=false
    4.43              CMP_PERMS=false
    4.44 @@ -1041,6 +1057,18 @@
    4.45      shift
    4.46  done
    4.47  
    4.48 +if [ "$CMP_2_ZIPS" = "true" ]; then
    4.49 +    THIS_DIR="$(dirname $THIS_FILE)"
    4.50 +    THIS_DIR="$(cd "$THIS_DIR" && pwd )"
    4.51 +    OTHER_DIR="$(dirname $OTHER_FILE)"
    4.52 +    OTHER_DIR="$(cd "$OTHER_DIR" && pwd )"
    4.53 +    THIS_FILE_NAME="$(basename $THIS_FILE)"
    4.54 +    OTHER_FILE_NAME="$(basename $OTHER_FILE)"
    4.55 +    echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME
    4.56 +    compare_zip_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2zips $THIS_FILE_NAME $OTHER_FILE_NAME
    4.57 +    exit
    4.58 +fi
    4.59 +
    4.60  if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then
    4.61      CMP_NAMES=true
    4.62      CMP_PERMS=true
     5.1 --- a/common/makefiles/Main.gmk	Tue Jan 22 21:02:06 2013 -0800
     5.2 +++ b/common/makefiles/Main.gmk	Mon Jan 28 16:29:34 2013 -0400
     5.3 @@ -116,13 +116,19 @@
     5.4  	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
     5.5  	@$(call TargetExit)
     5.6  
     5.7 +nashorn: jdk nashorn-only
     5.8 +nashorn-only: start-make
     5.9 +	@$(call TargetEnter)
    5.10 +	@($(CD) $(NASHORN_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
    5.11 +	@$(call TargetExit)
    5.12 +
    5.13  demos: jdk demos-only
    5.14  demos-only: start-make
    5.15  	@$(call TargetEnter)
    5.16  	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
    5.17  	@$(call TargetExit)
    5.18  
    5.19 -images: source-tips demos images-only
    5.20 +images: source-tips demos nashorn images-only
    5.21  images-only: start-make
    5.22  	@$(call TargetEnter)
    5.23  	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
    5.24 @@ -173,7 +179,7 @@
    5.25  
    5.26  
    5.27  # Remove everything, except the output from configure.
    5.28 -clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build clean-docs
    5.29 +clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs
    5.30  	@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
    5.31  	@$(ECHO) Cleaned all build artifacts.
    5.32  
    5.33 @@ -203,6 +209,8 @@
    5.34  	$(call CleanComponent,hotspot)
    5.35  clean-jdk:
    5.36  	$(call CleanComponent,jdk)
    5.37 +clean-nashorn:
    5.38 +	$(call CleanComponent,nashorn)
    5.39  clean-images:
    5.40  	$(call CleanComponent,images)
    5.41  clean-overlay-images:
    5.42 @@ -216,6 +224,6 @@
    5.43  .PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install
    5.44  .PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only
    5.45  .PHONY: all test clean dist-clean bootcycle-images start-make
    5.46 -.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build
    5.47 +.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build
    5.48  
    5.49  FRC: # Force target
     6.1 --- a/common/makefiles/MakeBase.gmk	Tue Jan 22 21:02:06 2013 -0800
     6.2 +++ b/common/makefiles/MakeBase.gmk	Mon Jan 28 16:29:34 2013 -0400
     6.3 @@ -51,8 +51,9 @@
     6.4  		     -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
     6.5  		     -e 's|X00|X|g' | tr '\n' '$2'
     6.6  
     6.7 +# Subst in an extra $ to prevent it from disappearing.
     6.8  define ListPathsSafely_If
     6.9 -    $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
    6.10 +    $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(subst $$,$$$$,$(wordlist $3,$4,$($1))))))
    6.11  endef
    6.12  
    6.13  define ListPathsSafely_Printf
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/make/nashorn-rules.gmk	Mon Jan 28 16:29:34 2013 -0400
     7.3 @@ -0,0 +1,56 @@
     7.4 +#
     7.5 +# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     7.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.7 +#
     7.8 +# This code is free software; you can redistribute it and/or modify it
     7.9 +# under the terms of the GNU General Public License version 2 only, as
    7.10 +# published by the Free Software Foundation.  Oracle designates this
    7.11 +# particular file as subject to the "Classpath" exception as provided
    7.12 +# by Oracle in the LICENSE file that accompanied this code.
    7.13 +#
    7.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    7.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    7.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    7.17 +# version 2 for more details (a copy is included in the LICENSE file that
    7.18 +# accompanied this code).
    7.19 +#
    7.20 +# You should have received a copy of the GNU General Public License version
    7.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    7.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    7.23 +#
    7.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    7.25 +# or visit www.oracle.com if you need additional information or have any
    7.26 +# questions.
    7.27 +#
    7.28 +
    7.29 +################################################################
    7.30 +# NASHORN TARGETS
    7.31 +################################################################
    7.32 +
    7.33 +NASHORN_BUILD_ARGUMENTS = \
    7.34 +   $(COMMON_BUILD_ARGUMENTS) \
    7.35 +   ALT_OUTPUTDIR=$(NASHORN_OUTPUTDIR) \
    7.36 +   ALT_BOOTDIR=$(BOOTDIR) \
    7.37 +   ALT_JDK_IMPORT_PATH=$(JDK_IMPORT_PATH)
    7.38 +
    7.39 +ifeq ($(BUILD_LANGTOOLS), true)
    7.40 +   NASHORN_BUILD_ARGUMENTS += ALT_LANGTOOLS_DIST=$(ABS_LANGTOOLS_DIST)
    7.41 +endif
    7.42 +
    7.43 +nashorn: nashorn-build
    7.44 +nashorn-build:
    7.45 +	$(MKDIR) -p $(NASHORN_OUTPUTDIR)
    7.46 +	@$(call MakeStart,nashorn,all)
    7.47 +	($(CD) $(NASHORN_TOPDIR)/make && \
    7.48 +	 $(MAKE) $(NASHORN_BUILD_ARGUMENTS) all)
    7.49 +	@$(call MakeFinish,nashorn,all)
    7.50 +
    7.51 +nashorn-clobber::
    7.52 +	$(MKDIR) -p $(NASHORN_OUTPUTDIR)
    7.53 +	@$(call MakeStart,nashorn,clobber)
    7.54 +	($(CD) $(NASHORN_TOPDIR)/make &&  \
    7.55 +	 $(MAKE) $(NASHORN_BUILD_ARGUMENTS) clobber)
    7.56 +	@$(call MakeFinish,nashorn,clobber)
    7.57 +
    7.58 +.PHONY: nashorn nashorn-build nashorn-clobber 
    7.59 +
     8.1 --- a/make/scripts/hgforest.sh	Tue Jan 22 21:02:06 2013 -0800
     8.2 +++ b/make/scripts/hgforest.sh	Mon Jan 28 16:29:34 2013 -0400
     8.3 @@ -40,7 +40,7 @@
     8.4  repos=""
     8.5  repos_extra=""
     8.6  if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
     8.7 -  subrepos="corba jaxp jaxws langtools jdk hotspot"
     8.8 +  subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
     8.9    if [ -f .hg/hgrc ] ; then
    8.10      pull_default=`hg paths default`
    8.11      if [ "${pull_default}" = "" ] ; then

mercurial