Mon, 31 Dec 2012 14:52:11 -0500
8005583: Install build(gnumake all) failed preventing RE from doing JDK8 combo builds
Reviewed-by: paulk, billyh
ohair@425 | 1 | # |
ohair@425 | 2 | # Copyright (c) 2011, 2012, 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 | ;; |
ohair@425 | 51 | powerpc) |
ohair@425 | 52 | VAR_CPU=ppc |
ohair@425 | 53 | VAR_CPU_ARCH=ppc |
ohair@425 | 54 | VAR_CPU_BITS=32 |
ohair@425 | 55 | VAR_CPU_ENDIAN=big |
ohair@425 | 56 | ;; |
ohair@425 | 57 | powerpc64) |
ohair@425 | 58 | VAR_CPU=ppc64 |
ohair@425 | 59 | VAR_CPU_ARCH=ppc |
ohair@425 | 60 | VAR_CPU_BITS=64 |
erikj@458 | 61 | VAR_CPU_ENDIAN=big |
ohair@425 | 62 | ;; |
ohair@425 | 63 | sparc) |
ohair@425 | 64 | VAR_CPU=sparc |
ohair@425 | 65 | VAR_CPU_ARCH=sparc |
ohair@425 | 66 | VAR_CPU_BITS=32 |
ohair@425 | 67 | VAR_CPU_ENDIAN=big |
ohair@425 | 68 | ;; |
ohair@478 | 69 | sparcv9) |
ohair@425 | 70 | VAR_CPU=sparcv9 |
ohair@425 | 71 | VAR_CPU_ARCH=sparc |
ohair@425 | 72 | VAR_CPU_BITS=64 |
ohair@425 | 73 | VAR_CPU_ENDIAN=big |
ohair@425 | 74 | ;; |
ohair@425 | 75 | *) |
erikj@445 | 76 | AC_MSG_ERROR([unsupported cpu $1]) |
ohair@425 | 77 | ;; |
ohair@425 | 78 | esac |
ohair@425 | 79 | ]) |
ohair@425 | 80 | |
ohair@478 | 81 | # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. |
ohair@478 | 82 | # Converts autoconf style OS name to OpenJDK style, into |
ohair@478 | 83 | # VAR_OS and VAR_OS_API. |
erikj@458 | 84 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], |
ohair@425 | 85 | [ |
ohair@425 | 86 | case "$1" in |
ohair@425 | 87 | *linux*) |
ohair@425 | 88 | VAR_OS=linux |
ohair@425 | 89 | VAR_OS_API=posix |
ohair@494 | 90 | VAR_OS_ENV=linux |
ohair@425 | 91 | ;; |
ohair@425 | 92 | *solaris*) |
ohair@425 | 93 | VAR_OS=solaris |
ohair@425 | 94 | VAR_OS_API=posix |
ohair@494 | 95 | VAR_OS_ENV=solaris |
ohair@425 | 96 | ;; |
ohair@425 | 97 | *darwin*) |
ohair@425 | 98 | VAR_OS=macosx |
ohair@425 | 99 | VAR_OS_API=posix |
ohair@494 | 100 | VAR_OS_ENV=macosx |
ohair@425 | 101 | ;; |
ohair@425 | 102 | *bsd*) |
ohair@425 | 103 | VAR_OS=bsd |
ohair@425 | 104 | VAR_OS_API=posix |
ohair@494 | 105 | VAR_OS_ENV=bsd |
ohair@425 | 106 | ;; |
ohair@494 | 107 | *cygwin*) |
ohair@425 | 108 | VAR_OS=windows |
ohair@425 | 109 | VAR_OS_API=winapi |
ohair@494 | 110 | VAR_OS_ENV=windows.cygwin |
ohair@494 | 111 | ;; |
ohair@494 | 112 | *mingw*) |
ohair@494 | 113 | VAR_OS=windows |
ohair@494 | 114 | VAR_OS_API=winapi |
ohair@494 | 115 | VAR_OS_ENV=windows.msys |
ohair@425 | 116 | ;; |
ohair@425 | 117 | *) |
erikj@458 | 118 | AC_MSG_ERROR([unsupported operating system $1]) |
ohair@425 | 119 | ;; |
ohair@425 | 120 | esac |
ohair@425 | 121 | ]) |
ohair@425 | 122 | |
ohair@478 | 123 | # Expects $host_os $host_cpu $build_os and $build_cpu |
ohair@478 | 124 | # and $with_target_bits to have been setup! |
ohair@478 | 125 | # |
ohair@478 | 126 | # Translate the standard triplet(quadruplet) definition |
ohair@478 | 127 | # of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU, |
ohair@478 | 128 | # OPENJDK_BUILD_OS, etc. |
ohair@478 | 129 | AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], |
ohair@478 | 130 | [ |
ohair@478 | 131 | # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME |
ohair@478 | 132 | # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME |
ohair@478 | 133 | # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, |
ohair@478 | 134 | # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. |
ohair@478 | 135 | OPENJDK_TARGET_AUTOCONF_NAME="$host" |
ohair@478 | 136 | OPENJDK_BUILD_AUTOCONF_NAME="$build" |
ohair@478 | 137 | AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) |
ohair@478 | 138 | AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) |
ohair@478 | 139 | |
ohair@478 | 140 | # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
ohair@494 | 141 | PLATFORM_EXTRACT_VARS_FROM_OS($build_os) |
ohair@494 | 142 | PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) |
ohair@494 | 143 | # ..and setup our own variables. (Do this explicitely to facilitate searching) |
ohair@494 | 144 | OPENJDK_BUILD_OS="$VAR_OS" |
ohair@494 | 145 | OPENJDK_BUILD_OS_API="$VAR_OS_API" |
ohair@494 | 146 | OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" |
ohair@494 | 147 | OPENJDK_BUILD_CPU="$VAR_CPU" |
ohair@494 | 148 | OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" |
ohair@494 | 149 | OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" |
ohair@494 | 150 | OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
ohair@494 | 151 | AC_SUBST(OPENJDK_BUILD_OS) |
ohair@494 | 152 | AC_SUBST(OPENJDK_BUILD_OS_API) |
ohair@494 | 153 | AC_SUBST(OPENJDK_BUILD_CPU) |
ohair@494 | 154 | AC_SUBST(OPENJDK_BUILD_CPU_ARCH) |
ohair@494 | 155 | AC_SUBST(OPENJDK_BUILD_CPU_BITS) |
ohair@494 | 156 | AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) |
ohair@494 | 157 | |
ohair@494 | 158 | AC_MSG_CHECKING([openjdk-build os-cpu]) |
ohair@494 | 159 | AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) |
ohair@494 | 160 | |
ohair@494 | 161 | # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
ohair@478 | 162 | PLATFORM_EXTRACT_VARS_FROM_OS($host_os) |
ohair@478 | 163 | PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) |
ohair@478 | 164 | # ... and setup our own variables. (Do this explicitely to facilitate searching) |
ohair@478 | 165 | OPENJDK_TARGET_OS="$VAR_OS" |
ohair@478 | 166 | OPENJDK_TARGET_OS_API="$VAR_OS_API" |
ohair@494 | 167 | OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" |
ohair@478 | 168 | OPENJDK_TARGET_CPU="$VAR_CPU" |
ohair@478 | 169 | OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" |
ohair@478 | 170 | OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" |
ohair@478 | 171 | OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
ohair@478 | 172 | AC_SUBST(OPENJDK_TARGET_OS) |
ohair@478 | 173 | AC_SUBST(OPENJDK_TARGET_OS_API) |
ohair@478 | 174 | AC_SUBST(OPENJDK_TARGET_CPU) |
ohair@478 | 175 | AC_SUBST(OPENJDK_TARGET_CPU_ARCH) |
ohair@478 | 176 | AC_SUBST(OPENJDK_TARGET_CPU_BITS) |
ohair@478 | 177 | AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) |
ohair@478 | 178 | |
ohair@494 | 179 | AC_MSG_CHECKING([openjdk-target os-cpu]) |
ohair@494 | 180 | AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) |
ohair@478 | 181 | ]) |
ohair@478 | 182 | |
ohair@478 | 183 | # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour |
ohair@478 | 184 | # accordingly. Must be done after setting up build and target system, but before |
ohair@478 | 185 | # doing anything else with these values. |
ohair@478 | 186 | AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], |
ohair@478 | 187 | [ |
ohair@478 | 188 | AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], |
ohair@478 | 189 | [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) |
ohair@478 | 190 | |
ohair@478 | 191 | # We have three types of compiles: |
ohair@478 | 192 | # native == normal compilation, target system == build system |
ohair@478 | 193 | # cross == traditional cross compilation, target system != build system; special toolchain needed |
ohair@478 | 194 | # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines |
ohair@478 | 195 | # |
ohair@478 | 196 | if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then |
ohair@478 | 197 | # We're doing a proper cross-compilation |
ohair@478 | 198 | COMPILE_TYPE="cross" |
ohair@478 | 199 | else |
ohair@478 | 200 | COMPILE_TYPE="native" |
ohair@478 | 201 | fi |
ohair@478 | 202 | |
ohair@478 | 203 | if test "x$with_target_bits" != x; then |
ohair@478 | 204 | if test "x$COMPILE_TYPE" = "xcross"; then |
ohair@478 | 205 | AC_MSG_ERROR([It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either.]) |
ohair@478 | 206 | fi |
ohair@478 | 207 | |
ohair@478 | 208 | if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ohair@478 | 209 | # A reduced build is requested |
ohair@478 | 210 | COMPILE_TYPE="reduced" |
ohair@478 | 211 | OPENJDK_TARGET_CPU_BITS=32 |
ohair@478 | 212 | if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then |
ohair@478 | 213 | OPENJDK_TARGET_CPU=x86 |
ohair@478 | 214 | elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
ohair@478 | 215 | OPENJDK_TARGET_CPU=sparc |
ohair@478 | 216 | else |
ohair@478 | 217 | AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) |
ohair@478 | 218 | fi |
ohair@478 | 219 | elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
ohair@478 | 220 | 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 | 221 | elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then |
ohair@478 | 222 | AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning]) |
ohair@478 | 223 | else |
ohair@478 | 224 | AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!]) |
ohair@478 | 225 | fi |
ohair@478 | 226 | fi |
ohair@478 | 227 | AC_SUBST(COMPILE_TYPE) |
ohair@478 | 228 | |
ohair@494 | 229 | AC_MSG_CHECKING([compilation type]) |
ohair@478 | 230 | AC_MSG_RESULT([$COMPILE_TYPE]) |
ohair@478 | 231 | ]) |
ohair@478 | 232 | |
ohair@478 | 233 | # Setup the legacy variables, for controlling the old makefiles. |
ohair@478 | 234 | # |
ohair@478 | 235 | AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], |
ohair@478 | 236 | [ |
ohair@478 | 237 | # Also store the legacy naming of the cpu. |
ohair@478 | 238 | # Ie i586 and amd64 instead of x86 and x86_64 |
ohair@478 | 239 | OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" |
ohair@478 | 240 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ohair@478 | 241 | OPENJDK_TARGET_CPU_LEGACY="i586" |
ohair@478 | 242 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ohair@478 | 243 | # On all platforms except MacOSX replace x86_64 with amd64. |
ohair@478 | 244 | OPENJDK_TARGET_CPU_LEGACY="amd64" |
ohair@478 | 245 | fi |
ohair@478 | 246 | AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) |
ohair@478 | 247 | |
ohair@478 | 248 | # And the second legacy naming of the cpu. |
ohair@478 | 249 | # Ie i386 and amd64 instead of x86 and x86_64. |
ohair@478 | 250 | OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" |
ohair@478 | 251 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ohair@478 | 252 | OPENJDK_TARGET_CPU_LEGACY_LIB="i386" |
ohair@478 | 253 | elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ohair@478 | 254 | OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" |
ohair@478 | 255 | fi |
ohair@478 | 256 | AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) |
ohair@478 | 257 | |
ohair@478 | 258 | # This is the name of the cpu (but using i386 and amd64 instead of |
ohair@478 | 259 | # x86 and x86_64, respectively), preceeded by a /, to be used when |
ohair@478 | 260 | # locating libraries. On macosx, it's empty, though. |
ohair@478 | 261 | OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" |
ohair@478 | 262 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ohair@478 | 263 | OPENJDK_TARGET_CPU_LIBDIR="" |
ohair@478 | 264 | fi |
ohair@478 | 265 | AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) |
ohair@478 | 266 | |
ohair@478 | 267 | # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to |
ohair@478 | 268 | # /amd64 or /sparcv9. This string is appended to some library paths, like this: |
ohair@478 | 269 | # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so |
ohair@478 | 270 | OPENJDK_TARGET_CPU_ISADIR="" |
ohair@478 | 271 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ohair@478 | 272 | if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ohair@478 | 273 | OPENJDK_TARGET_CPU_ISADIR="/amd64" |
ohair@478 | 274 | elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
ohair@478 | 275 | OPENJDK_TARGET_CPU_ISADIR="/sparcv9" |
ohair@478 | 276 | fi |
ohair@478 | 277 | fi |
ohair@478 | 278 | AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) |
ohair@478 | 279 | |
ohair@478 | 280 | # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property |
ohair@478 | 281 | OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" |
ohair@478 | 282 | if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then |
ohair@478 | 283 | # On linux only, we replace x86 with i386. |
ohair@478 | 284 | OPENJDK_TARGET_CPU_OSARCH="i386" |
ohair@478 | 285 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ohair@478 | 286 | # On all platforms except macosx, we replace x86_64 with amd64. |
ohair@478 | 287 | OPENJDK_TARGET_CPU_OSARCH="amd64" |
ohair@478 | 288 | fi |
ohair@478 | 289 | AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) |
ohair@478 | 290 | |
ohair@478 | 291 | OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" |
ohair@478 | 292 | if test "x$OPENJDK_TARGET_CPU" = xx86; then |
ohair@478 | 293 | OPENJDK_TARGET_CPU_JLI="i386" |
ohair@478 | 294 | elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
ohair@478 | 295 | # On all platforms except macosx, we replace x86_64 with amd64. |
ohair@478 | 296 | OPENJDK_TARGET_CPU_JLI="amd64" |
ohair@478 | 297 | fi |
ohair@478 | 298 | # Now setup the -D flags for building libjli. |
ohair@478 | 299 | OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" |
ohair@478 | 300 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ohair@478 | 301 | if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then |
ohair@478 | 302 | OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" |
ohair@478 | 303 | elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then |
ohair@478 | 304 | OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" |
ohair@478 | 305 | fi |
ohair@478 | 306 | fi |
ohair@478 | 307 | AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
ohair@478 | 308 | |
ohair@478 | 309 | # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. |
ohair@478 | 310 | if test "x$OPENJDK_TARGET_OS_API" = xposix; then |
ohair@478 | 311 | OPENJDK_TARGET_OS_API_DIR="solaris" |
ohair@478 | 312 | fi |
ohair@478 | 313 | if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then |
ohair@478 | 314 | OPENJDK_TARGET_OS_API_DIR="windows" |
ohair@478 | 315 | fi |
ohair@478 | 316 | AC_SUBST(OPENJDK_TARGET_OS_API_DIR) |
ohair@478 | 317 | |
ohair@478 | 318 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
ohair@478 | 319 | A_LP64="LP64:=" |
ohair@494 | 320 | # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in |
ohair@494 | 321 | # unpack200.exe |
ohair@494 | 322 | if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ohair@494 | 323 | ADD_LP64="-D_LP64=1" |
ohair@494 | 324 | fi |
ohair@478 | 325 | fi |
ohair@478 | 326 | AC_SUBST(LP64,$A_LP64) |
ohair@478 | 327 | |
ohair@478 | 328 | if test "x$COMPILE_TYPE" = "xcross"; then |
ohair@478 | 329 | # FIXME: ... or should this include reduced builds..? |
ohair@478 | 330 | DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" |
ohair@478 | 331 | else |
ohair@478 | 332 | DEFINE_CROSS_COMPILE_ARCH="" |
ohair@478 | 333 | fi |
ohair@478 | 334 | AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) |
ohair@478 | 335 | ]) |
ohair@478 | 336 | |
erikj@458 | 337 | AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], |
ohair@425 | 338 | [ |
erikj@458 | 339 | if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
erikj@445 | 340 | REQUIRED_OS_NAME=SunOS |
erikj@445 | 341 | REQUIRED_OS_VERSION=5.10 |
erikj@445 | 342 | fi |
erikj@458 | 343 | if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
erikj@445 | 344 | REQUIRED_OS_NAME=Linux |
erikj@445 | 345 | REQUIRED_OS_VERSION=2.6 |
erikj@445 | 346 | fi |
erikj@458 | 347 | if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
erikj@445 | 348 | REQUIRED_OS_NAME=Windows |
ohair@478 | 349 | if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
ohair@478 | 350 | REQUIRED_OS_VERSION=5.2 |
ohair@478 | 351 | else |
ohair@478 | 352 | REQUIRED_OS_VERSION=5.1 |
ohair@478 | 353 | fi |
erikj@445 | 354 | fi |
erikj@458 | 355 | if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
erikj@445 | 356 | REQUIRED_OS_NAME=Darwin |
erikj@445 | 357 | REQUIRED_OS_VERSION=11.2 |
erikj@445 | 358 | fi |
erikj@445 | 359 | |
erikj@445 | 360 | AC_SUBST(REQUIRED_OS_NAME) |
erikj@445 | 361 | AC_SUBST(REQUIRED_OS_VERSION) |
erikj@445 | 362 | ]) |
erikj@458 | 363 | |
erikj@458 | 364 | #%%% Build and target systems %%% |
erikj@458 | 365 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], |
erikj@458 | 366 | [ |
erikj@458 | 367 | # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" |
erikj@458 | 368 | # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the |
erikj@458 | 369 | # product you're building. The target of this build is called "host". Since this is confusing to most people, we |
erikj@458 | 370 | # have not adopted that system, but use "target" as the platform we are building for. In some places though we need |
erikj@458 | 371 | # to use the configure naming style. |
erikj@458 | 372 | AC_CANONICAL_BUILD |
erikj@458 | 373 | AC_CANONICAL_HOST |
erikj@458 | 374 | AC_CANONICAL_TARGET |
erikj@458 | 375 | |
ohair@478 | 376 | PLATFORM_EXTRACT_TARGET_AND_BUILD |
ohair@478 | 377 | PLATFORM_SETUP_TARGET_CPU_BITS |
ohair@478 | 378 | PLATFORM_SET_RELEASE_FILE_OS_VALUES |
ohair@478 | 379 | PLATFORM_SETUP_LEGACY_VARS |
erikj@458 | 380 | ]) |
erikj@458 | 381 | |
erikj@458 | 382 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], |
erikj@458 | 383 | [ |
erikj@458 | 384 | ############################################################################### |
erikj@458 | 385 | |
erikj@458 | 386 | # Note that this is the build platform OS version! |
erikj@458 | 387 | |
erikj@458 | 388 | OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" |
erikj@458 | 389 | OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" |
erikj@458 | 390 | OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" |
erikj@458 | 391 | OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" |
erikj@458 | 392 | AC_SUBST(OS_VERSION_MAJOR) |
erikj@458 | 393 | AC_SUBST(OS_VERSION_MINOR) |
erikj@458 | 394 | AC_SUBST(OS_VERSION_MICRO) |
erikj@458 | 395 | ]) |
erikj@458 | 396 | |
ohair@478 | 397 | # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. |
ohair@478 | 398 | # Add -mX to various FLAGS variables. |
ohair@478 | 399 | AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], |
ohair@478 | 400 | [ |
ohair@478 | 401 | # keep track of c/cxx flags that we added outselves... |
ohair@478 | 402 | # to prevent emitting warning... |
ohair@478 | 403 | ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" |
ohair@478 | 404 | ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" |
ohair@478 | 405 | ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" |
ohair@478 | 406 | |
ohair@478 | 407 | CFLAGS="${CFLAGS}${ADDED_CFLAGS}" |
ohair@478 | 408 | CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" |
ohair@478 | 409 | LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" |
ohair@478 | 410 | |
ohair@478 | 411 | CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" |
ohair@478 | 412 | CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" |
ohair@478 | 413 | LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" |
ohair@478 | 414 | ]) |
ohair@478 | 415 | |
ohair@478 | 416 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], |
erikj@458 | 417 | [ |
erikj@458 | 418 | ############################################################################### |
erikj@458 | 419 | # |
erikj@458 | 420 | # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. |
erikj@458 | 421 | # (The JVM can use 32 or 64 bit Java pointers but that decision |
erikj@458 | 422 | # is made at runtime.) |
erikj@458 | 423 | # |
ohair@478 | 424 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
ohair@478 | 425 | # Always specify -m flags on Solaris |
ohair@478 | 426 | PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
ohair@478 | 427 | elif test "x$COMPILE_TYPE" = xreduced; then |
ohair@478 | 428 | if test "x$OPENJDK_TARGET_OS" != xwindows; then |
ohair@478 | 429 | # Specify -m if running reduced on other Posix platforms |
ohair@478 | 430 | PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
ohair@478 | 431 | fi |
erikj@458 | 432 | fi |
ohair@478 | 433 | |
ohair@478 | 434 | # Make compilation sanity check |
ohair@478 | 435 | AC_CHECK_HEADERS([stdio.h], , [ |
ohair@478 | 436 | AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) |
ohair@478 | 437 | if test "x$COMPILE_TYPE" = xreduced; then |
ohair@478 | 438 | AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) |
ohair@478 | 439 | elif test "x$COMPILE_TYPE" = xcross; then |
ohair@478 | 440 | AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) |
ohair@478 | 441 | fi |
ohair@478 | 442 | AC_MSG_ERROR([Cannot continue.]) |
ohair@478 | 443 | ]) |
ohair@478 | 444 | |
erikj@458 | 445 | AC_CHECK_SIZEOF([int *], [1111]) |
erikj@458 | 446 | |
ohair@478 | 447 | if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then |
ohair@478 | 448 | # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html |
ohair@478 | 449 | SIZEOF_INT_P="$ac_cv_sizeof_int_p" |
ohair@478 | 450 | fi |
erikj@458 | 451 | |
ohair@478 | 452 | if test "x$SIZEOF_INT_P" = x; then |
ohair@478 | 453 | # The test failed, lets stick to the assumed value. |
ohair@478 | 454 | AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) |
erikj@458 | 455 | else |
ohair@478 | 456 | TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P` |
erikj@458 | 457 | |
ohair@478 | 458 | if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
ohair@478 | 459 | 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)]) |
erikj@458 | 460 | fi |
erikj@458 | 461 | fi |
erikj@458 | 462 | |
erikj@458 | 463 | AC_MSG_CHECKING([for target address size]) |
ohair@478 | 464 | AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) |
erikj@458 | 465 | ]) |
erikj@458 | 466 | |
erikj@458 | 467 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], |
erikj@458 | 468 | [ |
erikj@458 | 469 | ############################################################################### |
erikj@458 | 470 | # |
erikj@458 | 471 | # Is the target little of big endian? |
erikj@458 | 472 | # |
erikj@458 | 473 | AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) |
erikj@458 | 474 | |
erikj@458 | 475 | if test "x$ENDIAN" = xuniversal_endianness; then |
erikj@458 | 476 | AC_MSG_ERROR([Building with both big and little endianness is not supported]) |
erikj@458 | 477 | fi |
ohair@478 | 478 | if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then |
ohair@478 | 479 | 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)]) |
erikj@458 | 480 | fi |
erikj@458 | 481 | ]) |