3 # This is a script to find, and correct, a problem with old versions of
4 # configure that affect powerpc64 and powerpc64le.
6 # The issue causes configure to incorrectly determine that shared library
7 # support is not present in the linker. This causes the package to build a
8 # static library rather than a dynamic one and although the build will succeed,
9 # it may cause packages that link with the static library it to fail due to
12 # This script searches for files named 'configure' that appear to have this
13 # issue (by searching for a known bad pattern) and patching them.
18 echo "Usage: $0 <package build directory>"
23 files
=$
(cd "$srcdir" && find .
-name configure \
24 -exec grep -qF 'Generated by GNU Autoconf' {} \
; \
25 -exec grep -qF 'ppc*-*linux*|powerpc*-*linux*)' {} \
; -print)
27 # --ignore-whitespace is needed because some packages have included
28 # copies of configure scripts where tabs have been replaced with spaces.
30 patch --ignore-whitespace "$srcdir"/"$c" <<'EOF'
31 --- a/configure 2016-11-16 15:31:46.097447271 +1100
32 +++ b/configure 2008-07-21 12:17:23.000000000 +1000
33 @@ -4433,7 +4433,10 @@
35 LD="${LD-ld} -m elf_x86_64"
37 - ppc*-*linux*|powerpc*-*linux*)
39 + LD="${LD-ld} -m elf64lppc"
42 LD="${LD-ld} -m elf64ppc"