Mercurial > hg > graal-jvmci-8
comparison make/solaris/makefiles/buildtree.make @ 4846: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 | 95009f678859 |
children | 7292cff45988 d652a62d6e03 |
comparison
equal
deleted
inserted
replaced
4843:d6660fedbab5 | 4846:e8a4934564b2 |
---|---|
116 | 116 |
117 # For dependencies and recursive makes. | 117 # For dependencies and recursive makes. |
118 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make | 118 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make |
119 | 119 |
120 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ | 120 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ |
121 env.ksh env.csh jdkpath.sh .dbxrc test_gamma | 121 env.sh env.csh jdkpath.sh .dbxrc test_gamma |
122 | 122 |
123 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ | 123 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ |
124 ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) | 124 ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) |
125 | 125 |
126 # Define variables to be set in flags.make. | 126 # Define variables to be set in flags.make. |
311 echo include flags.make; \ | 311 echo include flags.make; \ |
312 echo; \ | 312 echo; \ |
313 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | 313 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ |
314 ) > $@ | 314 ) > $@ |
315 | 315 |
316 env.ksh: $(BUILDTREE_MAKE) | 316 env.sh: $(BUILDTREE_MAKE) |
317 @echo Creating $@ ... | 317 @echo Creating $@ ... |
318 $(QUIETLY) ( \ | 318 $(QUIETLY) ( \ |
319 $(BUILDTREE_COMMENT); \ | 319 $(BUILDTREE_COMMENT); \ |
320 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ | 320 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ |
321 { \ | 321 { \ |
322 echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \ | |
323 echo "unset LD_LIBRARY_PATH_32"; \ | |
324 echo "unset LD_LIBRARY_PATH_64"; \ | |
325 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ | 322 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ |
326 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ | 323 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ |
327 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ | 324 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ |
328 echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ | 325 echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ |
329 ) > $@ | 326 ) > $@ |
330 | 327 |
331 env.csh: env.ksh | 328 env.csh: env.sh |
332 @echo Creating $@ ... | 329 @echo Creating $@ ... |
333 $(QUIETLY) ( \ | 330 $(QUIETLY) ( \ |
334 $(BUILDTREE_COMMENT); \ | 331 $(BUILDTREE_COMMENT); \ |
335 [ -n "$$JAVA_HOME" ] && \ | 332 [ -n "$$JAVA_HOME" ] && \ |
336 { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \ | 333 { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \ |
382 | 379 |
383 JAVA_FLAG/32 = -d32 | 380 JAVA_FLAG/32 = -d32 |
384 JAVA_FLAG/64 = -d64 | 381 JAVA_FLAG/64 = -d64 |
385 | 382 |
386 WRONG_DATA_MODE_MSG = \ | 383 WRONG_DATA_MODE_MSG = \ |
387 echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." | 384 echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK." |
385 | |
386 CROSS_COMPILING_MSG = \ | |
387 echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run." | |
388 | 388 |
389 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java | 389 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java |
390 @echo Creating $@ ... | 390 @echo Creating $@ ... |
391 $(QUIETLY) ( \ | 391 $(QUIETLY) ( \ |
392 echo '#!/bin/ksh'; \ | 392 echo "#!/bin/sh"; \ |
393 $(BUILDTREE_COMMENT); \ | 393 echo ""; \ |
394 echo '. ./env.ksh'; \ | 394 $(BUILDTREE_COMMENT); \ |
395 echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ | 395 echo ""; \ |
396 echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ | 396 echo "# Include environment settings for gamma run"; \ |
397 echo "then"; \ | 397 echo ""; \ |
398 echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ | 398 echo ". ./env.sh"; \ |
399 echo "fi"; \ | 399 echo ""; \ |
400 echo "# Do not run gamma test for cross compiles"; \ | |
401 echo ""; \ | |
402 echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \ | |
403 echo " $(CROSS_COMPILING_MSG)"; \ | |
404 echo " exit 0"; \ | |
405 echo "fi"; \ | |
406 echo ""; \ | |
407 echo "# Make sure JAVA_HOME is set as it is required for gamma"; \ | |
408 echo ""; \ | |
409 echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \ | |
410 echo " $(NO_JAVA_HOME_MSG)"; \ | |
411 echo " exit 0"; \ | |
412 echo "fi"; \ | |
413 echo ""; \ | |
414 echo "# Check JAVA_HOME version to be used for the test"; \ | |
415 echo ""; \ | |
416 echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \ | |
417 echo "if [ \$$? -ne 0 ]; then "; \ | |
418 echo " $(WRONG_DATA_MODE_MSG)"; \ | |
419 echo " exit 0"; \ | |
420 echo "fi"; \ | |
421 echo ""; \ | |
422 echo "# Use gamma_g if it exists"; \ | |
423 echo ""; \ | |
424 echo "GAMMA_PROG=gamma"; \ | |
425 echo "if [ -f gamma_g ]; then "; \ | |
426 echo " GAMMA_PROG=gamma_g"; \ | |
427 echo "fi"; \ | |
428 echo ""; \ | |
429 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \ | |
430 echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \ | |
431 echo " # NOTE: gamma assumes the OpenJDK directory layout."; \ | |
432 echo ""; \ | |
433 echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \ | |
434 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \ | |
435 echo " if [ ! -f \$${JVM_LIB} ]; then"; \ | |
436 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \ | |
437 echo " fi"; \ | |
438 echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \ | |
439 echo " $(WRONG_DATA_MODE_MSG)"; \ | |
440 echo " exit 0"; \ | |
441 echo " fi"; \ | |
442 echo "fi"; \ | |
443 echo ""; \ | |
444 echo "# Compile Queens program for test"; \ | |
445 echo ""; \ | |
400 echo "rm -f Queens.class"; \ | 446 echo "rm -f Queens.class"; \ |
401 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ | 447 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ |
402 echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ | 448 echo ""; \ |
403 echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ | 449 echo "# Set library path solely for gamma launcher test run"; \ |
450 echo ""; \ | |
451 echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \ | |
452 echo "export LD_LIBRARY_PATH"; \ | |
453 echo "unset LD_LIBRARY_PATH_32"; \ | |
454 echo "unset LD_LIBRARY_PATH_64"; \ | |
455 echo ""; \ | |
456 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \ | |
457 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}"; \ | |
458 echo " export DYLD_LIBRARY_PATH"; \ | |
459 echo "fi"; \ | |
460 echo ""; \ | |
461 echo "# Use the gamma launcher and JAVA_HOME to run the test"; \ | |
462 echo ""; \ | |
463 echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \ | |
404 ) > $@ | 464 ) > $@ |
405 $(QUIETLY) chmod +x $@ | 465 $(QUIETLY) chmod +x $@ |
406 | 466 |
407 FORCE: | 467 FORCE: |
408 | 468 |