[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] #1797829: Trouble finding libs when using PREFIX



Since the bugtracker on SF looks pretty inactive, I thought I'd drop a
message here about my bugreport:

https://sourceforge.net/tracker/index.php?func=detail&aid=1797829&group_id=54622&atid=474248


This is the report:

Trouble finding libs when using PREFIX
======================================

When building SuperCollider, I tried to use a PREFIX that's in my
homedirectory, like so:

PREFIX = '/home/daniel/lib/supercollider'

Turns out that the binaries that are copied to $PREFIX/bin aren't linked in
a way to find the libraries in $PREFIX/lib. The attached patch to
SConstruct has the binaries look in the right place when they're run.
Index: SConstruct
===================================================================
--- SConstruct	(revision 6273)
+++ SConstruct	(working copy)
@@ -586,7 +586,9 @@
                '#Headers/server'],
     CPPDEFINES = [('SC_PLUGIN_DIR', '\\"' + pkg_lib_dir(FINAL_PREFIX, 'plugins') + '\\"'), ('SC_PLUGIN_EXT', '\\"' + PLUGIN_EXT + '\\"')],
     LIBS = ['common', 'pthread', 'dl'],
-    LIBPATH = 'build')
+    LIBPATH = 'build',
+    LINKFLAGS = '-Wl,-rpath,' + INSTALL_PREFIX + '/lib'
+    )
 libscsynthEnv = serverEnv.Copy(
     PKGCONFIG_NAME = 'libscsynth',
     PKGCONFIG_DESC = 'SuperCollider synthesis server library',
@@ -777,7 +779,7 @@
 	LINKFLAGS = '-framework CoreServices')
 elif PLATFORM == 'linux':
     langEnv.Append(
-	LINKFLAGS = '-Wl,-rpath,build')
+        LINKFLAGS = '-Wl,-rpath,build -Wl,-rpath,' + INSTALL_PREFIX + '/lib')
 
 merge_lib_info(langEnv, libraries['audioapi'])