diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..c45c60e2d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +/build/ +/dist/ +/.idea/ +nbproject/private/ +/webrev +/.src-rev +/.jib/ +/.hgtip +.DS_Store +.metadata/ +.recommenders/ +test/nashorn/script/external +test/nashorn/lib +NashornProfile.txt +**/JTreport/** +**/JTwork/** +/jdk/make/closed/ +/jdk/src/closed/ diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 9ef7b0400d..b797d93f51 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -640,6 +640,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], fi AC_PATH_PROGS(READELF, [readelf greadelf]) AC_PATH_PROG(HG, hg) + AC_PATH_PROG(GIT, git) AC_PATH_PROG(STAT, stat) AC_PATH_PROG(TIME, time) # Check if it's GNU time diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 5ca98d7ae9..84e8def0ee 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -832,6 +832,7 @@ DSYMUTIL IS_GNU_TIME TIME STAT +GIT HG READELF OTOOL @@ -3108,7 +3109,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Include these first... # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3872,7 +3873,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1573688723 +DATE_WHEN_GENERATED=1649266272 ############################################################################### # @@ -10449,6 +10450,46 @@ $as_echo "no" >&6; } fi + # Extract the first word of "git", so it can be a program name with args. +set dummy git; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GIT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GIT="$GIT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GIT=$ac_cv_path_GIT +if test -n "$GIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +$as_echo "$GIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "stat", so it can be a program name with args. set dummy stat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 55f875b43f..07dc084044 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -533,6 +533,7 @@ READELF:=@READELF@ EXPR:=@EXPR@ FILE:=@FILE@ HG:=@HG@ +GIT:=@GIT@ OBJCOPY:=@OBJCOPY@ SETFILE:=@SETFILE@ XATTR:=@XATTR@ diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 2b276c6f1f..f804ceb0a5 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -299,10 +299,13 @@ endef # These should not be := assignments, only used from the root Makefile. HG_VERSION = $(shell $(HG) version 2> /dev/null) HG_DIRECTORY=.hg +GIT_DIRECTORY=.git HGTIP_FILENAME=.hgtip HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \ - $(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \ + $(shell $(CD) $(SRC_ROOT) ; ( \ + $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \ + $(LS) -d $(HG_SEARCH:%/REPO=%/$(GIT_DIRECTORY)) ; \ $(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \ 2> /dev/null))))) @@ -315,6 +318,12 @@ define GetSourceTips elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \ $(PRINTF) " %s:%s" \ "$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \ + elif [ -d $${i}/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \ + porcelain="`$(GIT) -C $${i} status --porcelain`" ; \ + $(PRINTF) " %s:%s%s\n" \ + "$${i}" \ + "`$(GIT) -C $${i} log -n1 --format=%H | $(CUT) -c1-12`" \ + "`if test -n \"$${porcelain}\"; then printf '+'; fi`" ; \ elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \ $(PRINTF) " %s:%s" \ "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \ @@ -325,7 +334,11 @@ endef # Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk define CreateHgTip - $(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \ + if [ -d $1/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \ + $(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \ + elif [ -d $1/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \ + $(GIT) -C $1 log -n1 --format=%H | $(CUT) -c1-12 > $1/$(HGTIP_FILENAME); \ + fi ; \ $(ECHO) $1/$(HGTIP_FILENAME) endef