On 10/28/23 05:28, Jason Bacon wrote:
On 10/28/23 01:33, Manuel Kuklinski wrote:Am Freitag 27 Oktober 2023 um 5:11:54 -0700, schrieb Jason Bacon 2,4K:Always happy to help out a hard-working maintainer... The "missing run-time search paths" makes me suspect it's in need of -install_name in the link command. Another way macOS is "special". Here's an example of how building dylibs differs from BSD/Linux shared objects: https://github.com/outpaddling/libxtend/blob/main/MakefileHi Jason, your Makefile makes sense, while cmake is hard to chew on :-( I made some progress, I guess...? - - - - - - - - - - %< - - - - - - - - - - $NetBSD: patch-CMakeLists.txt,v 1.1 2022/04/01 10:43:05 nia Exp $ Not every unix system has libdl. --- CMakeLists.txt.orig 2022-03-03 14:56:56.000000000 +0000 +++ CMakeLists.txt @@ -74,7 +74,7 @@ if(UNIX AND NOT APPLE) target_link_libraries(SDL PRIVATE dl) endif() if(APPLE) - set_target_properties(SDL PROPERTIES INSTALL_NAME_DIR "")+ set_target_properties(SDL PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}") set_target_properties(SDL PROPERTIES COMPILE_DEFINITIONS "_THREAD_SAFE")set_target_properties(SDL PROPERTIES LINK_FLAGS"-Wl,-compatibility_version,${DYLIB_COMPAT_VERSION} -Wl,-current_version,${DYLIB_CURRENT_VERSION}")- - - - - - - - - - %< - - - - - - - - - - - - - - - - - - - - %< - - - - - - - - - - => Checking for missing run-time search paths in sdl12-compat-1.2.52nb3ERROR: lib/libSDL-1.2.0.dylib: relative library path: lib/libSDL-1.2.0.dylib*** Error code 1 Stop. bmake[1]: stopped in /Users/mk/pkgsrc/devel/sdl12-compat *** Error code 1 Stop. bmake: stopped in /Users/mk/pkgsrc/devel/sdl12-compat - - - - - - - - - - %< - - - - - - - - - - Now I don't now again, what to do with the "relative library path"... Kind regards.You can always do a post-configure (or later) patch to test the concept, if that's easier. Ultimately, fixing the cmake scripts would be desirable, but no point wasting time banging your head on that just to find out it's not the solution. First verify what needs to be done, then move it to an earlier stage if possible.
I found the problem, but not the cause:
Running
otool -l work/.destdir/Users/bacon/Pkgsrc/pkg/lib/libSDL-1.2.0.dylib
shows the following:
cmd LC_ID_DYLIB
cmdsize 48
name libSDL-1.2.0.dylib (offset 24)
time stamp 1 Wed Dec 31 18:00:01 1969
current version 12.52.0
compatibility version 1.0.0
The name field should show an absolute pathname starting with ${PREFIX},
like this:
cmd LC_ID_DYLIB
cmdsize 72
name /Users/bacon/Pkgsrc/pkg/lib/libxtend.2.dylib (offset 24)
time stamp 1 Wed Dec 31 18:00:01 1969
current version 2.0.0
compatibility version 2.0.0
I thought the problem was that cmake is generating a link.txt using
@rpath, which is problematic, so I added the following:
SUBST_CLASSES+= install_name
SUBST_STAGE.install_name= post-configure
SUBST_FILES.install_name= CMakeFiles/SDL.dir/link.txt
SUBST_SED.install_name= -e 's|@rpath|${PREFIX}/lib|g'
Then set CMAKE_VERBOSE=on and verified that the link command in the
terminal output contains:
-install_name /Users/bacon/Pkgsrc/pkg/lib/libSDL-1.2.0.dylib But the error still occurs and otool still shows the relative pathname.I'm going to sleep on this, but I added wip/sdl12-compat with these changes in case another set of eyes will spot the problem.