xref: /OK3568_Linux_fs/buildroot/support/libtool/buildroot-libtool-v2.4.4.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunLibtool fixes for cross-compilation, many past contributors/authors.
2*4882a593SmuzhiyunUpdate based on libtool-2.4.4, useful for 2.4.3 as well but not 2.4.2.
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSigned-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun--- a/ltmain.sh	2014-12-16 09:51:23.068441045 -0300
7*4882a593Smuzhiyun+++ b/ltmain.sh	2014-12-16 09:57:10.509430339 -0300
8*4882a593Smuzhiyun@@ -2687,8 +2687,8 @@
9*4882a593Smuzhiyun 	# was found and let the user know that the "--tag" command
10*4882a593Smuzhiyun 	# line option must be used.
11*4882a593Smuzhiyun 	if test -z "$tagname"; then
12*4882a593Smuzhiyun-	  func_echo "unable to infer tagged configuration"
13*4882a593Smuzhiyun-	  func_fatal_error "specify a tag with '--tag'"
14*4882a593Smuzhiyun+	  func_echo "defaulting to \`CC'"
15*4882a593Smuzhiyun+	  func_echo "if this is not correct, specify a tag with \`--tag'"
16*4882a593Smuzhiyun #	else
17*4882a593Smuzhiyun #	  func_verbose "using $tagname tagged configuration"
18*4882a593Smuzhiyun 	fi
19*4882a593Smuzhiyun@@ -4277,8 +4277,12 @@
20*4882a593Smuzhiyun 	  # At present, this check doesn't affect windows .dll's that
21*4882a593Smuzhiyun 	  # are installed into $libdir/../bin (currently, that works fine)
22*4882a593Smuzhiyun 	  # but it's something to keep an eye on.
23*4882a593Smuzhiyun-	  test "$inst_prefix_dir" = "$destdir" && \
24*4882a593Smuzhiyun-	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
25*4882a593Smuzhiyun+
26*4882a593Smuzhiyun+	  #
27*4882a593Smuzhiyun+	  # This breaks install into our staging area.  -PB
28*4882a593Smuzhiyun+	  #
29*4882a593Smuzhiyun+	  #test "$inst_prefix_dir" = "$destdir" && \
30*4882a593Smuzhiyun+	  #  func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun 	  if test -n "$inst_prefix_dir"; then
33*4882a593Smuzhiyun 	    # Stick the inst_prefix_dir data into the link command.
34*4882a593Smuzhiyun@@ -6550,7 +6554,8 @@
35*4882a593Smuzhiyun 	;;
36*4882a593Smuzhiyun       -all-static | -static | -static-libtool-libs)
37*4882a593Smuzhiyun 	case $arg in
38*4882a593Smuzhiyun-	-all-static)
39*4882a593Smuzhiyun+	# Make -static behave like -all-static -GZ
40*4882a593Smuzhiyun+	-all-static | -static)
41*4882a593Smuzhiyun 	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
42*4882a593Smuzhiyun 	    func_warning "complete static linking is impossible in this configuration"
43*4882a593Smuzhiyun 	  fi
44*4882a593Smuzhiyun@@ -6559,12 +6564,6 @@
45*4882a593Smuzhiyun 	  fi
46*4882a593Smuzhiyun 	  prefer_static_libs=yes
47*4882a593Smuzhiyun 	  ;;
48*4882a593Smuzhiyun-	-static)
49*4882a593Smuzhiyun-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
50*4882a593Smuzhiyun-	    dlopen_self=$dlopen_self_static
51*4882a593Smuzhiyun-	  fi
52*4882a593Smuzhiyun-	  prefer_static_libs=built
53*4882a593Smuzhiyun-	  ;;
54*4882a593Smuzhiyun 	-static-libtool-libs)
55*4882a593Smuzhiyun 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
56*4882a593Smuzhiyun 	    dlopen_self=$dlopen_self_static
57*4882a593Smuzhiyun@@ -6858,7 +6857,8 @@
58*4882a593Smuzhiyun       prevarg=$arg
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun       case $arg in
61*4882a593Smuzhiyun-      -all-static)
62*4882a593Smuzhiyun+      # Make -static behave like -all-static -GZ
63*4882a593Smuzhiyun+      -all-static | -static)
64*4882a593Smuzhiyun 	if test -n "$link_static_flag"; then
65*4882a593Smuzhiyun 	  # See comment for -static flag below, for more details.
66*4882a593Smuzhiyun 	  func_append compile_command " $link_static_flag"
67*4882a593Smuzhiyun@@ -7149,7 +7149,7 @@
68*4882a593Smuzhiyun 	continue
69*4882a593Smuzhiyun 	;;
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun-      -static | -static-libtool-libs)
72*4882a593Smuzhiyun+      -static-libtool-libs)
73*4882a593Smuzhiyun 	# The effects of -static are defined in a previous loop.
74*4882a593Smuzhiyun 	# We used to do the same as -all-static on platforms that
75*4882a593Smuzhiyun 	# didn't have a PIC flag, but the assumption that the effects
76*4882a593Smuzhiyun@@ -8112,7 +8112,7 @@
77*4882a593Smuzhiyun 	  *)
78*4882a593Smuzhiyun 	    if test no = "$installed"; then
79*4882a593Smuzhiyun 	      func_append notinst_deplibs " $lib"
80*4882a593Smuzhiyun-	      need_relink=yes
81*4882a593Smuzhiyun+	      need_relink=no
82*4882a593Smuzhiyun 	    fi
83*4882a593Smuzhiyun 	    ;;
84*4882a593Smuzhiyun 	  esac
85*4882a593Smuzhiyun@@ -10710,6 +10710,10 @@
86*4882a593Smuzhiyun 	    # Replace all uninstalled libtool libraries with the installed ones
87*4882a593Smuzhiyun 	    newdependency_libs=
88*4882a593Smuzhiyun 	    for deplib in $dependency_libs; do
89*4882a593Smuzhiyun+	      # Replacing uninstalled with installed can easily break crosscompilation,
90*4882a593Smuzhiyun+	      # since the installed path is generally the wrong architecture.  -CL
91*4882a593Smuzhiyun+	      newdependency_libs="$newdependency_libs $deplib"
92*4882a593Smuzhiyun+	      continue
93*4882a593Smuzhiyun 	      case $deplib in
94*4882a593Smuzhiyun 	      *.la)
95*4882a593Smuzhiyun 		func_basename "$deplib"
96