summaryrefslogtreecommitdiffstats
path: root/patches/02_fix-opcodes-configure-bfd-version-on-busybox-ash.patch
blob: a2672cc5774b48b06521419688864487b8f00a6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Author: "P. J. McDermott" <pjm@nac.net>
Subject: Fix opcodes/configure (BFD_VERSION) on BusyBox ash

Commit c4dd807 in binutils-gdb.git somehow broke opcodes/configure on ash:

    mkdir ./opcodes
    Configuring in ./opcodes
    configure: creating cache ./config.cache
    [...]
    /usr/src/gdb_7.6.1+sip1-1/tmp/src/opcodes/configure: .: line 12678: can't open '/usr/src/gdb_7.6.1+sip1-1/tmp/src/opcodes/configure.host'

I'm not sure why this happens, but I suspect _AS_LINENO_PREPARE is involved
here.

For now, we'll avoid this issue by reverting to pre-c4dd807 behavior, updated to
use AC_INIT.

diff -Naur src.orig/opcodes/configure src/opcodes/configure
--- src.orig/opcodes/configure	2013-02-06 18:22:25.000000000 -0500
+++ src/opcodes/configure	2014-01-17 08:25:48.281453599 -0500
@@ -3216,7 +3216,7 @@
 # We currently only use the version number for the name of any shared
 # library.  For user convenience, we always use the same version
 # number that BFD is using.
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
+BFD_VERSION=`sed -n 's/AC_INIT(\[bfd\], *\[\([0-9.]*\)\])/\1/p' <${srcdir}/../bfd/configure.in`
 
 am__api_version='1.11'
 
diff -Naur src.orig/opcodes/configure.in src/opcodes/configure.in
--- src.orig/opcodes/configure.in	2013-02-06 18:22:26.000000000 -0500
+++ src/opcodes/configure.in	2014-01-17 08:25:42.873294676 -0500
@@ -28,7 +28,7 @@
 # library.  For user convenience, we always use the same version
 # number that BFD is using.
 changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
+BFD_VERSION=`sed -n 's/AC_INIT(\[bfd\], *\[\([0-9.]*\)\])/\1/p' <${srcdir}/../bfd/configure.in`
 changequote([,])dnl
 
 AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION})