commit:     b81cd60acf8b5b8465c4849719259321b99e6467
Author:     hsk17 <hsk17 <AT> mail <DOT> de>
AuthorDate: Wed Mar  6 12:23:03 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Mar  6 12:23:03 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b81cd60a

scripts/bootstrap-prefix: unify libffi behaviour in bootstrap_gnu

due to commit 94a0ab4f, which adds -L${ROOT}/tmp/usr/lib64 to LDFLAGS
in bootstrap_python(), the python bootstrap build sees libffi.so and
succeeds.  but there is no -Wl,-rpath,${ROOT}/tmp/usr/lib64, and the
built _ctypes.so is unusable as the run time loader does not find
libffi.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 1998896349..70863e2396 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -813,20 +813,22 @@ bootstrap_gnu() {
        # SuSE 11.1 has GNU binutils-2.20, choking on crc32_x86
        [[ ${PN} == "xz" ]] && myconf="${myconf} --disable-assembler"
 
-       # we do not have pkg-config to find lib/libffi-*/include/ffi.h
-       [[ ${PN} == "libffi" ]] && 
-       sed -i -e '/includesdir =/s/=.*/= $(includedir)/' include/Makefile.in
-
-       # we have to build the libraries for correct bitwidth
-       [[ " libffi " == *" ${PN} "* ]] &&
-       case $CHOST in
-       (x86_64-*-*|sparcv9-*-*)
-               export CFLAGS="-m64"
-               ;;
-       (i?86-*-*)
-               export CFLAGS="-m32"
-               ;;
-       esac
+       if [[ ${PN} == "libffi" ]] ; then
+               # we do not have pkg-config to find lib/libffi-*/include/ffi.h
+               sed -i -e '/includesdir =/s/=.*/= $(includedir)/' 
include/Makefile.in
+               # force install into libdir
+               myconf="${myconf} --libdir=${ROOT}/tmp/usr/lib"
+               sed -i -e '/toolexeclibdir =/s/=.*/= $(libdir)/' Makefile.in
+               # we have to build the libraries for correct bitwidth
+               case $CHOST in
+               (x86_64-*-*|sparcv9-*-*)
+                       export CFLAGS="-m64"
+                       ;;
+               (i?86-*-*)
+                       export CFLAGS="-m32"
+                       ;;
+               esac
+       fi
 
        einfo "Compiling ${PN}"
        econf ${myconf} || return 1
@@ -979,7 +981,7 @@ EOP
        # python refuses to find the zlib headers that are built in the offset,
        # same for libffi, which installs into compiler's multilib-osdir
        export CPPFLAGS="-I${ROOT}/tmp/usr/include"
-       export LDFLAGS="${CFLAGS} -L${ROOT}/tmp/usr/lib -L${ROOT}/tmp/usr/lib64"
+       export LDFLAGS="${CFLAGS} -L${ROOT}/tmp/usr/lib"
        # set correct flags for runtime for ELF platforms
        case $CHOST in
                *-linux*)

Reply via email to