fcc07f2790665dc4d48ec2b890a2004a02504891
[lede.git] / tools / libtool / patches / 000-relocatable.patch
1 --- a/libltdl/config/general.m4sh
2 +++ b/libltdl/config/general.m4sh
3 @@ -53,7 +53,11 @@ test "${ECHO+set}" = set || ECHO=${as_ec
4  : ${MKDIR="mkdir"}
5  : ${MV="mv -f"}
6  : ${RM="rm -f"}
7 -: ${SED="@SED@"}
8 +if test -n "$STAGING_DIR"; then
9 +       : ${SED="$STAGING_DIR/../host/bin/sed"}
10 +else
11 +       : ${SED="@SED@"}
12 +fi
13  : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
14  : ${Xsed="$SED -e 1s/^X//"}
15  
16 --- a/libtoolize.in
17 +++ b/libtoolize.in
18 @@ -334,7 +334,11 @@ test "${ECHO+set}" = set || ECHO=${as_ec
19  : ${MKDIR="mkdir"}
20  : ${MV="mv -f"}
21  : ${RM="rm -f"}
22 -: ${SED="@SED@"}
23 +if test -n "$STAGING_DIR"; then
24 +       : ${SED="$STAGING_DIR/../host/bin/sed"}
25 +else
26 +       : ${SED="@SED@"}
27 +fi
28  : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
29  : ${Xsed="$SED -e 1s/^X//"}
30  
31 @@ -2476,10 +2480,17 @@ func_check_macros ()
32  
33    # Locations for important files:
34    prefix=@prefix@
35 -  datadir=@datadir@
36 -  pkgdatadir=@pkgdatadir@
37 -  pkgltdldir=@pkgdatadir@
38 -  aclocaldir=@aclocaldir@
39 +  if test -n "$STAGING_DIR"; then
40 +    datadir="$STAGING_DIR/../host/share"
41 +    pkgdatadir="$STAGING_DIR/../host/share/libtool"
42 +    pkgltdldir="$STAGING_DIR/../host/share/libtool"
43 +    aclocaldir="$STAGING_DIR/../host/share/aclocal"
44 +  else
45 +    datadir=@datadir@
46 +    pkgdatadir=@pkgdatadir@
47 +    pkgltdldir=@pkgdatadir@
48 +    aclocaldir=@aclocaldir@
49 +  fi
50    auxdir=
51    macrodir=
52    configure_ac=configure.in
53 --- a/libtoolize.m4sh
54 +++ b/libtoolize.m4sh
55 @@ -1450,10 +1450,17 @@ func_check_macros ()
56  
57    # Locations for important files:
58    prefix=@prefix@
59 -  datadir=@datadir@
60 -  pkgdatadir=@pkgdatadir@
61 -  pkgltdldir=@pkgdatadir@
62 -  aclocaldir=@aclocaldir@
63 +  if test -n "$STAGING_DIR"; then
64 +    datadir="$STAGING_DIR/../host/share"
65 +    pkgdatadir="$STAGING_DIR/../host/share/libtool"
66 +    pkgltdldir="$STAGING_DIR/../host/share/libtool"
67 +    aclocaldir="$STAGING_DIR/../host/share/aclocal"
68 +  else
69 +    datadir=@datadir@
70 +    pkgdatadir=@pkgdatadir@
71 +    pkgltdldir=@pkgdatadir@
72 +    aclocaldir=@aclocaldir@
73 +  fi
74    auxdir=
75    macrodir=
76    configure_ac=configure.in
77 --- a/libltdl/m4/libtool.m4
78 +++ b/libltdl/m4/libtool.m4
79 @@ -875,9 +875,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], [])
80  # ----------------
81  m4_defun([_LT_TAG_COMPILER],
82  [AC_REQUIRE([AC_PROG_CC])dnl
83 -
84  _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
85 -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
86 +_LT_DECL([LTCFLAGS], [CFLAGS], ["-O2 -I\${STAGING_DIR:-$STAGING_DIR}/../host/include"], [LTCC compiler flags])dnl
87  _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
88  _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
89  
90 @@ -7544,9 +7543,8 @@ AC_SUBST([DLLTOOL])
91  # as few characters as possible.  Prefer GNU sed if found.
92  m4_defun([_LT_DECL_SED],
93  [AC_PROG_SED
94 -test -z "$SED" && SED=sed
95  Xsed="$SED -e 1s/^X//"
96 -_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
97 +_LT_DECL([], [SED], ["\${STAGING_DIR:-$STAGING_DIR}/../host/bin/sed"], [A sed program that does not truncate output])
98  _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
99      [Sed that helps us avoid accidentally triggering echo(1) options like -n])
100  ])# _LT_DECL_SED