package/libcdio: bump version to 0.94
[buildroot-gz.git] / support / scripts / fix-configure-powerpc64.sh
blobad710422a5f4fc1337d44eaa05f19996329b2f65
1 #!/bin/bash
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
10 # undefined symbols.
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.
15 set -e
17 if [ $# -ne 1 ]; then
18 echo "Usage: $0 <package build directory>"
19 exit 2
22 srcdir="$1"
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.
29 for c in $files; do
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 @@
34 x86_64-*linux*)
35 LD="${LD-ld} -m elf_x86_64"
37 - ppc*-*linux*|powerpc*-*linux*)
38 + powerpcle-*linux*)
39 + LD="${LD-ld} -m elf64lppc"
40 + ;;
41 + powerpc-*linux*)
42 LD="${LD-ld} -m elf64ppc"
44 s390*-*linux*)
45 EOF
46 done