< prev index next >

make/autoconf/lib-std.m4

Print this page
rev 47445 : 8171853: Remove Shark compiler


  48     # Test if stdc++ can be linked statically.
  49     AC_MSG_CHECKING([if static link of stdc++ is possible])
  50     STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc"
  51     AC_LANG_PUSH(C++)
  52     OLD_LIBS="$LIBS"
  53     LIBS="$STATIC_STDCXX_FLAGS"
  54     AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
  55         [has_static_libstdcxx=yes],
  56         [has_static_libstdcxx=no])
  57     LIBS="$OLD_LIBS"
  58     AC_LANG_POP(C++)
  59     AC_MSG_RESULT([$has_static_libstdcxx])
  60 
  61     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
  62       AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
  63     fi
  64 
  65     # If dynamic was requested, it's available since it would fail above otherwise.
  66     # If dynamic wasn't requested, go with static unless it isn't available.
  67     AC_MSG_CHECKING([how to link with libstdc++])
  68     if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno \
  69         || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
  70       AC_MSG_RESULT([dynamic])
  71     else
  72       LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
  73       JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
  74       # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
  75       # just use the same setting as for the TARGET toolchain.
  76       OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
  77       AC_MSG_RESULT([static])
  78     fi
  79   fi
  80 
  81   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
  82   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
  83     LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
  84   fi
  85 
  86   AC_SUBST(LIBCXX)
  87 
  88   # Setup Windows runtime dlls
  89   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then


  48     # Test if stdc++ can be linked statically.
  49     AC_MSG_CHECKING([if static link of stdc++ is possible])
  50     STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc"
  51     AC_LANG_PUSH(C++)
  52     OLD_LIBS="$LIBS"
  53     LIBS="$STATIC_STDCXX_FLAGS"
  54     AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
  55         [has_static_libstdcxx=yes],
  56         [has_static_libstdcxx=no])
  57     LIBS="$OLD_LIBS"
  58     AC_LANG_POP(C++)
  59     AC_MSG_RESULT([$has_static_libstdcxx])
  60 
  61     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
  62       AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
  63     fi
  64 
  65     # If dynamic was requested, it's available since it would fail above otherwise.
  66     # If dynamic wasn't requested, go with static unless it isn't available.
  67     AC_MSG_CHECKING([how to link with libstdc++])
  68     if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno ; then

  69       AC_MSG_RESULT([dynamic])
  70     else
  71       LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
  72       JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
  73       # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
  74       # just use the same setting as for the TARGET toolchain.
  75       OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
  76       AC_MSG_RESULT([static])
  77     fi
  78   fi
  79 
  80   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
  81   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
  82     LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
  83   fi
  84 
  85   AC_SUBST(LIBCXX)
  86 
  87   # Setup Windows runtime dlls
  88   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
< prev index next >