Skip to content

Commit 3bbc5d8

Browse files
author
Matthias Koeppe
committed
build/pkgs/python3/spkg-build.in: Set rpath
1 parent 2101b8c commit 3bbc5d8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build/pkgs/python3/spkg-build.in

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,18 @@ sdh_configure --enable-shared $PYTHON_CONFIGURE
9090
# we need to provide paths into $SAGE_LOCAL, so that setup.py finds
9191
# the libraries needed for the extension modules - in particular sqlite3.
9292
# (The search code there does not know about CPATH and LIBRARY_PATH.)
93-
sdh_make LDFLAGS="-L. -L$SAGE_LOCAL/lib $LDFLAGS" CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
93+
make_LDFLAGS="-L. -L$SAGE_LOCAL/lib $LDFLAGS"
94+
make_CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
95+
96+
# Also, we need to add an rpath, like we do for SAGE_LOCAL in src/bin/sage-env.
97+
# SAGE_INST_LOCAL is the installation hierarchy for the current package
98+
# -- for python3, this is SAGE_VENV.
99+
make_LDFLAGS="-Wl,-rpath,$SAGE_INST_LOCAL/lib $make_LDFLAGS"
100+
if [ "$UNAME" = "Linux" ]; then
101+
make_LDFLAGS="-Wl,-rpath-link,$SAGE_INST_LOCAL/lib $make_LDFLAGS"
102+
fi
103+
104+
sdh_make LDFLAGS="$make_LDFLAGS" CPPFLAGS="$make_CPPFLAGS"
94105

95106
if [ "$UNAME" = "Darwin" ]; then
96107
export DYLD_LIBRARY_PATH="."

0 commit comments

Comments
 (0)