Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit a30a007

Browse files
committed
8079087: Add support for Cygwin 2.0
8176033: New cygwin grep does not match \r as newline 8179675: Build with error on windows with new Cygwin grep Reviewed-by: iris, tbell Backport-of: a90ed05109da57e35b9c158cd9aac893f04a6af5
1 parent 3740d05 commit a30a007

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

common/autoconf/basics_windows.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -312,17 +312,17 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
312312
WINDOWS_ENV_VENDOR='cygwin'
313313
WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
314314
315-
CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
316-
if test "x$CYGWIN_VERSION_OK" = x; then
315+
CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.[0-6]'`
316+
if test "x$CYGWIN_VERSION_OLD" != x; then
317317
AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.])
318318
AC_MSG_ERROR([Cannot continue])
319319
fi
320320
if test "x$CYGPATH" = x; then
321321
AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
322322
fi
323323
AC_MSG_CHECKING([cygwin root directory as unix-style path])
324-
# The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
325-
cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"`
324+
# The cmd output ends with Windows line endings (CR/LF)
325+
cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'`
326326
# Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
327327
CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
328328
AC_MSG_RESULT([$CYGWIN_ROOT_PATH])

common/autoconf/generated-configure.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
32283228

32293229

32303230
#
3231-
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3231+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
32323232
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
32333233
#
32343234
# This code is free software; you can redistribute it and/or modify it
@@ -3873,7 +3873,7 @@ fi
38733873
#CUSTOM_AUTOCONF_INCLUDE
38743874

38753875
# Do not change or remove the following line, it is needed for consistency checks:
3876-
DATE_WHEN_GENERATED=1649266272
3876+
DATE_WHEN_GENERATED=1650317207
38773877

38783878
###############################################################################
38793879
#
@@ -7247,8 +7247,8 @@ $as_echo "$CYGWIN_VERSION" >&6; }
72477247
WINDOWS_ENV_VENDOR='cygwin'
72487248
WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
72497249

7250-
CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
7251-
if test "x$CYGWIN_VERSION_OK" = x; then
7250+
CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.0-6'`
7251+
if test "x$CYGWIN_VERSION_OLD" != x; then
72527252
{ $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5
72537253
$as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;}
72547254
as_fn_error $? "Cannot continue" "$LINENO" 5
@@ -7258,8 +7258,8 @@ $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but a
72587258
fi
72597259
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5
72607260
$as_echo_n "checking cygwin root directory as unix-style path... " >&6; }
7261-
# The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
7262-
cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"`
7261+
# The cmd output ends with Windows line endings (CR/LF)
7262+
cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'`
72637263
# Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
72647264
CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
72657265
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5

jdk/make/CreateJars.gmk

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -265,7 +265,10 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OU
265265
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
266266
$(MKDIR) -p $(@D)
267267
$(RM) $@ $@.tmp
268-
$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
268+
# Cygwin grep does not match $ as end of line if there are windows line
269+
# endings in the input.
270+
$(TR) -d '\r' < $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents \
271+
| $(GREP) -e '\.class$$' > $@.tmp
269272
ifneq ($(PROFILE), )
270273
# # Add back classes from excluded packages (fixing the $ substitution in the process)
271274
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
@@ -277,9 +280,11 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$
277280
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
278281
$(MKDIR) -p $(@D)
279282
$(RM) $@ $@.tmp
280-
$(GREP) -v -e '\.class$$' \
281-
-e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
282-
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
283+
# Cygwin grep does not match $ as end of line if there are windows line
284+
# endings in the input.
285+
$(TR) -d '\r' < $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents \
286+
| $(GREP) -v -e '\.class$$' \
287+
-e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' > $@.tmp
283288
ifneq ($(PROFILE), )
284289
# # Strip out all META-INF/services/ entries
285290
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2

0 commit comments

Comments
 (0)