685 fi |
685 fi |
686 |
686 |
687 AC_MSG_CHECKING([how to link with libstdc++]) |
687 AC_MSG_CHECKING([how to link with libstdc++]) |
688 # If dynamic was requested, it's available since it would fail above otherwise. |
688 # If dynamic was requested, it's available since it would fail above otherwise. |
689 # If dynamic wasn't requested, go with static unless it isn't available. |
689 # If dynamic wasn't requested, go with static unless it isn't available. |
690 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno; then |
690 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
691 LIBCXX="$LIBCXX -lstdc++" |
691 LIBCXX="$LIBCXX -lstdc++" |
692 LDCXX="$CXX" |
692 LDCXX="$CXX" |
693 STATIC_CXX_SETTING="STATIC_CXX=false" |
693 STATIC_CXX_SETTING="STATIC_CXX=false" |
694 AC_MSG_RESULT([dynamic]) |
694 AC_MSG_RESULT([dynamic]) |
695 else |
695 else |
699 AC_MSG_RESULT([static]) |
699 AC_MSG_RESULT([static]) |
700 fi |
700 fi |
701 fi |
701 fi |
702 AC_SUBST(STATIC_CXX_SETTING) |
702 AC_SUBST(STATIC_CXX_SETTING) |
703 |
703 |
|
704 if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
|
705 # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS |
|
706 PKG_CHECK_MODULES([LIBFFI], [libffi]) |
|
707 |
|
708 fi |
|
709 |
|
710 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
|
711 AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) |
|
712 |
|
713 if test "x$LLVM_CONFIG" != xllvm-config; then |
|
714 AC_MSG_ERROR([llvm-config not found in $PATH.]) |
|
715 fi |
|
716 |
|
717 llvm_components="jit mcjit engine nativecodegen native" |
|
718 unset LLVM_CFLAGS |
|
719 for flag in $("$LLVM_CONFIG" --cxxflags); do |
|
720 if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then |
|
721 if test "${flag}" != "-D_DEBUG" ; then |
|
722 if test "${LLVM_CFLAGS}" != "" ; then |
|
723 LLVM_CFLAGS="${LLVM_CFLAGS} " |
|
724 fi |
|
725 LLVM_CFLAGS="${LLVM_CFLAGS}${flag}" |
|
726 fi |
|
727 fi |
|
728 done |
|
729 llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//') |
|
730 LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}" |
|
731 |
|
732 unset LLVM_LDFLAGS |
|
733 for flag in $("${LLVM_CONFIG}" --ldflags); do |
|
734 if echo "${flag}" | grep -q '^-L'; then |
|
735 if test "${LLVM_LDFLAGS}" != ""; then |
|
736 LLVM_LDFLAGS="${LLVM_LDFLAGS} " |
|
737 fi |
|
738 LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}" |
|
739 fi |
|
740 done |
|
741 |
|
742 unset LLVM_LIBS |
|
743 for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do |
|
744 if echo "${flag}" | grep -q '^-l'; then |
|
745 if test "${LLVM_LIBS}" != ""; then |
|
746 LLVM_LIBS="${LLVM_LIBS} " |
|
747 fi |
|
748 LLVM_LIBS="${LLVM_LIBS}${flag}" |
|
749 fi |
|
750 done |
|
751 |
|
752 AC_SUBST(LLVM_CFLAGS) |
|
753 AC_SUBST(LLVM_LDFLAGS) |
|
754 AC_SUBST(LLVM_LIBS) |
|
755 fi |
|
756 |
704 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) |
757 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) |
705 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then |
758 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then |
706 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" |
759 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" |
707 fi |
760 fi |
708 |
761 |