comparison make/bsd/makefiles/buildtree.make @ 3038:e8a4934564b2

7125793: MAC: test_gamma should always work Summary: Fix gamma launcher on Mac OS X and reconcile test_gamma script on Unix platforms Reviewed-by: dcubed, ohair, jcoomes, dholmes, ksrini Contributed-by: james.melvin@oracle.com
author phh
date Tue, 24 Jan 2012 19:33:14 -0500
parents 8657ec177a14
children 7292cff45988
comparison
equal deleted inserted replaced
3:b0a5e1216b11 4:31f716e7486d
158 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 158 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
159 include $(GAMMADIR)/make/hotspot_distro 159 include $(GAMMADIR)/make/hotspot_distro
160 else 160 else
161 include $(GAMMADIR)/make/openjdk_distro 161 include $(GAMMADIR)/make/openjdk_distro
162 endif 162 endif
163 endif
164
165 ifeq ($(OS_VENDOR), Darwin)
166 # MACOSX FIXME: we should be able to run test_gamma (see MACOSX_PORT-214)
167 ifeq ($(ALWAYS_PASS_TEST_GAMMA),)
168 # ALWAYS_PASS_TEST_GAMMA wasn't set so we default to true on MacOS X
169 # until MACOSX_PORT-214 is fixed
170 ALWAYS_PASS_TEST_GAMMA=true
171 endif
172 endif
173 ifeq ($(ALWAYS_PASS_TEST_GAMMA), true)
174 TEST_GAMMA_STATUS= echo 'exit 0';
175 else
176 TEST_GAMMA_STATUS=
177 endif 163 endif
178 164
179 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 165 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
180 166
181 BUILDTREE = \ 167 BUILDTREE = \
351 @echo Creating $@ ... 337 @echo Creating $@ ...
352 $(QUIETLY) ( \ 338 $(QUIETLY) ( \
353 $(BUILDTREE_COMMENT); \ 339 $(BUILDTREE_COMMENT); \
354 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ 340 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
355 { \ 341 { \
356 echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
357 echo "DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
358 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ 342 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
359 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ 343 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
360 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ 344 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
361 echo "export JAVA_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ 345 echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
362 ) > $@ 346 ) > $@
363 347
364 env.csh: env.sh 348 env.csh: env.sh
365 @echo Creating $@ ... 349 @echo Creating $@ ...
366 $(QUIETLY) ( \ 350 $(QUIETLY) ( \
410 394
411 JAVA_FLAG/32 = -d32 395 JAVA_FLAG/32 = -d32
412 JAVA_FLAG/64 = -d64 396 JAVA_FLAG/64 = -d64
413 397
414 WRONG_DATA_MODE_MSG = \ 398 WRONG_DATA_MODE_MSG = \
415 echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." 399 echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
416 400
417 CROSS_COMPILING_MSG = \ 401 CROSS_COMPILING_MSG = \
418 echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run." 402 echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
419 403
420 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java 404 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
421 @echo Creating $@ ... 405 @echo Creating $@ ...
422 $(QUIETLY) ( \ 406 $(QUIETLY) ( \
423 echo '#!/bin/sh'; \ 407 echo "#!/bin/sh"; \
424 $(BUILDTREE_COMMENT); \ 408 echo ""; \
425 echo '. ./env.sh'; \ 409 $(BUILDTREE_COMMENT); \
426 echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \ 410 echo ""; \
427 echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ 411 echo "# Include environment settings for gamma run"; \
428 echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ 412 echo ""; \
429 echo "then"; \ 413 echo ". ./env.sh"; \
430 echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ 414 echo ""; \
431 echo "fi"; \ 415 echo "# Do not run gamma test for cross compiles"; \
416 echo ""; \
417 echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
418 echo " $(CROSS_COMPILING_MSG)"; \
419 echo " exit 0"; \
420 echo "fi"; \
421 echo ""; \
422 echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
423 echo ""; \
424 echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
425 echo " $(NO_JAVA_HOME_MSG)"; \
426 echo " exit 0"; \
427 echo "fi"; \
428 echo ""; \
429 echo "# Check JAVA_HOME version to be used for the test"; \
430 echo ""; \
431 echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
432 echo "if [ \$$? -ne 0 ]; then "; \
433 echo " $(WRONG_DATA_MODE_MSG)"; \
434 echo " exit 0"; \
435 echo "fi"; \
436 echo ""; \
437 echo "# Use gamma_g if it exists"; \
438 echo ""; \
439 echo "GAMMA_PROG=gamma"; \
440 echo "if [ -f gamma_g ]; then "; \
441 echo " GAMMA_PROG=gamma_g"; \
442 echo "fi"; \
443 echo ""; \
444 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
445 echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
446 echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
447 echo ""; \
448 echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
449 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
450 echo " if [ ! -f \$${JVM_LIB} ]; then"; \
451 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
452 echo " fi"; \
453 echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
454 echo " $(WRONG_DATA_MODE_MSG)"; \
455 echo " exit 0"; \
456 echo " fi"; \
457 echo "fi"; \
458 echo ""; \
459 echo "# Compile Queens program for test"; \
460 echo ""; \
432 echo "rm -f Queens.class"; \ 461 echo "rm -f Queens.class"; \
433 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ 462 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
434 echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ 463 echo ""; \
435 echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ 464 echo "# Set library path solely for gamma launcher test run"; \
436 $(TEST_GAMMA_STATUS) \ 465 echo ""; \
466 echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
467 echo "export LD_LIBRARY_PATH"; \
468 echo "unset LD_LIBRARY_PATH_32"; \
469 echo "unset LD_LIBRARY_PATH_64"; \
470 echo ""; \
471 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
472 echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
473 echo " export DYLD_LIBRARY_PATH"; \
474 echo "fi"; \
475 echo ""; \
476 echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
477 echo ""; \
478 echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
437 ) > $@ 479 ) > $@
438 $(QUIETLY) chmod +x $@ 480 $(QUIETLY) chmod +x $@
439 481
440 FORCE: 482 FORCE:
441 483