rpath
This commit is contained in:
parent
3b7f72c8b3
commit
646773f574
13
functions.sh
13
functions.sh
@ -203,7 +203,7 @@ function pack_static_lib {
|
|||||||
local outfile="$1"
|
local outfile="$1"
|
||||||
myprint "${BLUE}outfile: ${GRAY}$outfile"
|
myprint "${BLUE}outfile: ${GRAY}$outfile"
|
||||||
|
|
||||||
local objects="$(find $OBJDIR/objects -type f,l | tr '\n' ' ')"
|
local objects=$(find $OBJDIR/objects -type f,l | tr '\n' ' ')
|
||||||
myprint "${BLUE}objects: ${GRAY}$objects"
|
myprint "${BLUE}objects: ${GRAY}$objects"
|
||||||
if [ -z "$objects" ]; then
|
if [ -z "$objects" ]; then
|
||||||
error "no compiled objects found"
|
error "no compiled objects found"
|
||||||
@ -227,20 +227,21 @@ function link {
|
|||||||
myprint "${BLUE}args: ${GRAY}$args"
|
myprint "${BLUE}args: ${GRAY}$args"
|
||||||
myprint "${BLUE}outfile: ${GRAY}$outfile"
|
myprint "${BLUE}outfile: ${GRAY}$outfile"
|
||||||
|
|
||||||
local objects="$(find $OBJDIR/objects -type f,l | tr '\n' ' ')"
|
local objects=$(find $OBJDIR/objects -type f,l | tr '\n' ' ')
|
||||||
myprint "${BLUE}objects: ${GRAY}$objects"
|
myprint "${BLUE}objects: ${GRAY}$objects"
|
||||||
if [ -z "$objects" ]; then
|
if [ -z "$objects" ]; then
|
||||||
error "no compiled objects found"
|
error "no compiled objects found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local static_libs="$(find $OBJDIR/static_libs -type f,l | tr '\n' ' ')"
|
local static_libs=$(find $OBJDIR/static_libs -type f,l | tr '\n' ' ')
|
||||||
myprint "${BLUE}static libraries: ${GRAY}$static_libs"
|
myprint "${BLUE}static libraries: ${GRAY}$static_libs"
|
||||||
|
|
||||||
local dynamic_libs="$(find $OBJDIR/dynamic_libs -type f,l | tr '\n' ' ')"
|
local dynamic_libs=$(find $OBJDIR/dynamic_libs -type f,l | tr '\n' ' '\
|
||||||
|
| sed "s,$OBJDIR/dynamic_libs/,,g")
|
||||||
myprint "${BLUE}dynamic libraries: ${GRAY}$dynamic_libs"
|
myprint "${BLUE}dynamic libraries: ${GRAY}$dynamic_libs"
|
||||||
local dynamic_libs_args="-L. -Wl,-Bdynamic"
|
local dynamic_libs_args="-L./$OBJDIR/dynamic_libs -Wl,-Bdynamic"
|
||||||
for lib in $dynamic_libs; do
|
for lib in $dynamic_libs; do
|
||||||
dynamic_libs_args="$dynamic_libs_args -l:$lib"
|
dynamic_libs_args="$dynamic_libs_args -Wl,-rpath=$(dirname $lib) -l:$lib"
|
||||||
done
|
done
|
||||||
|
|
||||||
local command="$CMP_CPP $objects $static_libs $args $dynamic_libs_args -o $OUTDIR/$outfile"
|
local command="$CMP_CPP $objects $static_libs $args $dynamic_libs_args -o $OUTDIR/$outfile"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user