[Libwebsockets] [libwebsockets] #27: dynamic library needs full path in install name

Trac trac at libwebsockets.org
Sat Apr 13 00:33:27 CEST 2013


#27: dynamic library needs full path in install name
-----------------------------------+--------------------
 Reporter:  thinkski               |      Owner:  agreen
     Type:  defect                 |     Status:  new
 Priority:  major                  |  Milestone:
Component:  libwebsockets library  |    Version:
 Keywords:                         |
-----------------------------------+--------------------
 On some systems, notably OS X, dynamic libraries need the full path in the
 install name. Linking against the library will work, but the executable
 will fail to find library at runtime (i.e. otool -L on executable shows
 libwebsockets.dylib without a path specification and fails to find it).
 The following patch fixes the issue:
 {{{
 --- CMakeLists.txt.orig 2013-04-12 11:10:53.000000000 -0400
 +++ CMakeLists.txt      2013-04-12 13:23:40.000000000 -0400
 @@ -145,6 +145,10 @@
  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

 +# Put absolute path of dynamic libraries into the object code. Some
 +# architectures, notably Mac OS X, need this.
 +SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
 +
  # So we can include the CMake generated config file only when
  # building with CMAKE.
  add_definitions(-DCMAKE_BUILD)
 }}}

-- 
Ticket URL: <http://libwebsockets.org/trac/ticket/27>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list