Linking against a new shared library file

David Holmes david.holmes at oracle.com
Thu Mar 30 01:00:16 UTC 2017


On 30/03/2017 7:53 AM, Wade Hennessey wrote:
> I'm trying to figure out how to link libjvm against a shared library that
> isn't linked against by default. Where in the build system would I specify
> this new library path? -wade

Assuming JDK 9.

<top>/common/autoconf/flags.m4

See JVM_LIBS setting eg:


   # Set $2JVM_LIBS (per os)
   if test "x$OPENJDK_$1_OS" = xlinux; then
     $2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread"
   elif test "x$OPENJDK_$1_OS" = xsolaris; then
     # FIXME: This hard-coded path is not really proper.
     if test "x$OPENJDK_$1_CPU" = xx86_64; then
       $2SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1"
     elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
       $2SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1"
     fi
     $2JVM_LIBS="[$]$2JVM_LIBS -lsocket -lsched -ldl $SOLARIS_LIBM_LIBS 
-lCrun \
         -lthread -ldoor -lc -ldemangle -lnsl -lkstat -lrt"

   ...

David








More information about the build-dev mailing list