1.1 --- a/common/autoconf/platform.m4 Thu Sep 12 12:29:17 2013 -0700 1.2 +++ b/common/autoconf/platform.m4 Tue Nov 05 17:33:48 2013 -0800 1.3 @@ -53,25 +53,37 @@ 1.4 VAR_CPU_ARCH=ppc 1.5 VAR_CPU_BITS=32 1.6 VAR_CPU_ENDIAN=big 1.7 - ;; 1.8 + ;; 1.9 powerpc64) 1.10 VAR_CPU=ppc64 1.11 VAR_CPU_ARCH=ppc 1.12 VAR_CPU_BITS=64 1.13 VAR_CPU_ENDIAN=big 1.14 - ;; 1.15 + ;; 1.16 + s390) 1.17 + VAR_CPU=s390 1.18 + VAR_CPU_ARCH=s390 1.19 + VAR_CPU_BITS=32 1.20 + VAR_CPU_ENDIAN=big 1.21 + ;; 1.22 + s390x) 1.23 + VAR_CPU=s390x 1.24 + VAR_CPU_ARCH=s390 1.25 + VAR_CPU_BITS=64 1.26 + VAR_CPU_ENDIAN=big 1.27 + ;; 1.28 sparc) 1.29 VAR_CPU=sparc 1.30 VAR_CPU_ARCH=sparc 1.31 VAR_CPU_BITS=32 1.32 VAR_CPU_ENDIAN=big 1.33 - ;; 1.34 + ;; 1.35 sparcv9) 1.36 VAR_CPU=sparcv9 1.37 VAR_CPU_ARCH=sparc 1.38 VAR_CPU_BITS=64 1.39 VAR_CPU_ENDIAN=big 1.40 - ;; 1.41 + ;; 1.42 *) 1.43 AC_MSG_ERROR([unsupported cpu $1]) 1.44 ;; 1.45 @@ -133,56 +145,56 @@ 1.46 # OPENJDK_BUILD_OS, etc. 1.47 AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], 1.48 [ 1.49 - # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME 1.50 - # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME 1.51 - # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, 1.52 - # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. 1.53 - OPENJDK_TARGET_AUTOCONF_NAME="$host" 1.54 - OPENJDK_BUILD_AUTOCONF_NAME="$build" 1.55 - AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) 1.56 - AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) 1.57 + # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME 1.58 + # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME 1.59 + # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, 1.60 + # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. 1.61 + OPENJDK_TARGET_AUTOCONF_NAME="$host" 1.62 + OPENJDK_BUILD_AUTOCONF_NAME="$build" 1.63 + AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) 1.64 + AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) 1.65 1.66 - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. 1.67 - PLATFORM_EXTRACT_VARS_FROM_OS($build_os) 1.68 - PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) 1.69 - # ..and setup our own variables. (Do this explicitely to facilitate searching) 1.70 - OPENJDK_BUILD_OS="$VAR_OS" 1.71 - OPENJDK_BUILD_OS_API="$VAR_OS_API" 1.72 - OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" 1.73 - OPENJDK_BUILD_CPU="$VAR_CPU" 1.74 - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" 1.75 - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" 1.76 - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" 1.77 - AC_SUBST(OPENJDK_BUILD_OS) 1.78 - AC_SUBST(OPENJDK_BUILD_OS_API) 1.79 - AC_SUBST(OPENJDK_BUILD_CPU) 1.80 - AC_SUBST(OPENJDK_BUILD_CPU_ARCH) 1.81 - AC_SUBST(OPENJDK_BUILD_CPU_BITS) 1.82 - AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) 1.83 + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. 1.84 + PLATFORM_EXTRACT_VARS_FROM_OS($build_os) 1.85 + PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) 1.86 + # ..and setup our own variables. (Do this explicitely to facilitate searching) 1.87 + OPENJDK_BUILD_OS="$VAR_OS" 1.88 + OPENJDK_BUILD_OS_API="$VAR_OS_API" 1.89 + OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" 1.90 + OPENJDK_BUILD_CPU="$VAR_CPU" 1.91 + OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" 1.92 + OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" 1.93 + OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" 1.94 + AC_SUBST(OPENJDK_BUILD_OS) 1.95 + AC_SUBST(OPENJDK_BUILD_OS_API) 1.96 + AC_SUBST(OPENJDK_BUILD_CPU) 1.97 + AC_SUBST(OPENJDK_BUILD_CPU_ARCH) 1.98 + AC_SUBST(OPENJDK_BUILD_CPU_BITS) 1.99 + AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) 1.100 1.101 - AC_MSG_CHECKING([openjdk-build os-cpu]) 1.102 - AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) 1.103 + AC_MSG_CHECKING([openjdk-build os-cpu]) 1.104 + AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) 1.105 1.106 - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. 1.107 - PLATFORM_EXTRACT_VARS_FROM_OS($host_os) 1.108 - PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) 1.109 - # ... and setup our own variables. (Do this explicitely to facilitate searching) 1.110 - OPENJDK_TARGET_OS="$VAR_OS" 1.111 - OPENJDK_TARGET_OS_API="$VAR_OS_API" 1.112 - OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" 1.113 - OPENJDK_TARGET_CPU="$VAR_CPU" 1.114 - OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" 1.115 - OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" 1.116 - OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" 1.117 - AC_SUBST(OPENJDK_TARGET_OS) 1.118 - AC_SUBST(OPENJDK_TARGET_OS_API) 1.119 - AC_SUBST(OPENJDK_TARGET_CPU) 1.120 - AC_SUBST(OPENJDK_TARGET_CPU_ARCH) 1.121 - AC_SUBST(OPENJDK_TARGET_CPU_BITS) 1.122 - AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) 1.123 + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. 1.124 + PLATFORM_EXTRACT_VARS_FROM_OS($host_os) 1.125 + PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) 1.126 + # ... and setup our own variables. (Do this explicitely to facilitate searching) 1.127 + OPENJDK_TARGET_OS="$VAR_OS" 1.128 + OPENJDK_TARGET_OS_API="$VAR_OS_API" 1.129 + OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" 1.130 + OPENJDK_TARGET_CPU="$VAR_CPU" 1.131 + OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" 1.132 + OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" 1.133 + OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" 1.134 + AC_SUBST(OPENJDK_TARGET_OS) 1.135 + AC_SUBST(OPENJDK_TARGET_OS_API) 1.136 + AC_SUBST(OPENJDK_TARGET_CPU) 1.137 + AC_SUBST(OPENJDK_TARGET_CPU_ARCH) 1.138 + AC_SUBST(OPENJDK_TARGET_CPU_BITS) 1.139 + AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) 1.140 1.141 - AC_MSG_CHECKING([openjdk-target os-cpu]) 1.142 - AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) 1.143 + AC_MSG_CHECKING([openjdk-target os-cpu]) 1.144 + AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) 1.145 ]) 1.146 1.147 # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour 1.148 @@ -191,7 +203,7 @@ 1.149 AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], 1.150 [ 1.151 AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], 1.152 - [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) 1.153 + [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) 1.154 1.155 # We have three types of compiles: 1.156 # native == normal compilation, target system == build system 1.157 @@ -220,7 +232,7 @@ 1.158 OPENJDK_TARGET_CPU=sparc 1.159 else 1.160 AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) 1.161 - fi 1.162 + fi 1.163 elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then 1.164 AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.]) 1.165 elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then 1.166 @@ -231,192 +243,200 @@ 1.167 fi 1.168 AC_SUBST(COMPILE_TYPE) 1.169 1.170 -AC_MSG_CHECKING([compilation type]) 1.171 -AC_MSG_RESULT([$COMPILE_TYPE]) 1.172 + AC_MSG_CHECKING([compilation type]) 1.173 + AC_MSG_RESULT([$COMPILE_TYPE]) 1.174 ]) 1.175 1.176 - # Setup the legacy variables, for controlling the old makefiles. 1.177 - # 1.178 +# Setup the legacy variables, for controlling the old makefiles. 1.179 +# 1.180 AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], 1.181 [ 1.182 - # Also store the legacy naming of the cpu. 1.183 - # Ie i586 and amd64 instead of x86 and x86_64 1.184 - OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" 1.185 - if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.186 - OPENJDK_TARGET_CPU_LEGACY="i586" 1.187 - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.188 - # On all platforms except MacOSX replace x86_64 with amd64. 1.189 - OPENJDK_TARGET_CPU_LEGACY="amd64" 1.190 + # Also store the legacy naming of the cpu. 1.191 + # Ie i586 and amd64 instead of x86 and x86_64 1.192 + OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" 1.193 + if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.194 + OPENJDK_TARGET_CPU_LEGACY="i586" 1.195 + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.196 + # On all platforms except MacOSX replace x86_64 with amd64. 1.197 + OPENJDK_TARGET_CPU_LEGACY="amd64" 1.198 + fi 1.199 + AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) 1.200 + 1.201 + # And the second legacy naming of the cpu. 1.202 + # Ie i386 and amd64 instead of x86 and x86_64. 1.203 + OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" 1.204 + if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.205 + OPENJDK_TARGET_CPU_LEGACY_LIB="i386" 1.206 + elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.207 + OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" 1.208 + fi 1.209 + AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) 1.210 + 1.211 + # This is the name of the cpu (but using i386 and amd64 instead of 1.212 + # x86 and x86_64, respectively), preceeded by a /, to be used when 1.213 + # locating libraries. On macosx, it's empty, though. 1.214 + OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" 1.215 + if test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.216 + OPENJDK_TARGET_CPU_LIBDIR="" 1.217 + fi 1.218 + AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) 1.219 + 1.220 + # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to 1.221 + # /amd64 or /sparcv9. This string is appended to some library paths, like this: 1.222 + # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so 1.223 + OPENJDK_TARGET_CPU_ISADIR="" 1.224 + if test "x$OPENJDK_TARGET_OS" = xsolaris; then 1.225 + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.226 + OPENJDK_TARGET_CPU_ISADIR="/amd64" 1.227 + elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then 1.228 + OPENJDK_TARGET_CPU_ISADIR="/sparcv9" 1.229 fi 1.230 - AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) 1.231 + fi 1.232 + AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) 1.233 1.234 - # And the second legacy naming of the cpu. 1.235 - # Ie i386 and amd64 instead of x86 and x86_64. 1.236 - OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" 1.237 - if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.238 - OPENJDK_TARGET_CPU_LEGACY_LIB="i386" 1.239 - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.240 - OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" 1.241 + # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property 1.242 + OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" 1.243 + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then 1.244 + # On linux only, we replace x86 with i386. 1.245 + OPENJDK_TARGET_CPU_OSARCH="i386" 1.246 + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.247 + # On all platforms except macosx, we replace x86_64 with amd64. 1.248 + OPENJDK_TARGET_CPU_OSARCH="amd64" 1.249 + fi 1.250 + AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) 1.251 + 1.252 + OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" 1.253 + if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.254 + OPENJDK_TARGET_CPU_JLI="i386" 1.255 + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.256 + # On all platforms except macosx, we replace x86_64 with amd64. 1.257 + OPENJDK_TARGET_CPU_JLI="amd64" 1.258 + fi 1.259 + # Now setup the -D flags for building libjli. 1.260 + OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" 1.261 + if test "x$OPENJDK_TARGET_OS" = xsolaris; then 1.262 + if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then 1.263 + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" 1.264 + elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then 1.265 + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" 1.266 fi 1.267 - AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) 1.268 + fi 1.269 + AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) 1.270 1.271 - # This is the name of the cpu (but using i386 and amd64 instead of 1.272 - # x86 and x86_64, respectively), preceeded by a /, to be used when 1.273 - # locating libraries. On macosx, it's empty, though. 1.274 - OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" 1.275 - if test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.276 - OPENJDK_TARGET_CPU_LIBDIR="" 1.277 + # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. 1.278 + if test "x$OPENJDK_TARGET_OS_API" = xposix; then 1.279 + OPENJDK_TARGET_OS_API_DIR="solaris" 1.280 + fi 1.281 + if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then 1.282 + OPENJDK_TARGET_OS_API_DIR="windows" 1.283 + fi 1.284 + AC_SUBST(OPENJDK_TARGET_OS_API_DIR) 1.285 + 1.286 + if test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.287 + OPENJDK_TARGET_OS_EXPORT_DIR=macosx 1.288 + else 1.289 + OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} 1.290 + fi 1.291 + AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) 1.292 + 1.293 + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 1.294 + A_LP64="LP64:=" 1.295 + # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in 1.296 + # unpack200.exe 1.297 + if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.298 + ADD_LP64="-D_LP64=1" 1.299 fi 1.300 - AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) 1.301 + fi 1.302 + AC_SUBST(LP64,$A_LP64) 1.303 1.304 - # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to 1.305 - # /amd64 or /sparcv9. This string is appended to some library paths, like this: 1.306 - # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so 1.307 - OPENJDK_TARGET_CPU_ISADIR="" 1.308 - if test "x$OPENJDK_TARGET_OS" = xsolaris; then 1.309 - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.310 - OPENJDK_TARGET_CPU_ISADIR="/amd64" 1.311 - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then 1.312 - OPENJDK_TARGET_CPU_ISADIR="/sparcv9" 1.313 - fi 1.314 - fi 1.315 - AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) 1.316 + if test "x$COMPILE_TYPE" = "xcross"; then 1.317 + # FIXME: ... or should this include reduced builds..? 1.318 + DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" 1.319 + else 1.320 + DEFINE_CROSS_COMPILE_ARCH="" 1.321 + fi 1.322 + AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) 1.323 1.324 - # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property 1.325 - OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" 1.326 - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then 1.327 - # On linux only, we replace x86 with i386. 1.328 - OPENJDK_TARGET_CPU_OSARCH="i386" 1.329 - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.330 - # On all platforms except macosx, we replace x86_64 with amd64. 1.331 - OPENJDK_TARGET_CPU_OSARCH="amd64" 1.332 - fi 1.333 - AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) 1.334 - 1.335 - OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" 1.336 - if test "x$OPENJDK_TARGET_CPU" = xx86; then 1.337 - OPENJDK_TARGET_CPU_JLI="i386" 1.338 - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 1.339 - # On all platforms except macosx, we replace x86_64 with amd64. 1.340 - OPENJDK_TARGET_CPU_JLI="amd64" 1.341 - fi 1.342 - # Now setup the -D flags for building libjli. 1.343 - OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" 1.344 - if test "x$OPENJDK_TARGET_OS" = xsolaris; then 1.345 - if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then 1.346 - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" 1.347 - elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then 1.348 - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" 1.349 - fi 1.350 - fi 1.351 - AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) 1.352 - 1.353 - # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. 1.354 - if test "x$OPENJDK_TARGET_OS_API" = xposix; then 1.355 - OPENJDK_TARGET_OS_API_DIR="solaris" 1.356 - fi 1.357 - if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then 1.358 - OPENJDK_TARGET_OS_API_DIR="windows" 1.359 - fi 1.360 - AC_SUBST(OPENJDK_TARGET_OS_API_DIR) 1.361 - 1.362 - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 1.363 - A_LP64="LP64:=" 1.364 - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in 1.365 - # unpack200.exe 1.366 - if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.367 - ADD_LP64="-D_LP64=1" 1.368 - fi 1.369 - fi 1.370 - AC_SUBST(LP64,$A_LP64) 1.371 - 1.372 - if test "x$COMPILE_TYPE" = "xcross"; then 1.373 - # FIXME: ... or should this include reduced builds..? 1.374 - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" 1.375 - else 1.376 - DEFINE_CROSS_COMPILE_ARCH="" 1.377 - fi 1.378 - AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) 1.379 - 1.380 - # ZERO_ARCHDEF is used to enable architecture-specific code 1.381 - case "${OPENJDK_TARGET_CPU}" in 1.382 - ppc*) ZERO_ARCHDEF=PPC ;; 1.383 - s390*) ZERO_ARCHDEF=S390 ;; 1.384 - sparc*) ZERO_ARCHDEF=SPARC ;; 1.385 - x86_64*) ZERO_ARCHDEF=AMD64 ;; 1.386 - x86) ZERO_ARCHDEF=IA32 ;; 1.387 - *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) 1.388 - esac 1.389 - AC_SUBST(ZERO_ARCHDEF) 1.390 - 1.391 + # ZERO_ARCHDEF is used to enable architecture-specific code 1.392 + case "${OPENJDK_TARGET_CPU}" in 1.393 + ppc*) ZERO_ARCHDEF=PPC ;; 1.394 + s390*) ZERO_ARCHDEF=S390 ;; 1.395 + sparc*) ZERO_ARCHDEF=SPARC ;; 1.396 + x86_64*) ZERO_ARCHDEF=AMD64 ;; 1.397 + x86) ZERO_ARCHDEF=IA32 ;; 1.398 + *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) 1.399 + esac 1.400 + AC_SUBST(ZERO_ARCHDEF) 1.401 ]) 1.402 1.403 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], 1.404 [ 1.405 - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then 1.406 - REQUIRED_OS_NAME=SunOS 1.407 - REQUIRED_OS_VERSION=5.10 1.408 + if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then 1.409 + REQUIRED_OS_NAME=SunOS 1.410 + REQUIRED_OS_VERSION=5.10 1.411 + fi 1.412 + if test "x$OPENJDK_TARGET_OS" = "xlinux"; then 1.413 + REQUIRED_OS_NAME=Linux 1.414 + REQUIRED_OS_VERSION=2.6 1.415 + fi 1.416 + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 1.417 + REQUIRED_OS_NAME=Windows 1.418 + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then 1.419 + REQUIRED_OS_VERSION=5.2 1.420 + else 1.421 + REQUIRED_OS_VERSION=5.1 1.422 fi 1.423 - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then 1.424 - REQUIRED_OS_NAME=Linux 1.425 - REQUIRED_OS_VERSION=2.6 1.426 - fi 1.427 - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 1.428 - REQUIRED_OS_NAME=Windows 1.429 - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then 1.430 - REQUIRED_OS_VERSION=5.2 1.431 - else 1.432 - REQUIRED_OS_VERSION=5.1 1.433 - fi 1.434 - fi 1.435 - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 1.436 - REQUIRED_OS_NAME=Darwin 1.437 - REQUIRED_OS_VERSION=11.2 1.438 - fi 1.439 + fi 1.440 + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 1.441 + REQUIRED_OS_NAME=Darwin 1.442 + REQUIRED_OS_VERSION=11.2 1.443 + fi 1.444 1.445 - AC_SUBST(REQUIRED_OS_NAME) 1.446 - AC_SUBST(REQUIRED_OS_VERSION) 1.447 + AC_SUBST(REQUIRED_OS_NAME) 1.448 + AC_SUBST(REQUIRED_OS_VERSION) 1.449 ]) 1.450 1.451 #%%% Build and target systems %%% 1.452 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], 1.453 [ 1.454 -# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" 1.455 -# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the 1.456 -# product you're building. The target of this build is called "host". Since this is confusing to most people, we 1.457 -# have not adopted that system, but use "target" as the platform we are building for. In some places though we need 1.458 -# to use the configure naming style. 1.459 -AC_CANONICAL_BUILD 1.460 -AC_CANONICAL_HOST 1.461 -AC_CANONICAL_TARGET 1.462 + # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" 1.463 + # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the 1.464 + # product you're building. The target of this build is called "host". Since this is confusing to most people, we 1.465 + # have not adopted that system, but use "target" as the platform we are building for. In some places though we need 1.466 + # to use the configure naming style. 1.467 + AC_CANONICAL_BUILD 1.468 + AC_CANONICAL_HOST 1.469 + AC_CANONICAL_TARGET 1.470 1.471 -PLATFORM_EXTRACT_TARGET_AND_BUILD 1.472 -PLATFORM_SETUP_TARGET_CPU_BITS 1.473 -PLATFORM_SET_RELEASE_FILE_OS_VALUES 1.474 -PLATFORM_SETUP_LEGACY_VARS 1.475 + PLATFORM_EXTRACT_TARGET_AND_BUILD 1.476 + PLATFORM_SETUP_TARGET_CPU_BITS 1.477 + PLATFORM_SET_RELEASE_FILE_OS_VALUES 1.478 + PLATFORM_SETUP_LEGACY_VARS 1.479 ]) 1.480 1.481 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], 1.482 [ 1.483 -############################################################################### 1.484 + ############################################################################### 1.485 1.486 -# Note that this is the build platform OS version! 1.487 + # Note that this is the build platform OS version! 1.488 1.489 -OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" 1.490 -OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" 1.491 -OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" 1.492 -OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" 1.493 -AC_SUBST(OS_VERSION_MAJOR) 1.494 -AC_SUBST(OS_VERSION_MINOR) 1.495 -AC_SUBST(OS_VERSION_MICRO) 1.496 + OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" 1.497 + OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" 1.498 + OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" 1.499 + OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" 1.500 + AC_SUBST(OS_VERSION_MAJOR) 1.501 + AC_SUBST(OS_VERSION_MINOR) 1.502 + AC_SUBST(OS_VERSION_MICRO) 1.503 ]) 1.504 1.505 # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. 1.506 # Add -mX to various FLAGS variables. 1.507 AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], 1.508 [ 1.509 - # keep track of c/cxx flags that we added outselves... 1.510 - # to prevent emitting warning... 1.511 + # When we add flags to the "official" CFLAGS etc, we need to 1.512 + # keep track of these additions in ADDED_CFLAGS etc. These 1.513 + # will later be checked to make sure only controlled additions 1.514 + # have been made to CFLAGS etc. 1.515 ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" 1.516 ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" 1.517 ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" 1.518 @@ -432,84 +452,84 @@ 1.519 1.520 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], 1.521 [ 1.522 -############################################################################### 1.523 -# 1.524 -# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. 1.525 -# (The JVM can use 32 or 64 bit Java pointers but that decision 1.526 -# is made at runtime.) 1.527 -# 1.528 + ############################################################################### 1.529 + # 1.530 + # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. 1.531 + # (The JVM can use 32 or 64 bit Java pointers but that decision 1.532 + # is made at runtime.) 1.533 + # 1.534 1.535 -if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then 1.536 - # Always specify -m flag on Solaris 1.537 - # And -q on AIX because otherwise the compiler produces 32-bit objects by default 1.538 - PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS 1.539 -elif test "x$COMPILE_TYPE" = xreduced; then 1.540 - if test "x$OPENJDK_TARGET_OS" != xwindows; then 1.541 - # Specify -m if running reduced on other Posix platforms 1.542 + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then 1.543 + # Always specify -m flag on Solaris 1.544 + # And -q on AIX because otherwise the compiler produces 32-bit objects by default 1.545 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS 1.546 + elif test "x$COMPILE_TYPE" = xreduced; then 1.547 + if test "x$OPENJDK_TARGET_OS" != xwindows; then 1.548 + # Specify -m if running reduced on other Posix platforms 1.549 + PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS 1.550 + fi 1.551 fi 1.552 -fi 1.553 1.554 -# Make compilation sanity check 1.555 -AC_CHECK_HEADERS([stdio.h], , [ 1.556 - AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) 1.557 - if test "x$COMPILE_TYPE" = xreduced; then 1.558 - AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) 1.559 - elif test "x$COMPILE_TYPE" = xcross; then 1.560 - AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) 1.561 - fi 1.562 - AC_MSG_ERROR([Cannot continue.]) 1.563 -]) 1.564 + # Make compilation sanity check 1.565 + AC_CHECK_HEADERS([stdio.h], , [ 1.566 + AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) 1.567 + if test "x$COMPILE_TYPE" = xreduced; then 1.568 + AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) 1.569 + elif test "x$COMPILE_TYPE" = xcross; then 1.570 + AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) 1.571 + fi 1.572 + AC_MSG_ERROR([Cannot continue.]) 1.573 + ]) 1.574 1.575 -AC_CHECK_SIZEOF([int *], [1111]) 1.576 + AC_CHECK_SIZEOF([int *], [1111]) 1.577 1.578 -# AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' 1.579 -if test "x$ac_cv_sizeof_int_p" = x; then 1.580 + # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' 1.581 + if test "x$ac_cv_sizeof_int_p" = x; then 1.582 # The test failed, lets stick to the assumed value. 1.583 AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) 1.584 -else 1.585 + else 1.586 TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` 1.587 1.588 if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then 1.589 - # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects 1.590 - # Let's try to implicitely set the compilers target architecture and retry the test 1.591 - 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).]) 1.592 - AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) 1.593 - PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS 1.594 + # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects 1.595 + # Let's try to implicitely set the compilers target architecture and retry the test 1.596 + 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).]) 1.597 + AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) 1.598 + PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS 1.599 1.600 - # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! 1.601 - unset ac_cv_sizeof_int_p 1.602 - # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF 1.603 - cat >>confdefs.h <<_ACEOF 1.604 + # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! 1.605 + unset ac_cv_sizeof_int_p 1.606 + # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF 1.607 + cat >>confdefs.h <<_ACEOF 1.608 #undef SIZEOF_INT_P 1.609 _ACEOF 1.610 1.611 - AC_CHECK_SIZEOF([int *], [1111]) 1.612 + AC_CHECK_SIZEOF([int *], [1111]) 1.613 1.614 - TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` 1.615 + TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` 1.616 1.617 - if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then 1.618 - 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)]) 1.619 - fi 1.620 + if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then 1.621 + 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)]) 1.622 + fi 1.623 fi 1.624 -fi 1.625 + fi 1.626 1.627 -AC_MSG_CHECKING([for target address size]) 1.628 -AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) 1.629 + AC_MSG_CHECKING([for target address size]) 1.630 + AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) 1.631 ]) 1.632 1.633 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], 1.634 [ 1.635 -############################################################################### 1.636 -# 1.637 -# Is the target little of big endian? 1.638 -# 1.639 -AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) 1.640 + ############################################################################### 1.641 + # 1.642 + # Is the target little of big endian? 1.643 + # 1.644 + AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) 1.645 1.646 -if test "x$ENDIAN" = xuniversal_endianness; then 1.647 + if test "x$ENDIAN" = xuniversal_endianness; then 1.648 AC_MSG_ERROR([Building with both big and little endianness is not supported]) 1.649 -fi 1.650 -if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then 1.651 + fi 1.652 + if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then 1.653 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)]) 1.654 -fi 1.655 + fi 1.656 ])