131 # Translate the standard triplet(quadruplet) definition |
143 # Translate the standard triplet(quadruplet) definition |
132 # of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU, |
144 # of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU, |
133 # OPENJDK_BUILD_OS, etc. |
145 # OPENJDK_BUILD_OS, etc. |
134 AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], |
146 AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], |
135 [ |
147 [ |
136 # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME |
148 # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME |
137 # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME |
149 # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME |
138 # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, |
150 # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, |
139 # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. |
151 # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. |
140 OPENJDK_TARGET_AUTOCONF_NAME="$host" |
152 OPENJDK_TARGET_AUTOCONF_NAME="$host" |
141 OPENJDK_BUILD_AUTOCONF_NAME="$build" |
153 OPENJDK_BUILD_AUTOCONF_NAME="$build" |
142 AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) |
154 AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) |
143 AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) |
155 AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) |
144 |
156 |
145 # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
157 # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
146 PLATFORM_EXTRACT_VARS_FROM_OS($build_os) |
158 PLATFORM_EXTRACT_VARS_FROM_OS($build_os) |
147 PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) |
159 PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) |
148 # ..and setup our own variables. (Do this explicitely to facilitate searching) |
160 # ..and setup our own variables. (Do this explicitely to facilitate searching) |
149 OPENJDK_BUILD_OS="$VAR_OS" |
161 OPENJDK_BUILD_OS="$VAR_OS" |
150 OPENJDK_BUILD_OS_API="$VAR_OS_API" |
162 OPENJDK_BUILD_OS_API="$VAR_OS_API" |
151 OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" |
163 OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" |
152 OPENJDK_BUILD_CPU="$VAR_CPU" |
164 OPENJDK_BUILD_CPU="$VAR_CPU" |
153 OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" |
165 OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" |
154 OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" |
166 OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" |
155 OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
167 OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
156 AC_SUBST(OPENJDK_BUILD_OS) |
168 AC_SUBST(OPENJDK_BUILD_OS) |
157 AC_SUBST(OPENJDK_BUILD_OS_API) |
169 AC_SUBST(OPENJDK_BUILD_OS_API) |
158 AC_SUBST(OPENJDK_BUILD_CPU) |
170 AC_SUBST(OPENJDK_BUILD_CPU) |
159 AC_SUBST(OPENJDK_BUILD_CPU_ARCH) |
171 AC_SUBST(OPENJDK_BUILD_CPU_ARCH) |
160 AC_SUBST(OPENJDK_BUILD_CPU_BITS) |
172 AC_SUBST(OPENJDK_BUILD_CPU_BITS) |
161 AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) |
173 AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) |
162 |
174 |
163 AC_MSG_CHECKING([openjdk-build os-cpu]) |
175 AC_MSG_CHECKING([openjdk-build os-cpu]) |
164 AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) |
176 AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) |
165 |
177 |
166 # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
178 # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. |
167 PLATFORM_EXTRACT_VARS_FROM_OS($host_os) |
179 PLATFORM_EXTRACT_VARS_FROM_OS($host_os) |
168 PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) |
180 PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) |
169 # ... and setup our own variables. (Do this explicitely to facilitate searching) |
181 # ... and setup our own variables. (Do this explicitely to facilitate searching) |
170 OPENJDK_TARGET_OS="$VAR_OS" |
182 OPENJDK_TARGET_OS="$VAR_OS" |
171 OPENJDK_TARGET_OS_API="$VAR_OS_API" |
183 OPENJDK_TARGET_OS_API="$VAR_OS_API" |
172 OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" |
184 OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" |
173 OPENJDK_TARGET_CPU="$VAR_CPU" |
185 OPENJDK_TARGET_CPU="$VAR_CPU" |
174 OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" |
186 OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" |
175 OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" |
187 OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" |
176 OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
188 OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
177 AC_SUBST(OPENJDK_TARGET_OS) |
189 AC_SUBST(OPENJDK_TARGET_OS) |
178 AC_SUBST(OPENJDK_TARGET_OS_API) |
190 AC_SUBST(OPENJDK_TARGET_OS_API) |
179 AC_SUBST(OPENJDK_TARGET_CPU) |
191 AC_SUBST(OPENJDK_TARGET_CPU) |
180 AC_SUBST(OPENJDK_TARGET_CPU_ARCH) |
192 AC_SUBST(OPENJDK_TARGET_CPU_ARCH) |
181 AC_SUBST(OPENJDK_TARGET_CPU_BITS) |
193 AC_SUBST(OPENJDK_TARGET_CPU_BITS) |
182 AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) |
194 AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) |
183 |
195 |
184 AC_MSG_CHECKING([openjdk-target os-cpu]) |
196 AC_MSG_CHECKING([openjdk-target os-cpu]) |
185 AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) |
197 AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) |
186 ]) |
198 ]) |
187 |
199 |
188 # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour |
200 # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour |
189 # accordingly. Must be done after setting up build and target system, but before |
201 # accordingly. Must be done after setting up build and target system, but before |
190 # doing anything else with these values. |
202 # doing anything else with these values. |
191 AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], |
203 AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], |
192 [ |
204 [ |
193 AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], |
205 AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], |
194 [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) |
206 [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) |
195 |
207 |
196 # We have three types of compiles: |
208 # We have three types of compiles: |
197 # native == normal compilation, target system == build system |
209 # native == normal compilation, target system == build system |
198 # cross == traditional cross compilation, target system != build system; special toolchain needed |
210 # cross == traditional cross compilation, target system != build system; special toolchain needed |
199 # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines |
211 # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines |
218 OPENJDK_TARGET_CPU=x86 |
230 OPENJDK_TARGET_CPU=x86 |
219 elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
231 elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
220 OPENJDK_TARGET_CPU=sparc |
232 OPENJDK_TARGET_CPU=sparc |
221 else |
233 else |
222 AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) |
234 AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) |
223 fi |
235 fi |
224 elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
236 elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
225 AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.]) |
237 AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.]) |
226 elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then |
238 elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then |
227 AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning]) |
239 AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning]) |
228 else |
240 else |
229 AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!]) |
241 AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!]) |
230 fi |
242 fi |
231 fi |
243 fi |
232 AC_SUBST(COMPILE_TYPE) |
244 AC_SUBST(COMPILE_TYPE) |
233 |
245 |
234 AC_MSG_CHECKING([compilation type]) |
246 AC_MSG_CHECKING([compilation type]) |
235 AC_MSG_RESULT([$COMPILE_TYPE]) |
247 AC_MSG_RESULT([$COMPILE_TYPE]) |
236 ]) |
248 ]) |
237 |
249 |
238 # Setup the legacy variables, for controlling the old makefiles. |
250 # Setup the legacy variables, for controlling the old makefiles. |
239 # |
251 # |
240 AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], |
252 AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], |
241 [ |
253 [ |
242 # Also store the legacy naming of the cpu. |
254 # Also store the legacy naming of the cpu. |
243 # Ie i586 and amd64 instead of x86 and x86_64 |
255 # Ie i586 and amd64 instead of x86 and x86_64 |
244 OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" |
256 OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" |
245 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
257 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
246 OPENJDK_TARGET_CPU_LEGACY="i586" |
258 OPENJDK_TARGET_CPU_LEGACY="i586" |
247 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
259 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
248 # On all platforms except MacOSX replace x86_64 with amd64. |
260 # On all platforms except MacOSX replace x86_64 with amd64. |
249 OPENJDK_TARGET_CPU_LEGACY="amd64" |
261 OPENJDK_TARGET_CPU_LEGACY="amd64" |
250 fi |
262 fi |
251 AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) |
263 AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) |
252 |
264 |
253 # And the second legacy naming of the cpu. |
265 # And the second legacy naming of the cpu. |
254 # Ie i386 and amd64 instead of x86 and x86_64. |
266 # Ie i386 and amd64 instead of x86 and x86_64. |
255 OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" |
267 OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" |
256 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
268 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
257 OPENJDK_TARGET_CPU_LEGACY_LIB="i386" |
269 OPENJDK_TARGET_CPU_LEGACY_LIB="i386" |
258 elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
270 elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
259 OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" |
271 OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" |
260 fi |
272 fi |
261 AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) |
273 AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) |
262 |
274 |
263 # This is the name of the cpu (but using i386 and amd64 instead of |
275 # This is the name of the cpu (but using i386 and amd64 instead of |
264 # x86 and x86_64, respectively), preceeded by a /, to be used when |
276 # x86 and x86_64, respectively), preceeded by a /, to be used when |
265 # locating libraries. On macosx, it's empty, though. |
277 # locating libraries. On macosx, it's empty, though. |
266 OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" |
278 OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" |
267 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
279 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
268 OPENJDK_TARGET_CPU_LIBDIR="" |
280 OPENJDK_TARGET_CPU_LIBDIR="" |
269 fi |
281 fi |
270 AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) |
282 AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) |
271 |
283 |
272 # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to |
284 # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to |
273 # /amd64 or /sparcv9. This string is appended to some library paths, like this: |
285 # /amd64 or /sparcv9. This string is appended to some library paths, like this: |
274 # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so |
286 # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so |
275 OPENJDK_TARGET_CPU_ISADIR="" |
287 OPENJDK_TARGET_CPU_ISADIR="" |
276 if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
288 if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
277 if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
289 if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
278 OPENJDK_TARGET_CPU_ISADIR="/amd64" |
290 OPENJDK_TARGET_CPU_ISADIR="/amd64" |
279 elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
291 elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
280 OPENJDK_TARGET_CPU_ISADIR="/sparcv9" |
292 OPENJDK_TARGET_CPU_ISADIR="/sparcv9" |
281 fi |
293 fi |
282 fi |
294 fi |
283 AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) |
295 AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) |
284 |
296 |
285 # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property |
297 # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property |
286 OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" |
298 OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" |
287 if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then |
299 if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then |
288 # On linux only, we replace x86 with i386. |
300 # On linux only, we replace x86 with i386. |
289 OPENJDK_TARGET_CPU_OSARCH="i386" |
301 OPENJDK_TARGET_CPU_OSARCH="i386" |
290 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
302 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
291 # On all platforms except macosx, we replace x86_64 with amd64. |
303 # On all platforms except macosx, we replace x86_64 with amd64. |
292 OPENJDK_TARGET_CPU_OSARCH="amd64" |
304 OPENJDK_TARGET_CPU_OSARCH="amd64" |
293 fi |
305 fi |
294 AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) |
306 AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) |
295 |
307 |
296 OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" |
308 OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" |
297 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
309 if test "x$OPENJDK_TARGET_CPU" = xx86; then |
298 OPENJDK_TARGET_CPU_JLI="i386" |
310 OPENJDK_TARGET_CPU_JLI="i386" |
299 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
311 elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
300 # On all platforms except macosx, we replace x86_64 with amd64. |
312 # On all platforms except macosx, we replace x86_64 with amd64. |
301 OPENJDK_TARGET_CPU_JLI="amd64" |
313 OPENJDK_TARGET_CPU_JLI="amd64" |
302 fi |
314 fi |
303 # Now setup the -D flags for building libjli. |
315 # Now setup the -D flags for building libjli. |
304 OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" |
316 OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" |
305 if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
317 if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
306 if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then |
318 if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then |
307 OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" |
319 OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" |
308 elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then |
320 elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then |
309 OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" |
321 OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" |
310 fi |
322 fi |
311 fi |
323 fi |
312 AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
324 AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
313 |
325 |
314 # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. |
326 # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. |
315 if test "x$OPENJDK_TARGET_OS_API" = xposix; then |
327 if test "x$OPENJDK_TARGET_OS_API" = xposix; then |
316 OPENJDK_TARGET_OS_API_DIR="solaris" |
328 OPENJDK_TARGET_OS_API_DIR="solaris" |
317 fi |
329 fi |
318 if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then |
330 if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then |
319 OPENJDK_TARGET_OS_API_DIR="windows" |
331 OPENJDK_TARGET_OS_API_DIR="windows" |
320 fi |
332 fi |
321 AC_SUBST(OPENJDK_TARGET_OS_API_DIR) |
333 AC_SUBST(OPENJDK_TARGET_OS_API_DIR) |
322 |
334 |
323 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
335 if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
324 A_LP64="LP64:=" |
336 OPENJDK_TARGET_OS_EXPORT_DIR=macosx |
325 # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in |
337 else |
326 # unpack200.exe |
338 OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} |
327 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then |
339 fi |
328 ADD_LP64="-D_LP64=1" |
340 AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) |
329 fi |
341 |
330 fi |
342 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
331 AC_SUBST(LP64,$A_LP64) |
343 A_LP64="LP64:=" |
332 |
344 # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in |
333 if test "x$COMPILE_TYPE" = "xcross"; then |
345 # unpack200.exe |
334 # FIXME: ... or should this include reduced builds..? |
346 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then |
335 DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" |
347 ADD_LP64="-D_LP64=1" |
|
348 fi |
|
349 fi |
|
350 AC_SUBST(LP64,$A_LP64) |
|
351 |
|
352 if test "x$COMPILE_TYPE" = "xcross"; then |
|
353 # FIXME: ... or should this include reduced builds..? |
|
354 DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" |
|
355 else |
|
356 DEFINE_CROSS_COMPILE_ARCH="" |
|
357 fi |
|
358 AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) |
|
359 |
|
360 # ZERO_ARCHDEF is used to enable architecture-specific code |
|
361 case "${OPENJDK_TARGET_CPU}" in |
|
362 ppc*) ZERO_ARCHDEF=PPC ;; |
|
363 s390*) ZERO_ARCHDEF=S390 ;; |
|
364 sparc*) ZERO_ARCHDEF=SPARC ;; |
|
365 x86_64*) ZERO_ARCHDEF=AMD64 ;; |
|
366 x86) ZERO_ARCHDEF=IA32 ;; |
|
367 *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) |
|
368 esac |
|
369 AC_SUBST(ZERO_ARCHDEF) |
|
370 ]) |
|
371 |
|
372 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], |
|
373 [ |
|
374 if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
|
375 REQUIRED_OS_NAME=SunOS |
|
376 REQUIRED_OS_VERSION=5.10 |
|
377 fi |
|
378 if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
|
379 REQUIRED_OS_NAME=Linux |
|
380 REQUIRED_OS_VERSION=2.6 |
|
381 fi |
|
382 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
|
383 REQUIRED_OS_NAME=Windows |
|
384 if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
|
385 REQUIRED_OS_VERSION=5.2 |
336 else |
386 else |
337 DEFINE_CROSS_COMPILE_ARCH="" |
387 REQUIRED_OS_VERSION=5.1 |
338 fi |
388 fi |
339 AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) |
389 fi |
340 |
390 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
341 # ZERO_ARCHDEF is used to enable architecture-specific code |
391 REQUIRED_OS_NAME=Darwin |
342 case "${OPENJDK_TARGET_CPU}" in |
392 REQUIRED_OS_VERSION=11.2 |
343 ppc*) ZERO_ARCHDEF=PPC ;; |
393 fi |
344 s390*) ZERO_ARCHDEF=S390 ;; |
394 |
345 sparc*) ZERO_ARCHDEF=SPARC ;; |
395 AC_SUBST(REQUIRED_OS_NAME) |
346 x86_64*) ZERO_ARCHDEF=AMD64 ;; |
396 AC_SUBST(REQUIRED_OS_VERSION) |
347 x86) ZERO_ARCHDEF=IA32 ;; |
|
348 *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) |
|
349 esac |
|
350 AC_SUBST(ZERO_ARCHDEF) |
|
351 |
|
352 ]) |
|
353 |
|
354 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], |
|
355 [ |
|
356 if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
|
357 REQUIRED_OS_NAME=SunOS |
|
358 REQUIRED_OS_VERSION=5.10 |
|
359 fi |
|
360 if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
|
361 REQUIRED_OS_NAME=Linux |
|
362 REQUIRED_OS_VERSION=2.6 |
|
363 fi |
|
364 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
|
365 REQUIRED_OS_NAME=Windows |
|
366 if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
|
367 REQUIRED_OS_VERSION=5.2 |
|
368 else |
|
369 REQUIRED_OS_VERSION=5.1 |
|
370 fi |
|
371 fi |
|
372 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
|
373 REQUIRED_OS_NAME=Darwin |
|
374 REQUIRED_OS_VERSION=11.2 |
|
375 fi |
|
376 |
|
377 AC_SUBST(REQUIRED_OS_NAME) |
|
378 AC_SUBST(REQUIRED_OS_VERSION) |
|
379 ]) |
397 ]) |
380 |
398 |
381 #%%% Build and target systems %%% |
399 #%%% Build and target systems %%% |
382 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], |
400 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], |
383 [ |
401 [ |
384 # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" |
402 # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" |
385 # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the |
403 # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the |
386 # product you're building. The target of this build is called "host". Since this is confusing to most people, we |
404 # product you're building. The target of this build is called "host". Since this is confusing to most people, we |
387 # have not adopted that system, but use "target" as the platform we are building for. In some places though we need |
405 # have not adopted that system, but use "target" as the platform we are building for. In some places though we need |
388 # to use the configure naming style. |
406 # to use the configure naming style. |
389 AC_CANONICAL_BUILD |
407 AC_CANONICAL_BUILD |
390 AC_CANONICAL_HOST |
408 AC_CANONICAL_HOST |
391 AC_CANONICAL_TARGET |
409 AC_CANONICAL_TARGET |
392 |
410 |
393 PLATFORM_EXTRACT_TARGET_AND_BUILD |
411 PLATFORM_EXTRACT_TARGET_AND_BUILD |
394 PLATFORM_SETUP_TARGET_CPU_BITS |
412 PLATFORM_SETUP_TARGET_CPU_BITS |
395 PLATFORM_SET_RELEASE_FILE_OS_VALUES |
413 PLATFORM_SET_RELEASE_FILE_OS_VALUES |
396 PLATFORM_SETUP_LEGACY_VARS |
414 PLATFORM_SETUP_LEGACY_VARS |
397 ]) |
415 ]) |
398 |
416 |
399 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], |
417 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], |
400 [ |
418 [ |
401 ############################################################################### |
419 ############################################################################### |
402 |
420 |
403 # Note that this is the build platform OS version! |
421 # Note that this is the build platform OS version! |
404 |
422 |
405 OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" |
423 OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" |
406 OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" |
424 OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" |
407 OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" |
425 OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" |
408 OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" |
426 OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" |
409 AC_SUBST(OS_VERSION_MAJOR) |
427 AC_SUBST(OS_VERSION_MAJOR) |
410 AC_SUBST(OS_VERSION_MINOR) |
428 AC_SUBST(OS_VERSION_MINOR) |
411 AC_SUBST(OS_VERSION_MICRO) |
429 AC_SUBST(OS_VERSION_MICRO) |
412 ]) |
430 ]) |
413 |
431 |
414 # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. |
432 # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. |
415 # Add -mX to various FLAGS variables. |
433 # Add -mX to various FLAGS variables. |
416 AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], |
434 AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], |
417 [ |
435 [ |
418 # keep track of c/cxx flags that we added outselves... |
436 # When we add flags to the "official" CFLAGS etc, we need to |
419 # to prevent emitting warning... |
437 # keep track of these additions in ADDED_CFLAGS etc. These |
|
438 # will later be checked to make sure only controlled additions |
|
439 # have been made to CFLAGS etc. |
420 ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
440 ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
421 ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
441 ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
422 ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
442 ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" |
423 |
443 |
424 CFLAGS="${CFLAGS}${ADDED_CFLAGS}" |
444 CFLAGS="${CFLAGS}${ADDED_CFLAGS}" |
430 LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" |
450 LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" |
431 ]) |
451 ]) |
432 |
452 |
433 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], |
453 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], |
434 [ |
454 [ |
435 ############################################################################### |
455 ############################################################################### |
436 # |
456 # |
437 # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. |
457 # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. |
438 # (The JVM can use 32 or 64 bit Java pointers but that decision |
458 # (The JVM can use 32 or 64 bit Java pointers but that decision |
439 # is made at runtime.) |
459 # is made at runtime.) |
440 # |
460 # |
441 |
461 |
442 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then |
462 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then |
443 # Always specify -m flag on Solaris |
463 # Always specify -m flag on Solaris |
444 # And -q on AIX because otherwise the compiler produces 32-bit objects by default |
464 # And -q on AIX because otherwise the compiler produces 32-bit objects by default |
445 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
|
446 elif test "x$COMPILE_TYPE" = xreduced; then |
|
447 if test "x$OPENJDK_TARGET_OS" != xwindows; then |
|
448 # Specify -m if running reduced on other Posix platforms |
|
449 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
465 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
450 fi |
466 elif test "x$COMPILE_TYPE" = xreduced; then |
451 fi |
467 if test "x$OPENJDK_TARGET_OS" != xwindows; then |
452 |
468 # Specify -m if running reduced on other Posix platforms |
453 # Make compilation sanity check |
469 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
454 AC_CHECK_HEADERS([stdio.h], , [ |
470 fi |
455 AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) |
471 fi |
456 if test "x$COMPILE_TYPE" = xreduced; then |
472 |
457 AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) |
473 # Make compilation sanity check |
458 elif test "x$COMPILE_TYPE" = xcross; then |
474 AC_CHECK_HEADERS([stdio.h], , [ |
459 AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) |
475 AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) |
460 fi |
476 if test "x$COMPILE_TYPE" = xreduced; then |
461 AC_MSG_ERROR([Cannot continue.]) |
477 AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) |
462 ]) |
478 elif test "x$COMPILE_TYPE" = xcross; then |
463 |
479 AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) |
464 AC_CHECK_SIZEOF([int *], [1111]) |
480 fi |
465 |
481 AC_MSG_ERROR([Cannot continue.]) |
466 # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' |
482 ]) |
467 if test "x$ac_cv_sizeof_int_p" = x; then |
483 |
|
484 AC_CHECK_SIZEOF([int *], [1111]) |
|
485 |
|
486 # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' |
|
487 if test "x$ac_cv_sizeof_int_p" = x; then |
468 # The test failed, lets stick to the assumed value. |
488 # The test failed, lets stick to the assumed value. |
469 AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) |
489 AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) |
470 else |
490 else |
471 TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
491 TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
472 |
492 |
473 if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
493 if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
474 # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects |
494 # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects |
475 # Let's try to implicitely set the compilers target architecture and retry the test |
495 # Let's try to implicitely set the compilers target architecture and retry the test |
476 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).]) |
496 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).]) |
477 AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) |
497 AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) |
478 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
498 PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS |
479 |
499 |
480 # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! |
500 # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! |
481 unset ac_cv_sizeof_int_p |
501 unset ac_cv_sizeof_int_p |
482 # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF |
502 # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF |
483 cat >>confdefs.h <<_ACEOF |
503 cat >>confdefs.h <<_ACEOF |
484 #undef SIZEOF_INT_P |
504 #undef SIZEOF_INT_P |
485 _ACEOF |
505 _ACEOF |
486 |
506 |
487 AC_CHECK_SIZEOF([int *], [1111]) |
507 AC_CHECK_SIZEOF([int *], [1111]) |
488 |
508 |
489 TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
509 TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` |
490 |
510 |
491 if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
511 if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then |
492 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)]) |
512 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)]) |
493 fi |
513 fi |
494 fi |
514 fi |
495 fi |
515 fi |
496 |
516 |
497 AC_MSG_CHECKING([for target address size]) |
517 AC_MSG_CHECKING([for target address size]) |
498 AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) |
518 AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) |
499 ]) |
519 ]) |
500 |
520 |
501 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], |
521 AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], |
502 [ |
522 [ |
503 ############################################################################### |
523 ############################################################################### |
504 # |
524 # |
505 # Is the target little of big endian? |
525 # Is the target little of big endian? |
506 # |
526 # |
507 AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) |
527 AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) |
508 |
528 |
509 if test "x$ENDIAN" = xuniversal_endianness; then |
529 if test "x$ENDIAN" = xuniversal_endianness; then |
510 AC_MSG_ERROR([Building with both big and little endianness is not supported]) |
530 AC_MSG_ERROR([Building with both big and little endianness is not supported]) |
511 fi |
531 fi |
512 if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then |
532 if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then |
513 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)]) |
533 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)]) |
514 fi |
534 fi |
515 ]) |
535 ]) |