From f61fbd356dff9ab0bef90861a9233e69205b2fce Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 13 Nov 2016 11:55:43 -0800 Subject: [PATCH] Set rpath on deploy-stub to $ORIGIN for Linux builds This allows game runtimes to search their directory for shared libraries instead of needing to use LD_LIBRARY_PATH. --- makepanda/makepanda.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 92a93d21fd..2302e177a2 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6303,8 +6303,12 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): if True: # TODO OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB', 'PYTHON'] TargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c') + if GetTarget() == 'linux': + # Setup rpath so libs can be found in the same directory as the deployed game + LibName('DEPLOYSTUB', "-Wl,-rpath,\$ORIGIN") + LibName('DEPLOYSTUB', "-Wl,-z,origin") TargetAdd('deploy-stub.exe', input='deploy-stub.obj') - TargetAdd('deploy-stub.exe', opts=['PYTHON']) + TargetAdd('deploy-stub.exe', opts=['PYTHON', 'DEPLOYSTUB']) # # Generate the models directory and samples directory