blob: a73df2e4a7a3ee3fa8fde4b46a71f4bb823d9dcc [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Upstream-Status: Inappropriate [embedded specific]
2
3Renames "libtool" -> "${TARGET_PREFIX}libtool" which makes sure
4it can't be confused with the host libtool.
5
6Originally by: RP
7
8Updated: Date: 2010/06/28
9Nitin A Kamble <nitin.a.kamble@intel.com>
10
11It also adjusts libtool so that the header at the script is used for
12script execution and not thevalue of $SHELL. This is because many
13Makefiles change $SHELL so dash can get used to execute what is
14otherwise configured as a bash shell script. Since we don't need to
15execute scipts this way on any system I'm aware of us building upon,
16the simplest fix is just to remove $SHELL.
17
18Updated: Date: 2011/11/09
19RP
20
21Updated by: Robert Yang <liezhi.yang@windriver.com>
22
23diff --git a/Makefile.am b/Makefile.am
24--- a/Makefile.am
25+++ b/Makefile.am
26@@ -31,7 +31,7 @@ SUBDIRS = .
27 DIST_SUBDIRS = $(SUBDIRS)
28 EXTRA_DIST =
29
30-BUILT_SOURCES = libtool libtoolize
31+BUILT_SOURCES = $(host_alias)-libtool libtoolize
32
33 CLEANFILES =
34 MOSTLYCLEANFILES =
35@@ -67,7 +67,7 @@ build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
36
37 EXTRA_DIST += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
38 GNUmakefile
39-CLEANFILES += libtool libtoolize
40+CLEANFILES += $(host_alias)-libtool libtoolize
41
42 ## If a file is named several times below, and especially if it
43 ## is a distributed file created during Libtool bootstrap, we
44@@ -276,7 +276,7 @@ configure_edit = $(bootstrap_edit) \
45 -e 's|@srcdir\@|$(srcdir)|g'
46
47 # The libtool distributor and the standalone libtool script.
48-bin_SCRIPTS = libtool
49+bin_SCRIPTS = $(host_alias)-libtool
50
51 libtoolize: $(libtoolize_in) $(config_status)
52 $(AM_V_at)rm -f '$@'
53@@ -287,7 +287,7 @@ libtoolize: $(libtoolize_in) $(config_status)
54 # We used to do this with a 'stamp-vcl' file, but non-gmake builds
55 # would rerun configure on every invocation, so now we manually
56 # check the version numbers from the build rule when necessary.
57-libtool: $(ltmain_sh) $(config_status) $(dotversion)
58+$(host_alias)-libtool: $(ltmain_sh) $(config_status) $(dotversion)
59 @$(rebuild); \
60 if test -f '$@'; then \
61 eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
62@@ -731,12 +731,12 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
63
64 BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
65 LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
66- LIBTOOL="$(abs_top_builddir)/libtool" \
67+ LIBTOOL="$(abs_top_builddir)/$(host_alias)-libtool" \
68 tst_aclocaldir="$(abs_top_srcdir)/m4"
69
70 INSTALLCHECK_ENVIRONMENT = \
71 LIBTOOLIZE="$(bindir)/`echo libtoolize |$(SED) '$(program_transform_name)'`" \
72- LIBTOOL="$(bindir)/`echo libtool |$(SED) '$(program_transform_name)'`" \
73+ LIBTOOL="$(bindir)/`echo $(host_alias)-libtool |$(SED) '$(program_transform_name)'`" \
74 LTDLINCL="-I$(includedir)" \
75 LIBLTDL="$(libdir)/libltdl.la" \
76 tst_aclocaldir="$(aclocaldir)"
77diff --git a/m4/libtool.m4 b/m4/libtool.m4
78--- a/m4/libtool.m4
79+++ b/m4/libtool.m4
80@@ -86,7 +86,8 @@ _LT_SET_OPTIONS([$0], [$1])
81 LIBTOOL_DEPS=$ltmain
82
83 # Always use our own libtool.
84-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
85+LIBTOOL='$(top_builddir)'
86+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
87 AC_SUBST(LIBTOOL)dnl
88
89 _LT_SETUP
90@@ -199,7 +200,7 @@ aix3*)
91 esac
92
93 # Global variables:
94-ofile=libtool
95+ofile=${host_alias}-libtool
96 can_build_shared=yes
97
98 # All known linkers require a '.a' archive for static linking (except MSVC,