./common/autoconf/libraries.m4

Print this page
rev 659 : imported patch zero-newbuild


 670     LIBS="$OLD_LIBS"
 671     CXX="$OLD_CXX"
 672     AC_LANG_POP(C++)
 673     AC_MSG_RESULT([$has_static_libstdcxx])
 674 
 675     if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
 676         AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
 677     fi
 678 
 679     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
 680         AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
 681     fi
 682 
 683     if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
 684         AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
 685     fi
 686 
 687     AC_MSG_CHECKING([how to link with libstdc++])
 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.
 690     if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno; then
 691         LIBCXX="$LIBCXX -lstdc++"
 692         LDCXX="$CXX"
 693         STATIC_CXX_SETTING="STATIC_CXX=false"
 694         AC_MSG_RESULT([dynamic])
 695     else
 696         LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
 697         LDCXX="$CC"
 698         STATIC_CXX_SETTING="STATIC_CXX=true"
 699         AC_MSG_RESULT([static])
 700     fi
 701 fi
 702 AC_SUBST(STATIC_CXX_SETTING)





















































 703 
 704 # 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
 706     LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
 707 fi
 708 
 709 # TODO better (platform agnostic) test
 710 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
 711     LIBCXX="-lstdc++"
 712 fi
 713 
 714 AC_SUBST(LIBCXX)
 715 
 716 ])


 670     LIBS="$OLD_LIBS"
 671     CXX="$OLD_CXX"
 672     AC_LANG_POP(C++)
 673     AC_MSG_RESULT([$has_static_libstdcxx])
 674 
 675     if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
 676         AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
 677     fi
 678 
 679     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
 680         AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
 681     fi
 682 
 683     if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
 684         AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
 685     fi
 686 
 687     AC_MSG_CHECKING([how to link with libstdc++])
 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.
 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++"
 692         LDCXX="$CXX"
 693         STATIC_CXX_SETTING="STATIC_CXX=false"
 694         AC_MSG_RESULT([dynamic])
 695     else
 696         LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
 697         LDCXX="$CC"
 698         STATIC_CXX_SETTING="STATIC_CXX=true"
 699         AC_MSG_RESULT([static])
 700     fi
 701 fi
 702 AC_SUBST(STATIC_CXX_SETTING)
 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 
 757 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
 758 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
 759     LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
 760 fi
 761 
 762 # TODO better (platform agnostic) test
 763 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
 764     LIBCXX="-lstdc++"
 765 fi
 766 
 767 AC_SUBST(LIBCXX)
 768 
 769 ])