645 LIBS="$OLD_LIBS"
646 CXX="$OLD_CXX"
647 AC_LANG_POP(C++)
648 AC_MSG_RESULT([$has_static_libstdcxx])
649
650 if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
651 AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
652 fi
653
654 if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
655 AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
656 fi
657
658 if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
659 AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
660 fi
661
662 AC_MSG_CHECKING([how to link with libstdc++])
663 # If dynamic was requested, it's available since it would fail above otherwise.
664 # If dynamic wasn't requested, go with static unless it isn't available.
665 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno; then
666 LIBCXX="$LIBCXX -lstdc++"
667 LDCXX="$CXX"
668 STATIC_CXX_SETTING="STATIC_CXX=false"
669 AC_MSG_RESULT([dynamic])
670 else
671 LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
672 LDCXX="$CC"
673 STATIC_CXX_SETTING="STATIC_CXX=true"
674 AC_MSG_RESULT([static])
675 fi
676 fi
677 AC_SUBST(STATIC_CXX_SETTING)
678
679 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
680 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
681 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
682 fi
683
684 # TODO better (platform agnostic) test
685 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
686 LIBCXX="-lstdc++"
687 fi
688
689 AC_SUBST(LIBCXX)
690
691 ])
|
645 LIBS="$OLD_LIBS"
646 CXX="$OLD_CXX"
647 AC_LANG_POP(C++)
648 AC_MSG_RESULT([$has_static_libstdcxx])
649
650 if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
651 AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
652 fi
653
654 if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
655 AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
656 fi
657
658 if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
659 AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
660 fi
661
662 AC_MSG_CHECKING([how to link with libstdc++])
663 # If dynamic was requested, it's available since it would fail above otherwise.
664 # If dynamic wasn't requested, go with static unless it isn't available.
665 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
666 LIBCXX="$LIBCXX -lstdc++"
667 LDCXX="$CXX"
668 STATIC_CXX_SETTING="STATIC_CXX=false"
669 AC_MSG_RESULT([dynamic])
670 else
671 LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
672 LDCXX="$CC"
673 STATIC_CXX_SETTING="STATIC_CXX=true"
674 AC_MSG_RESULT([static])
675 fi
676 fi
677 AC_SUBST(STATIC_CXX_SETTING)
678
679 if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
680 # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
681 PKG_CHECK_MODULES([LIBFFI], [libffi])
682
683 fi
684
685 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
686 AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config])
687
688 if test "x$LLVM_CONFIG" != xllvm-config; then
689 AC_MSG_ERROR([llvm-config not found in $PATH.])
690 fi
691
692 llvm_components="jit mcjit engine nativecodegen native"
693 unset LLVM_CFLAGS
694 for flag in $("$LLVM_CONFIG" --cxxflags); do
695 if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then
696 if test "${flag}" != "-D_DEBUG" ; then
697 if test "${LLVM_CFLAGS}" != "" ; then
698 LLVM_CFLAGS="${LLVM_CFLAGS} "
699 fi
700 LLVM_CFLAGS="${LLVM_CFLAGS}${flag}"
701 fi
702 fi
703 done
704 llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//')
705 LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}"
706
707 unset LLVM_LDFLAGS
708 for flag in $("${LLVM_CONFIG}" --ldflags); do
709 if echo "${flag}" | grep -q '^-L'; then
710 if test "${LLVM_LDFLAGS}" != ""; then
711 LLVM_LDFLAGS="${LLVM_LDFLAGS} "
712 fi
713 LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}"
714 fi
715 done
716
717 unset LLVM_LIBS
718 for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do
719 if echo "${flag}" | grep -q '^-l'; then
720 if test "${LLVM_LIBS}" != ""; then
721 LLVM_LIBS="${LLVM_LIBS} "
722 fi
723 LLVM_LIBS="${LLVM_LIBS}${flag}"
724 fi
725 done
726
727 AC_SUBST(LLVM_CFLAGS)
728 AC_SUBST(LLVM_LDFLAGS)
729 AC_SUBST(LLVM_LIBS)
730 fi
731
732 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
733 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
734 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
735 fi
736
737 # TODO better (platform agnostic) test
738 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
739 LIBCXX="-lstdc++"
740 fi
741
742 AC_SUBST(LIBCXX)
743
744 ])
|