Skip to content

Commit a3e1980

Browse files
committed
8256541: Sort out what version of awk is used in the build system
Reviewed-by: erikj
1 parent e3abe51 commit a3e1980

15 files changed

Lines changed: 26 additions & 31 deletions

File tree

make/CompileCommands.gmk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
4545
$(RM) $@
4646
$(FIND) $(MAKESUPPORT_OUTPUTDIR)/compile-commands/ -name \*.json | \
4747
$(SORT) | $(XARGS) $(CAT) >> $@.tmp
48-
$(if $(FIXPATH),$(FIXPATH) $(AWK) 'BEGIN { \
49-
tmpfile = substr(ARGV[2],2); \
50-
cmd = "$(CP) " "\047" tmpfile "\047" " $@.tmp"; \
51-
system(cmd); \
52-
}' -- @$@.tmp)
5348
$(SED) -e '1s/^/[\$(NEWLINE)/' -e '$(DOLLAR)s/,\s\{0,\}$(DOLLAR)/\$(NEWLINE)]/' $@.tmp > $@
5449
$(RM) $@.tmp
5550

make/RunTestsPrebuiltSpec.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ LN := ln
153153
MIG := mig
154154
MKDIR := mkdir
155155
MV := mv
156-
NAWK := nawk
157156
NICE := nice
158157
PATCH := patch
159158
PRINTF := printf

make/autoconf/basic_tools.m4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
5757
UTIL_REQUIRE_PROGS(MKDIR, [gmkdir mkdir])
5858
UTIL_REQUIRE_PROGS(MKTEMP, mktemp)
5959
UTIL_REQUIRE_PROGS(MV, mv)
60-
UTIL_REQUIRE_PROGS(NAWK, [nawk gawk awk])
60+
UTIL_REQUIRE_PROGS(AWK, [gawk nawk awk])
6161
UTIL_REQUIRE_PROGS(PRINTF, printf)
6262
UTIL_REQUIRE_PROGS(READLINK, [greadlink readlink])
6363
UTIL_REQUIRE_PROGS(RM, rm)
@@ -75,7 +75,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
7575
UTIL_REQUIRE_PROGS(XARGS, xargs)
7676
7777
# Then required tools that require some special treatment.
78-
UTIL_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
7978
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
8079
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
8180
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])

make/autoconf/compare.sh.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,6 @@ export LDD="@LDD@"
5353
export LN="@LN@"
5454
export MKDIR="@MKDIR@"
5555
export MV="@MV@"
56-
export NAWK="@NAWK@"
5756
export NM="@GNM@"
5857
export OBJDUMP="@OBJDUMP@"
5958
export OTOOL="@OTOOL@"

make/autoconf/spec.gmk.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ LN:=@LN@
707707
MIG:=@MIG@
708708
MKDIR:=@MKDIR@
709709
MV:=@MV@
710-
NAWK:=@NAWK@
711710
NICE:=@NICE@
712711
PANDOC:=@FIXPATH@ @PANDOC@
713712
PATCH:=@PATCH@

make/common/MakeBase.gmk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
8989

9090
# Record starting time for build of a sub repository.
9191
define RecordStartTime
92-
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
92+
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
9393
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
9494
endef
9595

9696
# Record ending time and calculate the difference and store it in a
9797
# easy to read format. Handles builds that cross midnight. Expects
9898
# that a build will never take 24 hours or more.
9999
define RecordEndTime
100-
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
100+
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
101101
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
102102
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
103-
$(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
103+
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
104104
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
105105
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
106106
endef
@@ -439,6 +439,8 @@ endif
439439
# This is normally not needed since we use the FIXPATH prefix for command lines,
440440
# but might be needed in certain circumstances.
441441
ifeq ($(call isTargetOs, windows), true)
442+
FixPathArgs = \
443+
$(shell $(FIXPATH) cmd /c echo $1)
442444
ifeq ($(call isBuildOsEnv, windows.wsl), true)
443445
FixPath = \
444446
$(shell $(WSLPATH) -m $1)
@@ -447,6 +449,8 @@ ifeq ($(call isTargetOs, windows), true)
447449
$(shell $(CYGPATH) -m $1)
448450
endif
449451
else
452+
FixPathArgs = \
453+
$1
450454
FixPath = \
451455
$1
452456
endif

make/common/Modules.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
338338
$(RM) $@
339339
$(foreach m, $(MODULE_INFOS), \
340340
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \
341-
$(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
341+
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
342342
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
343343
/^ *requires/ { sub(/;/, ""); \
344344
sub(/requires /, " "); \
@@ -352,7 +352,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
352352
printf(" %s", $$0) } \
353353
END { printf("\n") }' $m && \
354354
$(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) :=" && \
355-
$(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
355+
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
356356
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
357357
/^ *requires *transitive/ { \
358358
sub(/;/, ""); \

make/common/NativeCompilation.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ define WriteCompileCommandsFragment
7272
$(call LogInfo, Creating compile commands fragment for $(notdir $3))
7373
$(call MakeDir, $(dir $1))
7474
$(call WriteFile,{ \
75-
"directory": "$(strip $2)"$(COMMA) \
76-
"file": "$(strip $3)"$(COMMA) \
75+
"directory": "$(strip $(call FixPathArgs, $2))"$(COMMA) \
76+
"file": "$(strip $(call FixPathArgs, $3))"$(COMMA) \
7777
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
78-
$(subst $(FIXPATH),,$4))))" \
78+
$(subst $(FIXPATH),,$(call FixPathArgs, $4)))))" \
7979
}$(COMMA), \
8080
$1)
8181
endef

make/common/TextFileProcessing.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@ define SetupTextFileProcessingBody
177177
$1_INCLUDES_PARTIAL_AWK := $$(subst $$(SPACE);,,$$(subst $$(SPACE)=>$$(SPACE),"$$(RIGHT_PAREN)$$(RIGHT_PAREN) \
178178
{ include$$(LEFT_PAREN)",$$(subst $$(SPACE);$$(SPACE),"$$(RIGHT_PAREN) } \
179179
else if $$(LEFT_PAREN)matches$$(LEFT_PAREN)",$$(strip $$($1_INCLUDES)))))
180-
$1_INCLUDES_COMMAND_LINE := $(NAWK) '$$($1_INCLUDES_HEADER_AWK) \
180+
$1_INCLUDES_COMMAND_LINE := $(AWK) '$$($1_INCLUDES_HEADER_AWK) \
181181
{ if (matches("$$($1_INCLUDES_PARTIAL_AWK)") } else print }'
182182
else
183183
# We don't have any includes, just pipe the file through cat.

make/hotspot/gensrc/GensrcAdlc.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ ifeq ($(call check-jvm-feature, compiler2), true)
168168
$(SINGLE_AD_SRCFILE): $(AD_SRC_FILES)
169169
$(call LogInfo, Preprocessing adlc files $(^F))
170170
$(call MakeDir, $(@D))
171-
$(NAWK) $(INSERT_FILENAME_AWK_SCRIPT) $^ > $@
171+
$(AWK) $(INSERT_FILENAME_AWK_SCRIPT) $^ > $@
172172

173173
##############################################################################
174174
# Run the adlc tool on the single concatenated ad source file, and store the
@@ -205,7 +205,7 @@ ifeq ($(call check-jvm-feature, compiler2), true)
205205
$(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(adlc_run_TARGET)
206206
$(call LogInfo, Postprocessing adlc file $*)
207207
$(call MakeDir, $(@D))
208-
$(NAWK) \
208+
$(AWK) \
209209
'BEGIN { print "#line 1 \"$*\""; } \
210210
/^#line 999999$$/ {print "#line " (NR+1) " \"$*\""; next} \
211211
$(if $(call equals, $(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false), \

0 commit comments

Comments
 (0)