Thu, 04 Oct 2018 02:46:08 -0700
Added tag jdk8u181-b37 for changeset 6be7467c0f3b
ohair@425 | 1 | # |
gthornbr@1586 | 2 | # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
ohair@425 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@425 | 4 | # |
ohair@425 | 5 | # This code is free software; you can redistribute it and/or modify it |
ohair@425 | 6 | # under the terms of the GNU General Public License version 2 only, as |
ohair@425 | 7 | # published by the Free Software Foundation. Oracle designates this |
ohair@425 | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair@425 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
ohair@425 | 10 | # |
ohair@425 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@425 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@425 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@425 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
ohair@425 | 15 | # accompanied this code). |
ohair@425 | 16 | # |
ohair@425 | 17 | # You should have received a copy of the GNU General Public License version |
ohair@425 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
ohair@425 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@425 | 20 | # |
ohair@425 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@425 | 22 | # or visit www.oracle.com if you need additional information or have any |
ohair@425 | 23 | # questions. |
ohair@425 | 24 | # |
ohair@425 | 25 | |
ohair@478 | 26 | # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. |
ohair@478 | 27 | # Converts autoconf style CPU name to OpenJDK style, into |
ohair@478 | 28 | # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. |
erikj@458 | 29 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], |
ohair@425 | 30 | [ |
ohair@425 | 31 | # First argument is the cpu name from the trip/quad |
ohair@425 | 32 | case "$1" in |
ohair@425 | 33 | x86_64) |
ohair@478 | 34 | VAR_CPU=x86_64 |
ohair@425 | 35 | VAR_CPU_ARCH=x86 |
ohair@425 | 36 | VAR_CPU_BITS=64 |
ohair@425 | 37 | VAR_CPU_ENDIAN=little |
ohair@425 | 38 | ;; |
ohair@425 | 39 | i?86) |
ohair@478 | 40 | VAR_CPU=x86 |
ohair@425 | 41 | VAR_CPU_ARCH=x86 |
ohair@425 | 42 | VAR_CPU_BITS=32 |
ohair@425 | 43 | VAR_CPU_ENDIAN=little |
ohair@425 | 44 | ;; |
ohair@425 | 45 | arm*) |
ohair@425 | 46 | VAR_CPU=arm |
ohair@425 | 47 | VAR_CPU_ARCH=arm |
erikj@458 | 48 | VAR_CPU_BITS=32 |
erikj@458 | 49 | VAR_CPU_ENDIAN=little |
ohair@425 | 50 | ;; |
aph@1321 | 51 | aarch64) |
aph@1321 | 52 | VAR_CPU=aarch64 |
aph@1321 | 53 | VAR_CPU_ARCH=aarch64 |
aph@1321 | 54 | VAR_CPU_BITS=64 |
aph@1321 | 55 | VAR_CPU_ENDIAN=little |
aph@1321 | 56 | ;; |
ohair@425 | 57 | powerpc) |
ohair@425 | 58 | VAR_CPU=ppc |
ohair@425 | 59 | VAR_CPU_ARCH=ppc |
ohair@425 | 60 | VAR_CPU_BITS=32 |
ohair@425 | 61 | VAR_CPU_ENDIAN=big |
ihse@839 | 62 | ;; |
ohair@425 | 63 | powerpc64) |
ohair@425 | 64 | VAR_CPU=ppc64 |
ohair@425 | 65 | VAR_CPU_ARCH=ppc |
ohair@425 | 66 | VAR_CPU_BITS=64 |
erikj@458 | 67 | VAR_CPU_ENDIAN=big |
ihse@839 | 68 | ;; |
kvn@985 | 69 | powerpc64le) |
kvn@985 | 70 | VAR_CPU=ppc64 |
kvn@985 | 71 | VAR_CPU_ARCH=ppc |
kvn@985 | 72 | VAR_CPU_BITS=64 |
kvn@985 | 73 | VAR_CPU_ENDIAN=little |
kvn@985 | 74 | ;; |
omajid@788 | 75 | s390) |
omajid@788 | 76 | VAR_CPU=s390 |
omajid@788 | 77 | VAR_CPU_ARCH=s390 |
omajid@788 | 78 | VAR_CPU_BITS=32 |
omajid@788 | 79 | VAR_CPU_ENDIAN=big |
ihse@839 | 80 | ;; |
omajid@788 | 81 | s390x) |
omajid@788 | 82 | VAR_CPU=s390x |
omajid@788 | 83 | VAR_CPU_ARCH=s390 |
omajid@788 | 84 | VAR_CPU_BITS=64 |
omajid@788 | 85 | VAR_CPU_ENDIAN=big |
ihse@839 | 86 | ;; |
ohair@425 | 87 | sparc) |
ohair@425 | 88 | VAR_CPU=sparc |
ohair@425 | 89 | VAR_CPU_ARCH=sparc |
ohair@425 | 90 | VAR_CPU_BITS=32 |
ohair@425 | 91 | VAR_CPU_ENDIAN=big |
ihse@839 | 92 | ;; |
gthornbr@1586 | 93 | sparcv9|sparc64) |
ohair@425 | 94 | VAR_CPU=sparcv9 |
ohair@425 | 95 | VAR_CPU_ARCH=sparc |
ohair@425 | 96 | VAR_CPU_BITS=64 |
ohair@425 | 97 | VAR_CPU_ENDIAN=big |
ihse@839 | 98 | ;; |
ohair@425 | 99 | *) |
erikj@445 | 100 | AC_MSG_ERROR([unsupported cpu $1]) |
ohair@425 | 101 | ;; |
ohair@425 | 102 | esac |
ohair@425 | 103 | ]) |
ohair@425 | 104 | |
ohair@478 | 105 | # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. |
ohair@478 | 106 | # Converts autoconf style OS name to OpenJDK style, into |
ohair@478 | 107 | # VAR_OS and VAR_OS_API. |
erikj@458 | 108 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], |
ohair@425 | 109 | [ |
ohair@425 | 110 | case "$1" in |
ohair@425 | 111 | *linux*) |
ohair@425 | 112 | VAR_OS=linux |
ohair@425 | 113 | VAR_OS_API=posix |
ohair@494 | 114 | VAR_OS_ENV=linux |
ohair@425 | 115 | ;; |
ohair@425 | 116 | *solaris*) |
ohair@425 | 117 | VAR_OS=solaris |
ohair@425 | 118 | VAR_OS_API=posix |
ohair@494 | 119 | VAR_OS_ENV=solaris |
ohair@425 | 120 | ;; |
ohair@425 | 121 | *darwin*) |
ohair@425 | 122 | VAR_OS=macosx |
ohair@425 | 123 | VAR_OS_API=posix |
ohair@494 | 124 | VAR_OS_ENV=macosx |
ohair@425 | 125 | ;; |
ohair@425 | 126 | *bsd*) |
ohair@425 | 127 | VAR_OS=bsd |
ohair@425 | 128 | VAR_OS_API=posix |
ohair@494 | 129 | VAR_OS_ENV=bsd |
ohair@425 | 130 | ;; |
ohair@494 | 131 | *cygwin*) |
ohair@425 | 132 | VAR_OS=windows |
ohair@425 | 133 | VAR_OS_API=winapi |
ohair@494 | 134 | VAR_OS_ENV=windows.cygwin |
ohair@494 | 135 | ;; |
ohair@494 | 136 | *mingw*) |
ohair@494 | 137 | VAR_OS=windows |
ohair@494 | 138 | VAR_OS_API=winapi |
ohair@494 | 139 | VAR_OS_ENV=windows.msys |
ohair@425 | 140 | ;; |
simonis@971 | 141 | *aix*) |
simonis@971 | 142 | VAR_OS=aix |
simonis@971 | 143 | VAR_OS_API=posix |
simonis@971 | 144 | VAR_OS_ENV=aix |
simonis@971 | 145 | ;; |
ohair@425 | 146 | *) |
erikj@458 | 147 | AC_MSG_ERROR([unsupported operating system $1]) |
ohair@425 | 148 | ;; |
ohair@425 | 149 | esac |
ohair@425 | 150 | ]) |
ohair@425 | 151 | |
ohair@478 | 152 | # Expects $host_os $host_cpu $build_os and $build_cpu |
ohair@478 | 153 | # and $with_target_bits to have been setup! |
ohair@478 | 154 | # |
ohair@478 | 155 | # Translate the standard triplet(quadruplet) definition |
ohair@478 | 156 | # of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU, |
ohair@478 | 157 | # OPENJDK_BUILD_OS, etc. |
ohair@478 | 158 | AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], |
ohair@478 | 159 | [ |
ihse@839 | 160 | # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME |
ihse@839 | 161 | # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME |
ihse@839 | 162 | # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, |
ihse@839 | 163 | # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. |
ihse@839 | 164 | OPENJDK_TARGET_AUTOCONF_NAME="$host" |
ihse@839 | 165 | OPENJDK_BUILD_AUTOCONF_NAME="$build" |
ihse@839 | 166 | AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) |
ihse@839 | 167 | AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) |
ohair@478 | 168 | |
ihse@839 | 169 | # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
ihse@839 | 170 | PLATFORM_EXTRACT_VARS_FROM_OS($build_os) |
ihse@839 | 171 | PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) |
ihse@839 | 172 | # ..and setup our own variables. (Do this explicitely to facilitate searching) |
ihse@839 | 173 | OPENJDK_BUILD_OS="$VAR_OS" |
ihse@839 | 174 | OPENJDK_BUILD_OS_API="$VAR_OS_API" |
ihse@839 | 175 | OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" |
ihse@839 | 176 | OPENJDK_BUILD_CPU="$VAR_CPU" |
ihse@839 | 177 | OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" |
ihse@839 | 178 | OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" |
ihse@839 | 179 | OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
ihse@839 | 180 | AC_SUBST(OPENJDK_BUILD_OS) |
ihse@839 | 181 | AC_SUBST(OPENJDK_BUILD_OS_API) |
ihse@839 | 182 | AC_SUBST(OPENJDK_BUILD_CPU) |
ihse@839 | 183 | AC_SUBST(OPENJDK_BUILD_CPU_ARCH) |
ihse@839 | 184 | AC_SUBST(OPENJDK_BUILD_CPU_BITS) |
ihse@839 | 185 | AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) |
ohair@494 | 186 | |
ihse@839 | 187 | AC_MSG_CHECKING([openjdk-build os-cpu]) |
ihse@839 | 188 | AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) |
ohair@494 | 189 | |
ihse@839 | 190 | # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
ihse@839 | 191 | PLATFORM_EXTRACT_VARS_FROM_OS($host_os) |
ihse@839 | 192 | PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) |
ihse@839 | 193 | # ... and setup our own variables. (Do this explicitely to facilitate searching) |
ihse@839 | 194 | OPENJDK_TARGET_OS="$VAR_OS" |
ihse@839 | 195 | OPENJDK_TARGET_OS_API="$VAR_OS_API" |
ihse@839 | 196 | OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" |
ihse@839 | 197 | OPENJDK_TARGET_CPU="$VAR_CPU" |
ihse@839 | 198 | OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" |
ihse@839 | 199 | OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" |
ihse@839 | 200 | OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
ihse@839 | 201 | AC_SUBST(OPENJDK_TARGET_OS) |
ihse@839 | 202 | AC_SUBST(OPENJDK_TARGET_OS_API) |
ihse@839 | 203 | AC_SUBST(OPENJDK_TARGET_CPU) |
ihse@839 | 204 | AC_SUBST(OPENJDK_TARGET_CPU_ARCH) |
ihse@839 | 205 | AC_SUBST(OPENJDK_TARGET_CPU_BITS) |
ihse@839 | 206 | AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) |
ohair@478 | 207 | |
ihse@839 | 208 | AC_MSG_CHECKING([openjdk-target os-cpu]) |
ihse@839 | 209 | AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) |
ohair@478 | 210 | ]) |
ohair@478 | 211 | |
ohair@478 | 212 | # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour |
ohair@478 | 213 | # accordingly. Must be done after setting up build and target system, but before |
ohair@478 | 214 | # doing anything else with these values. |
ohair@478 | 215 | AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], |
ohair@478 | 216 | [ |
ohair@478 | 217 | AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], |
ihse@839 | 218 | [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) |
ohair@478 | 219 | |
ohair@478 | 220 | # We have three types of compiles: |
ohair@478 | 221 | # native == normal compilation, target system == build system |
ohair@478 | 222 | # cross == traditional cross compilation, target system != build system; special toolchain needed |
ohair@478 | 223 | # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines |
ohair@478 | 224 | # |
ohair@478 | 225 | if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then |
ohair@478 | 226 | # We're doing a proper cross-compilation |
ohair@478 | 227 | COMPILE_TYPE="cross" |
ohair@478 | 228 | else |
ohair@478 | 229 | COMPILE_TYPE="native" |
ohair@478 | 230 | fi |
ohair@478 | 231 | |
ohair@478 | 232 | if test "x$with_target_bits" != x; then |
ohair@478 | 233 | if test "x$COMPILE_TYPE" = "xcross"; then |
ohair@478 | 234 | AC_MSG_ERROR([It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either.]) |
ohair@478 | 235 | fi |
ohair@478 | 236 | |
ohair@478 | 237 | if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ohair@478 | 238 | # A reduced build is requested |
ohair@478 | 239 | COMPILE_TYPE="reduced" |
ohair@478 | 240 | OPENJDK_TARGET_CPU_BITS=32 |
ohair@478 | 241 | if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then |
ohair@478 | 242 | OPENJDK_TARGET_CPU=x86 |
ohair@478 | 243 | elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
ohair@478 | 244 | OPENJDK_TARGET_CPU=sparc |
ohair@478 | 245 | else |
ohair@478 | 246 | AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) |
ihse@839 | 247 | fi |
ohair@478 | 248 | elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
ohair@478 | 249 | AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.]) |
ohair@478 | 250 | elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then |
ohair@478 | 251 | AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning]) |
ohair@478 | 252 | else |
ohair@478 | 253 | AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!]) |
ohair@478 | 254 | fi |
ohair@478 | 255 | fi |
ohair@478 | 256 | AC_SUBST(COMPILE_TYPE) |
ohair@478 | 257 | |
ihse@839 | 258 | AC_MSG_CHECKING([compilation type]) |
ihse@839 | 259 | AC_MSG_RESULT([$COMPILE_TYPE]) |
ohair@478 | 260 | ]) |
ohair@478 | 261 | |
ihse@839 | 262 | # Setup the legacy variables, for controlling the old makefiles. |
ihse@839 | 263 | # |
ohair@478 | 264 | AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], |
ohair@478 | 265 | [ |
ihse@839 | 266 | # Also store the legacy naming of the cpu. |
ihse@839 | 267 | # Ie i586 and amd64 instead of x86 and x86_64 |
ihse@839 | 268 | OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" |
ihse@839 | 269 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ihse@839 | 270 | OPENJDK_TARGET_CPU_LEGACY="i586" |
ihse@839 | 271 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@839 | 272 | # On all platforms except MacOSX replace x86_64 with amd64. |
ihse@839 | 273 | OPENJDK_TARGET_CPU_LEGACY="amd64" |
ihse@839 | 274 | fi |
ihse@839 | 275 | AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) |
ihse@839 | 276 | |
ihse@839 | 277 | # And the second legacy naming of the cpu. |
ihse@839 | 278 | # Ie i386 and amd64 instead of x86 and x86_64. |
ihse@839 | 279 | OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" |
ihse@839 | 280 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ihse@839 | 281 | OPENJDK_TARGET_CPU_LEGACY_LIB="i386" |
ihse@839 | 282 | elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@839 | 283 | OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" |
ihse@839 | 284 | fi |
ihse@839 | 285 | AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) |
ihse@839 | 286 | |
ihse@839 | 287 | # This is the name of the cpu (but using i386 and amd64 instead of |
ihse@839 | 288 | # x86 and x86_64, respectively), preceeded by a /, to be used when |
ihse@839 | 289 | # locating libraries. On macosx, it's empty, though. |
ihse@839 | 290 | OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" |
ihse@839 | 291 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ihse@839 | 292 | OPENJDK_TARGET_CPU_LIBDIR="" |
ihse@839 | 293 | fi |
ihse@839 | 294 | AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) |
ihse@839 | 295 | |
ihse@839 | 296 | # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to |
ihse@839 | 297 | # /amd64 or /sparcv9. This string is appended to some library paths, like this: |
ihse@839 | 298 | # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so |
ihse@839 | 299 | OPENJDK_TARGET_CPU_ISADIR="" |
ihse@839 | 300 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ihse@839 | 301 | if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@839 | 302 | OPENJDK_TARGET_CPU_ISADIR="/amd64" |
ihse@839 | 303 | elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
ihse@839 | 304 | OPENJDK_TARGET_CPU_ISADIR="/sparcv9" |
ohair@478 | 305 | fi |
ihse@839 | 306 | fi |
ihse@839 | 307 | AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) |
ohair@478 | 308 | |
ihse@839 | 309 | # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property |
ihse@839 | 310 | OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" |
ihse@839 | 311 | if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then |
ihse@839 | 312 | # On linux only, we replace x86 with i386. |
ihse@839 | 313 | OPENJDK_TARGET_CPU_OSARCH="i386" |
ihse@839 | 314 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@839 | 315 | # On all platforms except macosx, we replace x86_64 with amd64. |
ihse@839 | 316 | OPENJDK_TARGET_CPU_OSARCH="amd64" |
ihse@839 | 317 | fi |
ihse@839 | 318 | AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) |
ihse@839 | 319 | |
ihse@839 | 320 | OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" |
ihse@839 | 321 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ihse@839 | 322 | OPENJDK_TARGET_CPU_JLI="i386" |
ihse@839 | 323 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ihse@839 | 324 | # On all platforms except macosx, we replace x86_64 with amd64. |
ihse@839 | 325 | OPENJDK_TARGET_CPU_JLI="amd64" |
ihse@839 | 326 | fi |
ihse@839 | 327 | # Now setup the -D flags for building libjli. |
ihse@839 | 328 | OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" |
ihse@839 | 329 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ihse@839 | 330 | if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then |
ihse@839 | 331 | OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" |
ihse@839 | 332 | elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then |
ihse@839 | 333 | OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" |
ohair@478 | 334 | fi |
ihse@839 | 335 | fi |
ihse@839 | 336 | AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
ohair@478 | 337 | |
ihse@839 | 338 | # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. |
ihse@839 | 339 | if test "x$OPENJDK_TARGET_OS_API" = xposix; then |
ihse@839 | 340 | OPENJDK_TARGET_OS_API_DIR="solaris" |
ihse@839 | 341 | fi |
ihse@839 | 342 | if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then |
ihse@839 | 343 | OPENJDK_TARGET_OS_API_DIR="windows" |
ihse@839 | 344 | fi |
ihse@839 | 345 | AC_SUBST(OPENJDK_TARGET_OS_API_DIR) |
ihse@839 | 346 | |
dholmes@872 | 347 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
dholmes@872 | 348 | OPENJDK_TARGET_OS_EXPORT_DIR=macosx |
dholmes@872 | 349 | else |
dholmes@872 | 350 | OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} |
dholmes@872 | 351 | fi |
dholmes@872 | 352 | AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) |
dholmes@872 | 353 | |
ihse@839 | 354 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ihse@839 | 355 | A_LP64="LP64:=" |
ihse@839 | 356 | # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in |
ihse@839 | 357 | # unpack200.exe |
ihse@839 | 358 | if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ihse@839 | 359 | ADD_LP64="-D_LP64=1" |
ohair@478 | 360 | fi |
ihse@839 | 361 | fi |
ihse@839 | 362 | AC_SUBST(LP64,$A_LP64) |
ohair@478 | 363 | |
ihse@839 | 364 | if test "x$COMPILE_TYPE" = "xcross"; then |
ihse@839 | 365 | # FIXME: ... or should this include reduced builds..? |
ihse@839 | 366 | DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" |
ihse@839 | 367 | else |
ihse@839 | 368 | DEFINE_CROSS_COMPILE_ARCH="" |
ihse@839 | 369 | fi |
ihse@839 | 370 | AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) |
ohair@478 | 371 | |
ihse@839 | 372 | # ZERO_ARCHDEF is used to enable architecture-specific code |
ihse@839 | 373 | case "${OPENJDK_TARGET_CPU}" in |
sgehwolf@1314 | 374 | ppc) ZERO_ARCHDEF=PPC32 ;; |
sgehwolf@1314 | 375 | ppc64) ZERO_ARCHDEF=PPC64 ;; |
ihse@839 | 376 | s390*) ZERO_ARCHDEF=S390 ;; |
ihse@839 | 377 | sparc*) ZERO_ARCHDEF=SPARC ;; |
ihse@839 | 378 | x86_64*) ZERO_ARCHDEF=AMD64 ;; |
ihse@839 | 379 | x86) ZERO_ARCHDEF=IA32 ;; |
ihse@839 | 380 | *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) |
ihse@839 | 381 | esac |
ihse@839 | 382 | AC_SUBST(ZERO_ARCHDEF) |
ohair@478 | 383 | ]) |
ohair@478 | 384 | |
erikj@458 | 385 | AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], |
ohair@425 | 386 | [ |
ihse@839 | 387 | if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
ihse@839 | 388 | REQUIRED_OS_NAME=SunOS |
ihse@839 | 389 | REQUIRED_OS_VERSION=5.10 |
ihse@839 | 390 | fi |
ihse@839 | 391 | if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
ihse@839 | 392 | REQUIRED_OS_NAME=Linux |
ihse@839 | 393 | REQUIRED_OS_VERSION=2.6 |
ihse@839 | 394 | fi |
ihse@839 | 395 | if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
ihse@839 | 396 | REQUIRED_OS_NAME=Windows |
ihse@839 | 397 | if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
ihse@839 | 398 | REQUIRED_OS_VERSION=5.2 |
ihse@839 | 399 | else |
ihse@839 | 400 | REQUIRED_OS_VERSION=5.1 |
erikj@445 | 401 | fi |
ihse@839 | 402 | fi |
ihse@839 | 403 | if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
ihse@839 | 404 | REQUIRED_OS_NAME=Darwin |
ihse@839 | 405 | REQUIRED_OS_VERSION=11.2 |
ihse@839 | 406 | fi |
erikj@445 | 407 | |
ihse@839 | 408 | AC_SUBST(REQUIRED_OS_NAME) |
ihse@839 | 409 | AC_SUBST(REQUIRED_OS_VERSION) |
erikj@445 | 410 | ]) |
erikj@458 | 411 | |
erikj@458 | 412 | #%%% Build and target systems %%% |
erikj@458 | 413 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], |
erikj@458 | 414 | [ |
ihse@839 | 415 | # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" |
ihse@839 | 416 | # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the |
ihse@839 | 417 | # product you're building. The target of this build is called "host". Since this is confusing to most people, we |
ihse@839 | 418 | # have not adopted that system, but use "target" as the platform we are building for. In some places though we need |
ihse@839 | 419 | # to use the configure naming style. |
ihse@839 | 420 | AC_CANONICAL_BUILD |
ihse@839 | 421 | AC_CANONICAL_HOST |
ihse@839 | 422 | AC_CANONICAL_TARGET |
erikj@458 | 423 | |
ihse@839 | 424 | PLATFORM_EXTRACT_TARGET_AND_BUILD |
ihse@839 | 425 | PLATFORM_SETUP_TARGET_CPU_BITS |
ihse@839 | 426 | PLATFORM_SET_RELEASE_FILE_OS_VALUES |
ihse@839 | 427 | PLATFORM_SETUP_LEGACY_VARS |
erikj@458 | 428 | ]) |
erikj@458 | 429 | |
erikj@458 | 430 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], |
erikj@458 | 431 | [ |
ihse@839 | 432 | ############################################################################### |
erikj@458 | 433 | |
ihse@839 | 434 | # Note that this is the build platform OS version! |
erikj@458 | 435 | |
ihse@839 | 436 | OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" |
ihse@839 | 437 | OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" |
ihse@839 | 438 | OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" |
ihse@839 | 439 | OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" |
ihse@839 | 440 | AC_SUBST(OS_VERSION_MAJOR) |
ihse@839 | 441 | AC_SUBST(OS_VERSION_MINOR) |
ihse@839 | 442 | AC_SUBST(OS_VERSION_MICRO) |
erikj@458 | 443 | ]) |
erikj@458 | 444 | |
ohair@478 | 445 | # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. |
ohair@478 | 446 | # Add -mX to various FLAGS variables. |
ohair@478 | 447 | AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], |
ohair@478 | 448 | [ |
ihse@798 | 449 | # When we add flags to the "official" CFLAGS etc, we need to |
ihse@798 | 450 | # keep track of these additions in ADDED_CFLAGS etc. These |
ihse@798 | 451 | # will later be checked to make sure only controlled additions |
ihse@798 | 452 | # have been made to CFLAGS etc. |
simonis@971 | 453 | ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
simonis@971 | 454 | ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
simonis@971 | 455 | ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
ohair@478 | 456 | |
ihse@798 | 457 | CFLAGS="${CFLAGS}${ADDED_CFLAGS}" |
ihse@798 | 458 | CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" |
ihse@798 | 459 | LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" |
ohair@478 | 460 | |
ihse@798 | 461 | CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" |
ihse@798 | 462 | CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" |
ihse@798 | 463 | LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" |
ohair@478 | 464 | ]) |
ohair@478 | 465 | |
ohair@478 | 466 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], |
erikj@458 | 467 | [ |
ihse@839 | 468 | ############################################################################### |
ihse@839 | 469 | # |
ihse@839 | 470 | # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. |
ihse@839 | 471 | # (The JVM can use 32 or 64 bit Java pointers but that decision |
ihse@839 | 472 | # is made at runtime.) |
ihse@839 | 473 | # |
omajid@695 | 474 | |
kvn@972 | 475 | if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then |
kvn@972 | 476 | # Always specify -m flag on Solaris |
kvn@972 | 477 | # And -q on AIX because otherwise the compiler produces 32-bit objects by default |
ohair@478 | 478 | PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
ihse@839 | 479 | elif test "x$COMPILE_TYPE" = xreduced; then |
ihse@839 | 480 | if test "x$OPENJDK_TARGET_OS" != xwindows; then |
ihse@839 | 481 | # Specify -m if running reduced on other Posix platforms |
ihse@839 | 482 | PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
ihse@839 | 483 | fi |
ohair@478 | 484 | fi |
ohair@478 | 485 | |
ihse@839 | 486 | # Make compilation sanity check |
ihse@839 | 487 | AC_CHECK_HEADERS([stdio.h], , [ |
ihse@839 | 488 | AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) |
ihse@839 | 489 | if test "x$COMPILE_TYPE" = xreduced; then |
ihse@839 | 490 | AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) |
ihse@839 | 491 | elif test "x$COMPILE_TYPE" = xcross; then |
ihse@839 | 492 | AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) |
ihse@839 | 493 | fi |
ihse@839 | 494 | AC_MSG_ERROR([Cannot continue.]) |
ihse@839 | 495 | ]) |
ihse@839 | 496 | |
ihse@839 | 497 | AC_CHECK_SIZEOF([int *], [1111]) |
ihse@839 | 498 | |
kvn@972 | 499 | # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' |
kvn@972 | 500 | if test "x$ac_cv_sizeof_int_p" = x; then |
ohair@478 | 501 | # The test failed, lets stick to the assumed value. |
ohair@478 | 502 | AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) |
ihse@839 | 503 | else |
simonis@971 | 504 | TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
erikj@458 | 505 | |
ohair@478 | 506 | if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
kvn@972 | 507 | # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects |
kvn@972 | 508 | # Let's try to implicitely set the compilers target architecture and retry the test |
kvn@972 | 509 | 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).]) |
kvn@972 | 510 | AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) |
kvn@972 | 511 | PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
simonis@971 | 512 | |
kvn@972 | 513 | # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! |
kvn@972 | 514 | unset ac_cv_sizeof_int_p |
kvn@972 | 515 | # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF |
kvn@972 | 516 | cat >>confdefs.h <<_ACEOF |
simonis@971 | 517 | #undef SIZEOF_INT_P |
simonis@971 | 518 | _ACEOF |
simonis@971 | 519 | |
kvn@972 | 520 | AC_CHECK_SIZEOF([int *], [1111]) |
simonis@971 | 521 | |
kvn@972 | 522 | TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
simonis@971 | 523 | |
kvn@972 | 524 | if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
kvn@972 | 525 | AC_MSG_ERROR([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)]) |
kvn@972 | 526 | fi |
erikj@458 | 527 | fi |
ihse@839 | 528 | fi |
erikj@458 | 529 | |
ihse@839 | 530 | AC_MSG_CHECKING([for target address size]) |
ihse@839 | 531 | AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) |
erikj@458 | 532 | ]) |
erikj@458 | 533 | |
erikj@458 | 534 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], |
erikj@458 | 535 | [ |
ihse@839 | 536 | ############################################################################### |
ihse@839 | 537 | # |
ihse@839 | 538 | # Is the target little of big endian? |
ihse@839 | 539 | # |
ihse@839 | 540 | AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) |
erikj@458 | 541 | |
ihse@839 | 542 | if test "x$ENDIAN" = xuniversal_endianness; then |
erikj@458 | 543 | AC_MSG_ERROR([Building with both big and little endianness is not supported]) |
ihse@839 | 544 | fi |
ihse@839 | 545 | if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then |
ohair@478 | 546 | 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)]) |
ihse@839 | 547 | fi |
erikj@458 | 548 | ]) |