Tue, 03 Jul 2012 16:11:12 -0700
7181504: Update of latest build-infra Makefiles
Reviewed-by: ohair
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 | |
erikj@458 | 26 | AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS], |
ohair@425 | 27 | [ |
ohair@425 | 28 | # Expects $host_os $host_cpu $build_os and $build_cpu |
erikj@458 | 29 | # and $with_target_bits to have been setup! |
ohair@425 | 30 | # |
ohair@425 | 31 | # Translate the standard triplet(quadruplet) definition |
erikj@458 | 32 | # of the target/build system into |
erikj@458 | 33 | # OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows |
erikj@458 | 34 | # OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince |
erikj@458 | 35 | # OPENJDK_TARGET_OS_API=posix,winapi |
ohair@425 | 36 | # |
erikj@458 | 37 | # OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64 |
erikj@458 | 38 | # OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm |
erikj@458 | 39 | # OPENJDK_TARGET_CPU_BITS=32,64 |
erikj@458 | 40 | # OPENJDK_TARGET_CPU_ENDIAN=big,little |
ohair@425 | 41 | # |
ohair@425 | 42 | # The same values are setup for BUILD_... |
ohair@425 | 43 | # |
ohair@425 | 44 | # And the legacy variables, for controlling the old makefiles. |
erikj@458 | 45 | # LEGACY_OPENJDK_TARGET_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64... |
erikj@458 | 46 | # LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,sparc,sparcv9,arm,arm64... |
erikj@458 | 47 | # LEGACY_OPENJDK_TARGET_CPU3=sparcv9,amd64 (but only on solaris) |
erikj@458 | 48 | # LEGACY_OPENJDK_TARGET_OS_API=solaris,windows |
ohair@425 | 49 | # |
ohair@425 | 50 | # We also copy the autoconf trip/quadruplet |
erikj@458 | 51 | # verbatim to OPENJDK_TARGET_SYSTEM (from the autoconf "host") and OPENJDK_BUILD_SYSTEM |
erikj@458 | 52 | OPENJDK_TARGET_SYSTEM="$host" |
erikj@458 | 53 | OPENJDK_BUILD_SYSTEM="$build" |
erikj@458 | 54 | AC_SUBST(OPENJDK_TARGET_SYSTEM) |
erikj@458 | 55 | AC_SUBST(OPENJDK_BUILD_SYSTEM) |
ohair@425 | 56 | |
erikj@458 | 57 | PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_TARGET,$host_os) |
erikj@458 | 58 | PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_TARGET,$host_cpu) |
ohair@425 | 59 | |
erikj@458 | 60 | PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_BUILD,$build_os) |
erikj@458 | 61 | PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_BUILD,$build_cpu) |
ohair@425 | 62 | |
erikj@458 | 63 | if test "x$OPENJDK_TARGET_OS" != xsolaris; then |
erikj@458 | 64 | LEGACY_OPENJDK_TARGET_CPU3="" |
erikj@458 | 65 | LEGACY_OPENJDK_BUILD_CPU3="" |
erikj@445 | 66 | fi |
erikj@445 | 67 | |
erikj@458 | 68 | # On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_OPENJDK_TARGET_CPU1) ... |
erikj@458 | 69 | if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$OPENJDK_TARGET_CPU" = xx64; then |
erikj@458 | 70 | LEGACY_OPENJDK_TARGET_CPU1="x86_64" |
erikj@445 | 71 | fi |
erikj@445 | 72 | |
erikj@458 | 73 | PLATFORM_SET_RELEASE_FILE_OS_VALUES |
ohair@425 | 74 | ]) |
ohair@425 | 75 | |
erikj@458 | 76 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS_TO], |
ohair@425 | 77 | [ |
erikj@458 | 78 | PLATFORM_EXTRACT_VARS_FROM_OS($2) |
ohair@425 | 79 | $1_OS="$VAR_OS" |
ohair@425 | 80 | $1_OS_FAMILY="$VAR_OS_FAMILY" |
ohair@425 | 81 | $1_OS_API="$VAR_OS_API" |
ohair@425 | 82 | |
ohair@425 | 83 | AC_SUBST($1_OS) |
ohair@425 | 84 | AC_SUBST($1_OS_FAMILY) |
ohair@425 | 85 | AC_SUBST($1_OS_API) |
ohair@425 | 86 | |
ohair@425 | 87 | if test "x$$1_OS_API" = xposix; then |
ohair@425 | 88 | LEGACY_$1_OS_API="solaris" |
ohair@425 | 89 | fi |
ohair@425 | 90 | if test "x$$1_OS_API" = xwinapi; then |
ohair@425 | 91 | LEGACY_$1_OS_API="windows" |
ohair@425 | 92 | fi |
ohair@425 | 93 | AC_SUBST(LEGACY_$1_OS_API) |
ohair@425 | 94 | ]) |
ohair@425 | 95 | |
erikj@458 | 96 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU_TO], |
ohair@425 | 97 | [ |
erikj@458 | 98 | PLATFORM_EXTRACT_VARS_FROM_CPU($2) |
ohair@425 | 99 | $1_CPU="$VAR_CPU" |
ohair@425 | 100 | $1_CPU_ARCH="$VAR_CPU_ARCH" |
ohair@425 | 101 | $1_CPU_BITS="$VAR_CPU_BITS" |
ohair@425 | 102 | $1_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
ohair@425 | 103 | |
ohair@425 | 104 | AC_SUBST($1_CPU) |
ohair@425 | 105 | AC_SUBST($1_CPU_ARCH) |
ohair@425 | 106 | AC_SUBST($1_CPU_BITS) |
ohair@425 | 107 | AC_SUBST($1_CPU_ENDIAN) |
ohair@425 | 108 | |
ohair@425 | 109 | # Also store the legacy naming of the cpu. |
ohair@425 | 110 | # Ie i586 and amd64 instead of ia32 and x64 |
ohair@425 | 111 | LEGACY_$1_CPU1="$VAR_LEGACY_CPU" |
ohair@425 | 112 | AC_SUBST(LEGACY_$1_CPU1) |
ohair@425 | 113 | |
ohair@425 | 114 | # And the second legacy naming of the cpu. |
ohair@425 | 115 | # Ie i386 and amd64 instead of ia32 and x64. |
ohair@425 | 116 | LEGACY_$1_CPU2="$LEGACY_$1_CPU1" |
ohair@425 | 117 | if test "x$LEGACY_$1_CPU1" = xi586; then |
ohair@425 | 118 | LEGACY_$1_CPU2=i386 |
ohair@425 | 119 | fi |
ohair@425 | 120 | AC_SUBST(LEGACY_$1_CPU2) |
ohair@425 | 121 | |
ohair@425 | 122 | # And the third legacy naming of the cpu. |
ohair@425 | 123 | # Ie only amd64 or sparcv9, used for the ISA_DIR on Solaris. |
ohair@425 | 124 | LEGACY_$1_CPU3="" |
ohair@425 | 125 | if test "x$$1_CPU" = xx64; then |
ohair@425 | 126 | LEGACY_$1_CPU3=amd64 |
ohair@425 | 127 | fi |
ohair@425 | 128 | if test "x$$1_CPU" = xsparcv9; then |
erikj@458 | 129 | LEGACY_$1_CPU3=sparcv9 |
ohair@425 | 130 | fi |
ohair@425 | 131 | AC_SUBST(LEGACY_$1_CPU3) |
ohair@425 | 132 | ]) |
ohair@425 | 133 | |
erikj@458 | 134 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], |
ohair@425 | 135 | [ |
ohair@425 | 136 | # First argument is the cpu name from the trip/quad |
ohair@425 | 137 | case "$1" in |
ohair@425 | 138 | x86_64) |
ohair@425 | 139 | VAR_CPU=x64 |
ohair@425 | 140 | VAR_CPU_ARCH=x86 |
ohair@425 | 141 | VAR_CPU_BITS=64 |
ohair@425 | 142 | VAR_CPU_ENDIAN=little |
ohair@425 | 143 | VAR_LEGACY_CPU=amd64 |
ohair@425 | 144 | ;; |
ohair@425 | 145 | i?86) |
ohair@425 | 146 | VAR_CPU=ia32 |
ohair@425 | 147 | VAR_CPU_ARCH=x86 |
ohair@425 | 148 | VAR_CPU_BITS=32 |
ohair@425 | 149 | VAR_CPU_ENDIAN=little |
ohair@425 | 150 | VAR_LEGACY_CPU=i586 |
ohair@425 | 151 | ;; |
ohair@425 | 152 | alpha*) |
ohair@425 | 153 | VAR_CPU=alpha |
ohair@425 | 154 | VAR_CPU_ARCH=alpha |
ohair@425 | 155 | VAR_CPU_BITS=64 |
ohair@425 | 156 | VAR_CPU_ENDIAN=big |
ohair@425 | 157 | VAR_LEGACY_CPU=alpha |
ohair@425 | 158 | ;; |
ohair@425 | 159 | arm*) |
ohair@425 | 160 | VAR_CPU=arm |
ohair@425 | 161 | VAR_CPU_ARCH=arm |
erikj@458 | 162 | VAR_CPU_BITS=32 |
erikj@458 | 163 | VAR_CPU_ENDIAN=little |
ohair@425 | 164 | VAR_LEGACY_CPU=arm |
ohair@425 | 165 | ;; |
ohair@425 | 166 | mips) |
ohair@425 | 167 | VAR_CPU=mips |
ohair@425 | 168 | VAR_CPU_ARCH=mips |
ohair@425 | 169 | VAR_CPU_BITS=woot |
ohair@425 | 170 | VAR_CPU_ENDIAN=woot |
ohair@425 | 171 | VAR_LEGACY_CPU=mips |
ohair@425 | 172 | ;; |
ohair@425 | 173 | mipsel) |
ohair@425 | 174 | VAR_CPU=mipsel |
ohair@425 | 175 | VAR_CPU_ARCH=mips |
ohair@425 | 176 | VAR_CPU_BITS=woot |
ohair@425 | 177 | VAR_CPU_ENDIAN=woot |
ohair@425 | 178 | VAR_LEGACY_CPU=mipsel |
ohair@425 | 179 | ;; |
ohair@425 | 180 | powerpc) |
ohair@425 | 181 | VAR_CPU=ppc |
ohair@425 | 182 | VAR_CPU_ARCH=ppc |
ohair@425 | 183 | VAR_CPU_BITS=32 |
ohair@425 | 184 | VAR_CPU_ENDIAN=big |
ohair@425 | 185 | VAR_LEGACY_CPU=ppc |
ohair@425 | 186 | ;; |
ohair@425 | 187 | powerpc64) |
ohair@425 | 188 | VAR_CPU=ppc64 |
ohair@425 | 189 | VAR_CPU_ARCH=ppc |
ohair@425 | 190 | VAR_CPU_BITS=64 |
erikj@458 | 191 | VAR_CPU_ENDIAN=big |
ohair@425 | 192 | VAR_LEGACY_CPU=ppc64 |
ohair@425 | 193 | ;; |
ohair@425 | 194 | sparc) |
ohair@425 | 195 | VAR_CPU=sparc |
ohair@425 | 196 | VAR_CPU_ARCH=sparc |
ohair@425 | 197 | VAR_CPU_BITS=32 |
ohair@425 | 198 | VAR_CPU_ENDIAN=big |
ohair@425 | 199 | VAR_LEGACY_CPU=sparc |
ohair@425 | 200 | ;; |
ohair@425 | 201 | sparc64) |
ohair@425 | 202 | VAR_CPU=sparcv9 |
ohair@425 | 203 | VAR_CPU_ARCH=sparc |
ohair@425 | 204 | VAR_CPU_BITS=64 |
ohair@425 | 205 | VAR_CPU_ENDIAN=big |
erikj@458 | 206 | VAR_LEGACY_CPU=sparcv9 |
ohair@425 | 207 | ;; |
ohair@425 | 208 | s390) |
ohair@425 | 209 | VAR_CPU=s390 |
ohair@425 | 210 | VAR_CPU_ARCH=s390 |
ohair@425 | 211 | VAR_CPU_BITS=32 |
ohair@425 | 212 | VAR_CPU_ENDIAN=woot |
ohair@425 | 213 | VAR_LEGACY_CPU=s390 |
ohair@425 | 214 | VAR_LEGACY_CPU=s390 |
ohair@425 | 215 | ;; |
ohair@425 | 216 | s390x) |
ohair@425 | 217 | VAR_CPU=s390x |
ohair@425 | 218 | VAR_CPU_ARCH=s390 |
ohair@425 | 219 | VAR_CPU_BITS=64 |
ohair@425 | 220 | VAR_CPU_ENDIAN=woot |
ohair@425 | 221 | VAR_LEGACY_CPU=s390x |
ohair@425 | 222 | ;; |
ohair@425 | 223 | *) |
erikj@445 | 224 | AC_MSG_ERROR([unsupported cpu $1]) |
ohair@425 | 225 | ;; |
ohair@425 | 226 | esac |
ohair@425 | 227 | |
ohair@425 | 228 | # Workaround cygwin not knowing about 64 bit. |
ohair@425 | 229 | if test "x$VAR_OS" = "xwindows"; then |
ohair@425 | 230 | if test "x$PROCESSOR_IDENTIFIER" != "x"; then |
ohair@425 | 231 | PROC_ARCH=`echo $PROCESSOR_IDENTIFIER | $CUT -f1 -d' '` |
ohair@425 | 232 | case "$PROC_ARCH" in |
ohair@425 | 233 | intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64) |
ohair@425 | 234 | VAR_CPU=x64 |
ohair@425 | 235 | VAR_CPU_BITS=64 |
ohair@425 | 236 | VAR_LEGACY_CPU=amd64 |
ohair@425 | 237 | ;; |
ohair@425 | 238 | esac |
ohair@425 | 239 | fi |
ohair@425 | 240 | fi |
ohair@425 | 241 | |
erikj@458 | 242 | # on solaris x86...default seems to be 32-bit |
erikj@458 | 243 | if test "x$VAR_OS" = "xsolaris" && \ |
erikj@458 | 244 | test "x$with_target_bits" = "x" && \ |
erikj@458 | 245 | test "x$VAR_CPU_ARCH" = "xx86" |
erikj@458 | 246 | then |
erikj@458 | 247 | with_target_bits=32 |
erikj@458 | 248 | fi |
erikj@458 | 249 | |
ohair@425 | 250 | if test "x$VAR_CPU_ARCH" = "xx86"; then |
erikj@458 | 251 | if test "x$with_target_bits" = "x64"; then |
ohair@425 | 252 | VAR_CPU=x64 |
ohair@425 | 253 | VAR_CPU_BITS=64 |
ohair@425 | 254 | VAR_LEGACY_CPU=amd64 |
ohair@425 | 255 | fi |
erikj@458 | 256 | if test "x$with_target_bits" = "x32"; then |
ohair@425 | 257 | VAR_CPU=ia32 |
ohair@425 | 258 | VAR_CPU_BITS=32 |
ohair@425 | 259 | VAR_LEGACY_CPU=i586 |
ohair@425 | 260 | fi |
ohair@425 | 261 | fi |
erikj@458 | 262 | |
erikj@458 | 263 | if test "x$VAR_CPU_ARCH" = "xsparc"; then |
erikj@458 | 264 | if test "x$with_target_bits" = "x64"; then |
erikj@458 | 265 | VAR_CPU=sparcv9 |
erikj@458 | 266 | VAR_CPU_BITS=64 |
erikj@458 | 267 | VAR_LEGACY_CPU=sparcv9 |
erikj@458 | 268 | fi |
erikj@458 | 269 | fi |
ohair@425 | 270 | ]) |
ohair@425 | 271 | |
erikj@458 | 272 | AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], |
ohair@425 | 273 | [ |
ohair@425 | 274 | case "$1" in |
ohair@425 | 275 | *linux*) |
ohair@425 | 276 | VAR_OS=linux |
ohair@425 | 277 | VAR_OS_API=posix |
ohair@425 | 278 | VAR_OS_FAMILY=gnu |
ohair@425 | 279 | ;; |
ohair@425 | 280 | *solaris*) |
ohair@425 | 281 | VAR_OS=solaris |
ohair@425 | 282 | VAR_OS_API=posix |
ohair@425 | 283 | VAR_OS_FAMILY=sysv |
ohair@425 | 284 | ;; |
ohair@425 | 285 | *darwin*) |
ohair@425 | 286 | VAR_OS=macosx |
ohair@425 | 287 | VAR_OS_API=posix |
ohair@425 | 288 | VAR_OS_FAMILY=bsd |
ohair@425 | 289 | ;; |
ohair@425 | 290 | *bsd*) |
ohair@425 | 291 | VAR_OS=bsd |
ohair@425 | 292 | VAR_OS_API=posix |
ohair@425 | 293 | VAR_OS_FAMILY=bsd |
ohair@425 | 294 | ;; |
ohair@425 | 295 | *cygwin*|*windows*) |
ohair@425 | 296 | VAR_OS=windows |
ohair@425 | 297 | VAR_OS_API=winapi |
ohair@425 | 298 | VAR_OS_FAMILY=windows |
ohair@425 | 299 | ;; |
ohair@425 | 300 | *) |
erikj@458 | 301 | AC_MSG_ERROR([unsupported operating system $1]) |
ohair@425 | 302 | ;; |
ohair@425 | 303 | esac |
ohair@425 | 304 | ]) |
ohair@425 | 305 | |
erikj@458 | 306 | AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], |
ohair@425 | 307 | [ |
erikj@458 | 308 | if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
erikj@445 | 309 | REQUIRED_OS_NAME=SunOS |
erikj@445 | 310 | REQUIRED_OS_VERSION=5.10 |
erikj@445 | 311 | fi |
erikj@458 | 312 | if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
erikj@445 | 313 | REQUIRED_OS_NAME=Linux |
erikj@445 | 314 | REQUIRED_OS_VERSION=2.6 |
erikj@445 | 315 | fi |
erikj@458 | 316 | if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
erikj@445 | 317 | REQUIRED_OS_NAME=Windows |
erikj@445 | 318 | REQUIRED_OS_VERSION=5.1 |
erikj@445 | 319 | fi |
erikj@458 | 320 | if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
erikj@445 | 321 | REQUIRED_OS_NAME=Darwin |
erikj@445 | 322 | REQUIRED_OS_VERSION=11.2 |
erikj@445 | 323 | fi |
erikj@445 | 324 | |
erikj@445 | 325 | AC_SUBST(REQUIRED_OS_NAME) |
erikj@445 | 326 | AC_SUBST(REQUIRED_OS_VERSION) |
erikj@445 | 327 | ]) |
erikj@458 | 328 | |
erikj@458 | 329 | #%%% Build and target systems %%% |
erikj@458 | 330 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], |
erikj@458 | 331 | [ |
erikj@458 | 332 | # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" |
erikj@458 | 333 | # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the |
erikj@458 | 334 | # product you're building. The target of this build is called "host". Since this is confusing to most people, we |
erikj@458 | 335 | # have not adopted that system, but use "target" as the platform we are building for. In some places though we need |
erikj@458 | 336 | # to use the configure naming style. |
erikj@458 | 337 | AC_CANONICAL_BUILD |
erikj@458 | 338 | AC_CANONICAL_HOST |
erikj@458 | 339 | AC_CANONICAL_TARGET |
erikj@458 | 340 | |
erikj@458 | 341 | AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], |
erikj@458 | 342 | [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) |
erikj@458 | 343 | |
erikj@458 | 344 | if test "x$with_target_bits" != x && \ |
erikj@458 | 345 | test "x$with_target_bits" != x32 && \ |
erikj@458 | 346 | test "x$with_target_bits" != x64 ; then |
erikj@458 | 347 | AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!]) |
erikj@458 | 348 | fi |
erikj@458 | 349 | # Translate the standard cpu-vendor-kernel-os quadruplets into |
erikj@458 | 350 | # the new TARGET_.... and BUILD_... and the legacy names used by |
erikj@458 | 351 | # the openjdk build. |
erikj@458 | 352 | # It uses $host_os $host_cpu $build_os $build_cpu and $with_target_bits |
erikj@458 | 353 | PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS |
erikj@458 | 354 | |
erikj@458 | 355 | # The LEGACY_OPENJDK_TARGET_CPU3 is the setting for ISA_DIR. |
erikj@458 | 356 | if test "x$LEGACY_OPENJDK_TARGET_CPU3" != x; then |
erikj@458 | 357 | LEGACY_OPENJDK_TARGET_CPU3="/${LEGACY_OPENJDK_TARGET_CPU3}" |
erikj@458 | 358 | fi |
erikj@458 | 359 | |
erikj@458 | 360 | # Now the following vars are defined. |
erikj@458 | 361 | # OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows |
erikj@458 | 362 | # OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince |
erikj@458 | 363 | # OPENJDK_TARGET_OS_API=posix,winapi |
erikj@458 | 364 | # |
erikj@458 | 365 | # OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64 |
erikj@458 | 366 | # OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm |
erikj@458 | 367 | # OPENJDK_TARGET_CPU_BITS=32,64 |
erikj@458 | 368 | # OPENJDK_TARGET_CPU_ENDIAN=big,little |
erikj@458 | 369 | # |
erikj@458 | 370 | # There is also a: |
erikj@458 | 371 | # LEGACY_OPENJDK_TARGET_CPU1=i586,amd64,.... # used to set the old var ARCH |
erikj@458 | 372 | # LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,.... # used to set the old var LIBARCH |
erikj@458 | 373 | # LEGACY_OPENJDK_TARGET_CPU3=only sparcv9,amd64 # used to set the ISA_DIR on Solaris |
erikj@458 | 374 | # There was also a BUILDARCH that had i486,amd64,... but we do not use that |
erikj@458 | 375 | # in the new build. |
erikj@458 | 376 | # LEGACY_OPENJDK_TARGET_OS_API=solaris,windows # used to select source roots |
erikj@458 | 377 | ]) |
erikj@458 | 378 | |
erikj@458 | 379 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], |
erikj@458 | 380 | [ |
erikj@458 | 381 | ############################################################################### |
erikj@458 | 382 | |
erikj@458 | 383 | # Note that this is the build platform OS version! |
erikj@458 | 384 | |
erikj@458 | 385 | OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" |
erikj@458 | 386 | OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" |
erikj@458 | 387 | OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" |
erikj@458 | 388 | OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" |
erikj@458 | 389 | AC_SUBST(OS_VERSION_MAJOR) |
erikj@458 | 390 | AC_SUBST(OS_VERSION_MINOR) |
erikj@458 | 391 | AC_SUBST(OS_VERSION_MICRO) |
erikj@458 | 392 | ]) |
erikj@458 | 393 | |
erikj@458 | 394 | AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS], |
erikj@458 | 395 | [ |
erikj@458 | 396 | ############################################################################### |
erikj@458 | 397 | # |
erikj@458 | 398 | # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. |
erikj@458 | 399 | # (The JVM can use 32 or 64 bit Java pointers but that decision |
erikj@458 | 400 | # is made at runtime.) |
erikj@458 | 401 | # |
erikj@458 | 402 | AC_LANG_PUSH(C++) |
erikj@458 | 403 | OLD_CXXFLAGS="$CXXFLAGS" |
erikj@458 | 404 | if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then |
erikj@458 | 405 | CXXFLAGS="-m${with_target_bits} $CXXFLAGS" |
erikj@458 | 406 | fi |
erikj@458 | 407 | AC_CHECK_SIZEOF([int *], [1111]) |
erikj@458 | 408 | CXXFLAGS="$OLD_CXXFLAGS" |
erikj@458 | 409 | AC_LANG_POP(C++) |
erikj@458 | 410 | |
erikj@458 | 411 | # keep track of c/cxx flags that we added outselves... |
erikj@458 | 412 | # to prevent emitting warning... |
erikj@458 | 413 | ADDED_CFLAGS= |
erikj@458 | 414 | ADDED_CXXFLAGS= |
erikj@458 | 415 | ADDED_LDFLAGS= |
erikj@458 | 416 | |
erikj@458 | 417 | if test "x$ac_cv_sizeof_int_p" = x0; then |
erikj@458 | 418 | # The test failed, lets pick the assumed value. |
erikj@458 | 419 | ARCH_DATA_MODEL=$OPENJDK_TARGET_CPU_BITS |
erikj@458 | 420 | else |
erikj@458 | 421 | ARCH_DATA_MODEL=`expr 8 \* $ac_cv_sizeof_int_p` |
erikj@458 | 422 | |
erikj@458 | 423 | if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then |
erikj@458 | 424 | ADDED_CFLAGS=" -m${with_target_bits}" |
erikj@458 | 425 | ADDED_CXXFLAGS=" -m${with_target_bits}" |
erikj@458 | 426 | ADDED_LDFLAGS=" -m${with_target_bits}" |
erikj@458 | 427 | |
erikj@458 | 428 | CFLAGS="${CFLAGS}${ADDED_CFLAGS}" |
erikj@458 | 429 | CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" |
erikj@458 | 430 | LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}" |
erikj@458 | 431 | |
erikj@458 | 432 | CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" |
erikj@458 | 433 | CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" |
erikj@458 | 434 | LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" |
erikj@458 | 435 | fi |
erikj@458 | 436 | fi |
erikj@458 | 437 | |
erikj@458 | 438 | if test "x$ARCH_DATA_MODEL" = x64; then |
erikj@458 | 439 | A_LP64="LP64:=" |
erikj@458 | 440 | ADD_LP64="-D_LP64=1" |
erikj@458 | 441 | fi |
erikj@458 | 442 | AC_MSG_CHECKING([for target address size]) |
erikj@458 | 443 | AC_MSG_RESULT([$ARCH_DATA_MODEL bits]) |
erikj@458 | 444 | AC_SUBST(LP64,$A_LP64) |
erikj@458 | 445 | AC_SUBST(ARCH_DATA_MODEL) |
erikj@458 | 446 | |
erikj@458 | 447 | if test "x$ARCH_DATA_MODEL" != "x$OPENJDK_TARGET_CPU_BITS"; then |
erikj@458 | 448 | AC_MSG_ERROR([The tested number of bits in the target ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) |
erikj@458 | 449 | fi |
erikj@458 | 450 | |
erikj@458 | 451 | # |
erikj@458 | 452 | # NOTE: check for -mstackrealign needs to be below potential addition of -m32 |
erikj@458 | 453 | # |
erikj@458 | 454 | if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then |
erikj@458 | 455 | # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. |
erikj@458 | 456 | # While waiting for a better solution, the current workaround is to use -mstackrealign. |
erikj@458 | 457 | CFLAGS="$CFLAGS -mstackrealign" |
erikj@458 | 458 | AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) |
erikj@458 | 459 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], |
erikj@458 | 460 | [ |
erikj@458 | 461 | AC_MSG_RESULT([yes]) |
erikj@458 | 462 | ], |
erikj@458 | 463 | [ |
erikj@458 | 464 | AC_MSG_RESULT([no]) |
erikj@458 | 465 | AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) |
erikj@458 | 466 | ]) |
erikj@458 | 467 | fi |
erikj@458 | 468 | ]) |
erikj@458 | 469 | |
erikj@458 | 470 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], |
erikj@458 | 471 | [ |
erikj@458 | 472 | ############################################################################### |
erikj@458 | 473 | # |
erikj@458 | 474 | # Is the target little of big endian? |
erikj@458 | 475 | # |
erikj@458 | 476 | AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) |
erikj@458 | 477 | |
erikj@458 | 478 | if test "x$ENDIAN" = xuniversal_endianness; then |
erikj@458 | 479 | AC_MSG_ERROR([Building with both big and little endianness is not supported]) |
erikj@458 | 480 | fi |
erikj@458 | 481 | if test "x$ENDIAN" = xunknown; then |
erikj@458 | 482 | ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN" |
erikj@458 | 483 | fi |
erikj@458 | 484 | if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then |
erikj@458 | 485 | AC_MSG_WARN([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) |
erikj@458 | 486 | ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN" |
erikj@458 | 487 | fi |
erikj@458 | 488 | AC_SUBST(ENDIAN) |
erikj@458 | 489 | ]) |
erikj@458 | 490 | |
erikj@458 | 491 | AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ISADIR], |
erikj@458 | 492 | [ |
erikj@458 | 493 | ############################################################################### |
erikj@458 | 494 | # |
erikj@458 | 495 | # Could someone enlighten this configure script with a comment about libCrun? |
erikj@458 | 496 | # |
erikj@458 | 497 | # |
erikj@458 | 498 | ]) |