2
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation. Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
26
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
27
# Converts autoconf style CPU name to OpenJDK style, into
28
# VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN.
29
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
31
# First argument is the cpu name from the trip/quad
77
VAR_CPU_ARCH=loongarch
107
VAR_CPU_ARCH=mips64el
109
VAR_CPU_ENDIAN=little
127
VAR_CPU_ENDIAN=little
133
VAR_CPU_ENDIAN=little
139
VAR_CPU_ENDIAN=little
163
VAR_CPU_ENDIAN=little
190
AC_MSG_ERROR([unsupported cpu $1])
195
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
196
# Converts autoconf style OS name to OpenJDK style, into
197
# VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
198
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
215
VAR_OS_ENV=windows.cygwin
219
VAR_OS_ENV=windows.wsl
223
VAR_OS_ENV=windows.msys2
230
AC_MSG_ERROR([unsupported operating system $1])
235
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
236
# Converts autoconf style OS name to OpenJDK style, into
238
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_LIBC],
253
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
254
# Converts autoconf style OS name to OpenJDK style, into
256
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_ABI],
280
# Expects $host_os $host_cpu $build_os and $build_cpu
281
# and $with_target_bits to have been setup!
283
# Translate the standard triplet(quadruplet) definition
284
# of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU,
285
# OPENJDK_BUILD_OS, etc.
286
AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
288
# Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME
289
# (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME
290
# Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build,
291
# but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME.
292
OPENJDK_TARGET_AUTOCONF_NAME="$host"
293
OPENJDK_BUILD_AUTOCONF_NAME="$build"
294
AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME)
295
AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME)
297
# Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU/LIBC variables.
298
PLATFORM_EXTRACT_VARS_FROM_OS($build_os)
299
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
300
PLATFORM_EXTRACT_VARS_FROM_LIBC($build_os)
301
PLATFORM_EXTRACT_VARS_FROM_ABI($build_os)
302
# ..and setup our own variables. (Do this explicitly to facilitate searching)
303
OPENJDK_BUILD_OS="$VAR_OS"
304
if test "x$VAR_OS_TYPE" != x; then
305
OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE"
307
OPENJDK_BUILD_OS_TYPE="$VAR_OS"
309
if test "x$VAR_OS_ENV" != x; then
310
OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
312
OPENJDK_BUILD_OS_ENV="$VAR_OS"
314
OPENJDK_BUILD_CPU="$VAR_CPU"
315
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
316
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
317
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
318
OPENJDK_BUILD_CPU_AUTOCONF="$build_cpu"
319
OPENJDK_BUILD_LIBC="$VAR_LIBC"
320
OPENJDK_BUILD_ABI="$VAR_ABI"
321
AC_SUBST(OPENJDK_BUILD_OS)
322
AC_SUBST(OPENJDK_BUILD_OS_TYPE)
323
AC_SUBST(OPENJDK_BUILD_OS_ENV)
324
AC_SUBST(OPENJDK_BUILD_CPU)
325
AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
326
AC_SUBST(OPENJDK_BUILD_CPU_BITS)
327
AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN)
328
AC_SUBST(OPENJDK_BUILD_CPU_AUTOCONF)
329
AC_SUBST(OPENJDK_BUILD_LIBC)
330
AC_SUBST(OPENJDK_BUILD_ABI)
332
AC_MSG_CHECKING([openjdk-build os-cpu])
333
AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU])
335
if test "x$OPENJDK_BUILD_OS" = "xlinux"; then
336
AC_MSG_CHECKING([openjdk-build C library])
337
AC_MSG_RESULT([$OPENJDK_BUILD_LIBC])
340
# Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU/LIBC variables.
341
PLATFORM_EXTRACT_VARS_FROM_OS($host_os)
342
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
343
PLATFORM_EXTRACT_VARS_FROM_LIBC($host_os)
344
PLATFORM_EXTRACT_VARS_FROM_ABI($host_os)
345
# ... and setup our own variables. (Do this explicitly to facilitate searching)
346
OPENJDK_TARGET_OS="$VAR_OS"
347
if test "x$VAR_OS_TYPE" != x; then
348
OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE"
350
OPENJDK_TARGET_OS_TYPE="$VAR_OS"
352
if test "x$VAR_OS_ENV" != x; then
353
OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
355
OPENJDK_TARGET_OS_ENV="$VAR_OS"
357
OPENJDK_TARGET_CPU="$VAR_CPU"
358
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
359
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
360
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
361
OPENJDK_TARGET_CPU_AUTOCONF="$host_cpu"
362
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
363
OPENJDK_TARGET_LIBC="$VAR_LIBC"
364
OPENJDK_TARGET_ABI="$VAR_ABI"
366
AC_SUBST(OPENJDK_TARGET_OS)
367
AC_SUBST(OPENJDK_TARGET_OS_TYPE)
368
AC_SUBST(OPENJDK_TARGET_OS_ENV)
369
AC_SUBST(OPENJDK_TARGET_OS_UPPERCASE)
370
AC_SUBST(OPENJDK_TARGET_CPU)
371
AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
372
AC_SUBST(OPENJDK_TARGET_CPU_BITS)
373
AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN)
374
AC_SUBST(OPENJDK_TARGET_CPU_AUTOCONF)
375
AC_SUBST(OPENJDK_TARGET_LIBC)
376
AC_SUBST(OPENJDK_TARGET_ABI)
378
AC_MSG_CHECKING([openjdk-target os-cpu])
379
AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
381
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
382
AC_MSG_CHECKING([openjdk-target C library])
383
AC_MSG_RESULT([$OPENJDK_TARGET_LIBC])
387
# Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behavior
388
# accordingly. Must be done after setting up build and target system, but before
389
# doing anything else with these values.
390
AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS],
392
AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits],
393
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])])
395
# We have three types of compiles:
396
# native == normal compilation, target system == build system
397
# cross == traditional cross compilation, target system != build system; special toolchain needed
398
# reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines
400
if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then
401
# We're doing a proper cross-compilation
404
COMPILE_TYPE="native"
407
if test "x$with_target_bits" != x; then
408
if test "x$COMPILE_TYPE" = "xcross"; then
409
AC_MSG_ERROR([It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either.])
412
if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
413
# A reduced build is requested
414
COMPILE_TYPE="reduced"
415
OPENJDK_TARGET_CPU_BITS=32
416
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
417
OPENJDK_TARGET_CPU=x86
418
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
419
OPENJDK_TARGET_CPU=sparc
421
AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9])
423
elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
424
AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.])
425
elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then
426
AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning])
428
AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!])
431
AC_SUBST(COMPILE_TYPE)
433
AC_MSG_CHECKING([compilation type])
434
AC_MSG_RESULT([$COMPILE_TYPE])
437
# Setup the legacy variables, for controlling the old makefiles.
439
AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
441
PLATFORM_SETUP_LEGACY_VARS_HELPER([TARGET])
442
PLATFORM_SETUP_LEGACY_VARS_HELPER([BUILD])
445
# $1 - Either TARGET or BUILD to setup the variables for.
446
AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
448
# Also store the legacy naming of the cpu.
449
# Ie i586 and amd64 instead of x86 and x86_64
450
OPENJDK_$1_CPU_LEGACY="$OPENJDK_$1_CPU"
451
if test "x$OPENJDK_$1_CPU" = xx86; then
452
OPENJDK_$1_CPU_LEGACY="i586"
453
elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
454
# On all platforms except MacOSX replace x86_64 with amd64.
455
OPENJDK_$1_CPU_LEGACY="amd64"
456
elif test "x$OPENJDK_$1_CPU" = xalpha; then
457
# Avoid name collisions with variables named alpha
458
OPENJDK_$1_CPU_LEGACY="_alpha_"
459
elif test "x$OPENJDK_$1_CPU" = xsh; then
460
# Avoid name collisions with variables named sh
461
OPENJDK_$1_CPU_LEGACY="_sh_"
463
AC_SUBST(OPENJDK_$1_CPU_LEGACY)
465
# And the second legacy naming of the cpu.
466
# Ie i386 and amd64 instead of x86 and x86_64.
467
OPENJDK_$1_CPU_LEGACY_LIB="$OPENJDK_$1_CPU"
468
if test "x$OPENJDK_$1_CPU" = xx86; then
469
OPENJDK_$1_CPU_LEGACY_LIB="i386"
470
elif test "x$OPENJDK_$1_CPU" = xx86_64; then
471
OPENJDK_$1_CPU_LEGACY_LIB="amd64"
473
AC_SUBST(OPENJDK_$1_CPU_LEGACY_LIB)
475
# Setup OPENJDK_$1_CPU_OSARCH, which is used to set the os.arch Java system property
476
OPENJDK_$1_CPU_OSARCH="$OPENJDK_$1_CPU"
477
if test "x$OPENJDK_$1_OS" = xlinux && test "x$OPENJDK_$1_CPU" = xx86; then
478
# On linux only, we replace x86 with i386.
479
OPENJDK_$1_CPU_OSARCH="i386"
480
elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
481
# On all platforms except macosx, we replace x86_64 with amd64.
482
OPENJDK_$1_CPU_OSARCH="amd64"
484
AC_SUBST(OPENJDK_$1_CPU_OSARCH)
486
OPENJDK_$1_CPU_JLI="$OPENJDK_$1_CPU"
487
if test "x$OPENJDK_$1_CPU" = xx86; then
488
OPENJDK_$1_CPU_JLI="i386"
489
elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
490
# On all platforms except macosx, we replace x86_64 with amd64.
491
OPENJDK_$1_CPU_JLI="amd64"
494
# The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
495
# The macOS bundle name was revised in JDK 17
497
# macosx is macos and x86_64 is x64
498
if test "x$OPENJDK_$1_OS" = xmacosx; then
499
OPENJDK_$1_OS_BUNDLE="macos"
501
OPENJDK_$1_OS_BUNDLE="$OPENJDK_TARGET_OS"
503
if test "x$OPENJDK_$1_CPU" = xx86_64; then
504
OPENJDK_$1_CPU_BUNDLE="x64"
506
OPENJDK_$1_CPU_BUNDLE="$OPENJDK_$1_CPU"
509
OPENJDK_$1_LIBC_BUNDLE=""
510
if test "x$OPENJDK_$1_LIBC" = "xmusl"; then
511
OPENJDK_$1_LIBC_BUNDLE="-$OPENJDK_$1_LIBC"
514
OPENJDK_$1_BUNDLE_PLATFORM="${OPENJDK_$1_OS_BUNDLE}-${OPENJDK_$1_CPU_BUNDLE}${OPENJDK_$1_LIBC_BUNDLE}"
515
AC_SUBST(OPENJDK_$1_BUNDLE_PLATFORM)
517
if test "x$COMPILE_TYPE" = "xcross"; then
518
# FIXME: ... or should this include reduced builds..?
519
DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_$1_CPU_LEGACY"
521
DEFINE_CROSS_COMPILE_ARCH=""
523
AC_SUBST(DEFINE_CROSS_COMPILE_ARCH)
525
# Convert openjdk platform names to hotspot names
527
HOTSPOT_$1_OS=${OPENJDK_$1_OS}
528
if test "x$OPENJDK_$1_OS" = xmacosx; then
531
AC_SUBST(HOTSPOT_$1_OS)
533
HOTSPOT_$1_OS_TYPE=${OPENJDK_$1_OS_TYPE}
534
if test "x$OPENJDK_$1_OS_TYPE" = xunix; then
535
HOTSPOT_$1_OS_TYPE=posix
537
AC_SUBST(HOTSPOT_$1_OS_TYPE)
539
HOTSPOT_$1_CPU=${OPENJDK_$1_CPU}
540
if test "x$OPENJDK_$1_CPU" = xx86; then
541
HOTSPOT_$1_CPU=x86_32
542
elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
544
elif test "x$OPENJDK_$1_CPU" = xppc64; then
545
HOTSPOT_$1_CPU=ppc_64
546
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
547
HOTSPOT_$1_CPU=ppc_64
549
AC_SUBST(HOTSPOT_$1_CPU)
551
# This is identical with OPENJDK_*, but define anyway for consistency.
552
HOTSPOT_$1_CPU_ARCH=${OPENJDK_$1_CPU_ARCH}
553
AC_SUBST(HOTSPOT_$1_CPU_ARCH)
555
# Setup HOTSPOT_$1_CPU_DEFINE
556
if test "x$OPENJDK_$1_CPU" = xx86; then
557
HOTSPOT_$1_CPU_DEFINE=IA32
558
elif test "x$OPENJDK_$1_CPU" = xx86_64; then
559
HOTSPOT_$1_CPU_DEFINE=AMD64
560
elif test "x$OPENJDK_$1_CPU" = xx32; then
561
HOTSPOT_$1_CPU_DEFINE=X32
562
elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
563
HOTSPOT_$1_CPU_DEFINE=SPARC
564
elif test "x$OPENJDK_$1_CPU" = xaarch64; then
565
HOTSPOT_$1_CPU_DEFINE=AARCH64
566
elif test "x$OPENJDK_$1_CPU" = xppc64; then
567
HOTSPOT_$1_CPU_DEFINE=PPC64
568
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
569
HOTSPOT_$1_CPU_DEFINE=PPC64
570
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
571
HOTSPOT_$1_CPU_DEFINE=RISCV64
573
# The cpu defines below are for zero, we don't support them directly.
574
elif test "x$OPENJDK_$1_CPU" = xsparc; then
575
HOTSPOT_$1_CPU_DEFINE=SPARC
576
elif test "x$OPENJDK_$1_CPU" = xppc; then
577
HOTSPOT_$1_CPU_DEFINE=PPC32
578
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
579
HOTSPOT_$1_CPU_DEFINE=RISCV32
580
elif test "x$OPENJDK_$1_CPU" = xs390; then
581
HOTSPOT_$1_CPU_DEFINE=S390
582
elif test "x$OPENJDK_$1_CPU" = xs390x; then
583
HOTSPOT_$1_CPU_DEFINE=S390
584
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
585
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
586
elif test "x$OPENJDK_$1_CPU" != x; then
587
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
589
AC_SUBST(HOTSPOT_$1_CPU_DEFINE)
591
HOTSPOT_$1_LIBC=$OPENJDK_$1_LIBC
592
AC_SUBST(HOTSPOT_$1_LIBC)
594
# For historical reasons, the OS include directories have odd names.
595
OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
596
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
597
OPENJDK_$1_OS_INCLUDE_SUBDIR="win32"
598
elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
599
OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin"
601
AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR)
604
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
606
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
607
RELEASE_FILE_OS_NAME=Linux
609
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
610
RELEASE_FILE_OS_NAME=Windows
612
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
613
RELEASE_FILE_OS_NAME="Darwin"
615
if test "x$OPENJDK_TARGET_OS" = "xaix"; then
616
RELEASE_FILE_OS_NAME="AIX"
618
RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU}
619
RELEASE_FILE_LIBC=${OPENJDK_TARGET_LIBC}
621
AC_SUBST(RELEASE_FILE_OS_NAME)
622
AC_SUBST(RELEASE_FILE_OS_ARCH)
623
AC_SUBST(RELEASE_FILE_LIBC)
626
AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
628
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
629
OPENJDK_MODULE_TARGET_OS_NAME="macos"
631
OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS"
634
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
635
OPENJDK_MODULE_TARGET_OS_ARCH="amd64"
637
OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU"
640
OPENJDK_MODULE_TARGET_PLATFORM="${OPENJDK_MODULE_TARGET_OS_NAME}-${OPENJDK_MODULE_TARGET_OS_ARCH}"
641
AC_SUBST(OPENJDK_MODULE_TARGET_PLATFORM)
644
#%%% Build and target systems %%%
645
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
646
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
648
# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
649
# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the
650
# product you're building. The target of this build is called "host". Since this is confusing to most people, we
651
# have not adopted that system, but use "target" as the platform we are building for. In some places though we need
652
# to use the configure naming style.
657
PLATFORM_EXTRACT_TARGET_AND_BUILD
658
PLATFORM_SETUP_TARGET_CPU_BITS
659
PLATFORM_SET_MODULE_TARGET_OS_VALUES
660
PLATFORM_SET_RELEASE_FILE_OS_VALUES
661
PLATFORM_SETUP_LEGACY_VARS
662
PLATFORM_CHECK_DEPRECATION
665
AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
667
AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@],
668
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
669
if test "x$OPENJDK_TARGET_OS" = xwindows && test "x$OPENJDK_TARGET_CPU" = xx86; then
670
if test "x$enable_deprecated_ports" = "xyes"; then
671
AC_MSG_WARN([The Windows 32-bit x86 port is deprecated and may be removed in a future release.])
673
AC_MSG_ERROR(m4_normalize([The Windows 32-bit x86 port is deprecated and may be removed in a future release.
674
Use --enable-deprecated-ports=yes to suppress this error.]))
679
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
681
###############################################################################
683
# Note that this is the build platform OS version!
685
OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
686
OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
687
OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
688
OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
689
AC_SUBST(OS_VERSION_MAJOR)
690
AC_SUBST(OS_VERSION_MINOR)
691
AC_SUBST(OS_VERSION_MICRO)
694
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
696
###############################################################################
698
# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code.
699
# (The JVM can use 32 or 64 bit Java pointers but that decision
700
# is made at runtime.)
703
# Make compilation sanity check
704
AC_CHECK_HEADERS([stdio.h], , [
705
AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.])
706
if test "x$COMPILE_TYPE" = xreduced; then
707
HELP_MSG_MISSING_DEPENDENCY([reduced])
708
AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
709
elif test "x$COMPILE_TYPE" = xcross; then
710
AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
712
AC_MSG_ERROR([Cannot continue.])
715
AC_CHECK_SIZEOF([int *], [1111])
717
# AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*'
718
if test "x$ac_cv_sizeof_int_p" = x; then
719
# The test failed, lets stick to the assumed value.
720
AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.])
722
TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
724
if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
725
AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
726
if test "x$COMPILE_TYPE" = xreduced; then
727
HELP_MSG_MISSING_DEPENDENCY([reduced])
728
AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
729
elif test "x$COMPILE_TYPE" = xcross; then
730
AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
732
AC_MSG_ERROR([Cannot continue.])
736
AC_MSG_CHECKING([for target address size])
737
AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits])
740
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
742
###############################################################################
744
# Is the target little or big endian?
746
AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"])
748
if test "x$ENDIAN" = xuniversal_endianness; then
749
AC_MSG_ERROR([Building with both big and little endianness is not supported])
751
if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then
752
AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)])