145 VAR_CPU_ENDIAN=big
146 ;;
147 sh*)
148 VAR_CPU=sh
149 VAR_CPU_ARCH=sh
150 VAR_CPU_BITS=32
151 VAR_CPU_ENDIAN=little
152 ;;
153 sparc)
154 VAR_CPU=sparc
155 VAR_CPU_ARCH=sparc
156 VAR_CPU_BITS=32
157 VAR_CPU_ENDIAN=big
158 ;;
159 sparcv9|sparc64)
160 VAR_CPU=sparcv9
161 VAR_CPU_ARCH=sparc
162 VAR_CPU_BITS=64
163 VAR_CPU_ENDIAN=big
164 ;;
165 *)
166 AC_MSG_ERROR([unsupported cpu $1])
167 ;;
168 esac
169 ])
170
171 # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
172 # Converts autoconf style OS name to OpenJDK style, into
173 # VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
174 AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
175 [
176 case "$1" in
177 *linux*)
178 VAR_OS=linux
179 VAR_OS_TYPE=unix
180 ;;
181 *solaris*)
182 VAR_OS=solaris
183 VAR_OS_TYPE=unix
184 ;;
185 *darwin*)
186 VAR_OS=macosx
187 VAR_OS_TYPE=unix
188 ;;
189 *bsd*)
190 VAR_OS=bsd
191 VAR_OS_TYPE=unix
192 ;;
193 *cygwin*)
194 VAR_OS=windows
195 VAR_OS_ENV=windows.cygwin
196 ;;
197 *wsl*)
198 VAR_OS=windows
199 VAR_OS_ENV=windows.wsl
200 ;;
201 *mingw*)
202 VAR_OS=windows
203 VAR_OS_ENV=windows.msys
204 ;;
364 OPENJDK_$1_CPU_LEGACY="amd64"
365 elif test "x$OPENJDK_$1_CPU" = xalpha; then
366 # Avoid name collisions with variables named alpha
367 OPENJDK_$1_CPU_LEGACY="_alpha_"
368 elif test "x$OPENJDK_$1_CPU" = xsh; then
369 # Avoid name collisions with variables named sh
370 OPENJDK_$1_CPU_LEGACY="_sh_"
371 fi
372 AC_SUBST(OPENJDK_$1_CPU_LEGACY)
373
374 # And the second legacy naming of the cpu.
375 # Ie i386 and amd64 instead of x86 and x86_64.
376 OPENJDK_$1_CPU_LEGACY_LIB="$OPENJDK_$1_CPU"
377 if test "x$OPENJDK_$1_CPU" = xx86; then
378 OPENJDK_$1_CPU_LEGACY_LIB="i386"
379 elif test "x$OPENJDK_$1_CPU" = xx86_64; then
380 OPENJDK_$1_CPU_LEGACY_LIB="amd64"
381 fi
382 AC_SUBST(OPENJDK_$1_CPU_LEGACY_LIB)
383
384 # OPENJDK_$1_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
385 # /amd64 or /sparcv9. This string is appended to some library paths, like this:
386 # /usr/lib${OPENJDK_$1_CPU_ISADIR}/libexample.so
387 OPENJDK_$1_CPU_ISADIR=""
388 if test "x$OPENJDK_$1_OS" = xsolaris; then
389 if test "x$OPENJDK_$1_CPU" = xx86_64; then
390 OPENJDK_$1_CPU_ISADIR="/amd64"
391 elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
392 OPENJDK_$1_CPU_ISADIR="/sparcv9"
393 fi
394 fi
395 AC_SUBST(OPENJDK_$1_CPU_ISADIR)
396
397 # Setup OPENJDK_$1_CPU_OSARCH, which is used to set the os.arch Java system property
398 OPENJDK_$1_CPU_OSARCH="$OPENJDK_$1_CPU"
399 if test "x$OPENJDK_$1_OS" = xlinux && test "x$OPENJDK_$1_CPU" = xx86; then
400 # On linux only, we replace x86 with i386.
401 OPENJDK_$1_CPU_OSARCH="i386"
402 elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
403 # On all platforms except macosx, we replace x86_64 with amd64.
404 OPENJDK_$1_CPU_OSARCH="amd64"
405 fi
406 AC_SUBST(OPENJDK_$1_CPU_OSARCH)
407
408 OPENJDK_$1_CPU_JLI="$OPENJDK_$1_CPU"
409 if test "x$OPENJDK_$1_CPU" = xx86; then
410 OPENJDK_$1_CPU_JLI="i386"
411 elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
412 # On all platforms except macosx, we replace x86_64 with amd64.
413 OPENJDK_$1_CPU_JLI="amd64"
414 fi
415
416 # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
493 HOTSPOT_$1_CPU_DEFINE=S390
494 elif test "x$OPENJDK_$1_CPU" = xriscv64; then
495 HOTSPOT_$1_CPU_DEFINE=RISCV
496 elif test "x$OPENJDK_$1_CPU" != x; then
497 HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
498 fi
499 AC_SUBST(HOTSPOT_$1_CPU_DEFINE)
500
501 # For historical reasons, the OS include directories have odd names.
502 OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
503 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
504 OPENJDK_$1_OS_INCLUDE_SUBDIR="win32"
505 elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
506 OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin"
507 fi
508 AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR)
509 ])
510
511 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
512 [
513 if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
514 RELEASE_FILE_OS_NAME=SunOS
515 fi
516 if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
517 RELEASE_FILE_OS_NAME=Linux
518 fi
519 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
520 RELEASE_FILE_OS_NAME=Windows
521 fi
522 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
523 RELEASE_FILE_OS_NAME="Darwin"
524 fi
525 if test "x$OPENJDK_TARGET_OS" = "xaix"; then
526 RELEASE_FILE_OS_NAME="AIX"
527 fi
528 RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU}
529
530 AC_SUBST(RELEASE_FILE_OS_NAME)
531 AC_SUBST(RELEASE_FILE_OS_ARCH)
532 ])
533
534 AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
535 [
549 AC_SUBST(OPENJDK_MODULE_TARGET_PLATFORM)
550 ])
551
552 #%%% Build and target systems %%%
553 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
554 [
555 # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
556 # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the
557 # product you're building. The target of this build is called "host". Since this is confusing to most people, we
558 # have not adopted that system, but use "target" as the platform we are building for. In some places though we need
559 # to use the configure naming style.
560 AC_CANONICAL_BUILD
561 AC_CANONICAL_HOST
562 AC_CANONICAL_TARGET
563
564 PLATFORM_EXTRACT_TARGET_AND_BUILD
565 PLATFORM_SETUP_TARGET_CPU_BITS
566 PLATFORM_SET_MODULE_TARGET_OS_VALUES
567 PLATFORM_SET_RELEASE_FILE_OS_VALUES
568 PLATFORM_SETUP_LEGACY_VARS
569 PLATFORM_CHECK_DEPRECATION
570 ])
571
572 AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
573 [
574 UTIL_ARG_ENABLE(NAME: deprecated-ports, DEFAULT: false,
575 RESULT: ENABLE_DEPRECATED_PORTS,
576 DESC: [suppress the error when configuring for a deprecated port])
577
578 if test "x$OPENJDK_TARGET_OS" = xsolaris || \
579 (test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && \
580 test "x$with_jvm_variants" != xzero); then
581 if test "x$ENABLE_DEPRECATED_PORTS" = "xtrue"; then
582 AC_MSG_WARN([The Solaris and SPARC ports are deprecated and may be removed in a future release.])
583 else
584 AC_MSG_ERROR(m4_normalize([The Solaris and SPARC ports are deprecated and may be removed in a
585 future release. Use --enable-deprecated-ports=yes to suppress this error.]))
586 fi
587 fi
588 ])
589
590 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
591 [
592 ###############################################################################
593
594 # Note that this is the build platform OS version!
595
596 OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
597 OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
598 OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
599 OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
600 AC_SUBST(OS_VERSION_MAJOR)
601 AC_SUBST(OS_VERSION_MINOR)
602 AC_SUBST(OS_VERSION_MICRO)
603 ])
604
605 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
606 [
607 ###############################################################################
|
145 VAR_CPU_ENDIAN=big
146 ;;
147 sh*)
148 VAR_CPU=sh
149 VAR_CPU_ARCH=sh
150 VAR_CPU_BITS=32
151 VAR_CPU_ENDIAN=little
152 ;;
153 sparc)
154 VAR_CPU=sparc
155 VAR_CPU_ARCH=sparc
156 VAR_CPU_BITS=32
157 VAR_CPU_ENDIAN=big
158 ;;
159 sparcv9|sparc64)
160 VAR_CPU=sparcv9
161 VAR_CPU_ARCH=sparc
162 VAR_CPU_BITS=64
163 VAR_CPU_ENDIAN=big
164 ;;
165 sparc)
166 VAR_CPU=sparc
167 VAR_CPU_ARCH=sparc
168 VAR_CPU_BITS=32
169 VAR_CPU_ENDIAN=big
170 ;;
171 sparcv9|sparc64)
172 VAR_CPU=sparcv9
173 VAR_CPU_ARCH=sparc
174 VAR_CPU_BITS=64
175 VAR_CPU_ENDIAN=big
176 ;;
177 *)
178 AC_MSG_ERROR([unsupported cpu $1])
179 ;;
180 esac
181 ])
182
183 # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
184 # Converts autoconf style OS name to OpenJDK style, into
185 # VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
186 AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
187 [
188 case "$1" in
189 *linux*)
190 VAR_OS=linux
191 VAR_OS_TYPE=unix
192 ;;
193 *darwin*)
194 VAR_OS=macosx
195 VAR_OS_TYPE=unix
196 ;;
197 *bsd*)
198 VAR_OS=bsd
199 VAR_OS_TYPE=unix
200 ;;
201 *cygwin*)
202 VAR_OS=windows
203 VAR_OS_ENV=windows.cygwin
204 ;;
205 *wsl*)
206 VAR_OS=windows
207 VAR_OS_ENV=windows.wsl
208 ;;
209 *mingw*)
210 VAR_OS=windows
211 VAR_OS_ENV=windows.msys
212 ;;
372 OPENJDK_$1_CPU_LEGACY="amd64"
373 elif test "x$OPENJDK_$1_CPU" = xalpha; then
374 # Avoid name collisions with variables named alpha
375 OPENJDK_$1_CPU_LEGACY="_alpha_"
376 elif test "x$OPENJDK_$1_CPU" = xsh; then
377 # Avoid name collisions with variables named sh
378 OPENJDK_$1_CPU_LEGACY="_sh_"
379 fi
380 AC_SUBST(OPENJDK_$1_CPU_LEGACY)
381
382 # And the second legacy naming of the cpu.
383 # Ie i386 and amd64 instead of x86 and x86_64.
384 OPENJDK_$1_CPU_LEGACY_LIB="$OPENJDK_$1_CPU"
385 if test "x$OPENJDK_$1_CPU" = xx86; then
386 OPENJDK_$1_CPU_LEGACY_LIB="i386"
387 elif test "x$OPENJDK_$1_CPU" = xx86_64; then
388 OPENJDK_$1_CPU_LEGACY_LIB="amd64"
389 fi
390 AC_SUBST(OPENJDK_$1_CPU_LEGACY_LIB)
391
392 # Setup OPENJDK_$1_CPU_OSARCH, which is used to set the os.arch Java system property
393 OPENJDK_$1_CPU_OSARCH="$OPENJDK_$1_CPU"
394 if test "x$OPENJDK_$1_OS" = xlinux && test "x$OPENJDK_$1_CPU" = xx86; then
395 # On linux only, we replace x86 with i386.
396 OPENJDK_$1_CPU_OSARCH="i386"
397 elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
398 # On all platforms except macosx, we replace x86_64 with amd64.
399 OPENJDK_$1_CPU_OSARCH="amd64"
400 fi
401 AC_SUBST(OPENJDK_$1_CPU_OSARCH)
402
403 OPENJDK_$1_CPU_JLI="$OPENJDK_$1_CPU"
404 if test "x$OPENJDK_$1_CPU" = xx86; then
405 OPENJDK_$1_CPU_JLI="i386"
406 elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
407 # On all platforms except macosx, we replace x86_64 with amd64.
408 OPENJDK_$1_CPU_JLI="amd64"
409 fi
410
411 # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
488 HOTSPOT_$1_CPU_DEFINE=S390
489 elif test "x$OPENJDK_$1_CPU" = xriscv64; then
490 HOTSPOT_$1_CPU_DEFINE=RISCV
491 elif test "x$OPENJDK_$1_CPU" != x; then
492 HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
493 fi
494 AC_SUBST(HOTSPOT_$1_CPU_DEFINE)
495
496 # For historical reasons, the OS include directories have odd names.
497 OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
498 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
499 OPENJDK_$1_OS_INCLUDE_SUBDIR="win32"
500 elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
501 OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin"
502 fi
503 AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR)
504 ])
505
506 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
507 [
508 if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
509 RELEASE_FILE_OS_NAME=Linux
510 fi
511 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
512 RELEASE_FILE_OS_NAME=Windows
513 fi
514 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
515 RELEASE_FILE_OS_NAME="Darwin"
516 fi
517 if test "x$OPENJDK_TARGET_OS" = "xaix"; then
518 RELEASE_FILE_OS_NAME="AIX"
519 fi
520 RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU}
521
522 AC_SUBST(RELEASE_FILE_OS_NAME)
523 AC_SUBST(RELEASE_FILE_OS_ARCH)
524 ])
525
526 AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
527 [
541 AC_SUBST(OPENJDK_MODULE_TARGET_PLATFORM)
542 ])
543
544 #%%% Build and target systems %%%
545 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
546 [
547 # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
548 # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the
549 # product you're building. The target of this build is called "host". Since this is confusing to most people, we
550 # have not adopted that system, but use "target" as the platform we are building for. In some places though we need
551 # to use the configure naming style.
552 AC_CANONICAL_BUILD
553 AC_CANONICAL_HOST
554 AC_CANONICAL_TARGET
555
556 PLATFORM_EXTRACT_TARGET_AND_BUILD
557 PLATFORM_SETUP_TARGET_CPU_BITS
558 PLATFORM_SET_MODULE_TARGET_OS_VALUES
559 PLATFORM_SET_RELEASE_FILE_OS_VALUES
560 PLATFORM_SETUP_LEGACY_VARS
561
562 # Deprecated in JDK 15
563 UTIL_DEPRECATED_ARG_ENABLE(deprecated-ports)
564 ])
565
566 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
567 [
568 ###############################################################################
569
570 # Note that this is the build platform OS version!
571
572 OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
573 OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
574 OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
575 OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
576 AC_SUBST(OS_VERSION_MAJOR)
577 AC_SUBST(OS_VERSION_MINOR)
578 AC_SUBST(OS_VERSION_MICRO)
579 ])
580
581 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
582 [
583 ###############################################################################
|