summaryrefslogtreecommitdiff
path: root/devel/libtool/patches/patch-ab
blob: 6a7bf6d6ee7a57bf86934c66cc512c0c7665ac45 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
$NetBSD: patch-ab,v 1.28 2003/01/21 22:43:42 grant Exp $

--- ltmain.sh.orig	Thu Jun 14 14:06:50 2001
+++ ltmain.sh
@@ -211,6 +211,8 @@ do
   --mode) prevopt="--mode" prev=mode ;;
   --mode=*) mode="$optarg" ;;
 
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
   --quiet | --silent)
     show=:
     ;;
@@ -256,7 +258,7 @@ if test -z "$show_help"; then
   # Infer the operation mode.
   if test -z "$mode"; then
     case $nonopt in
-    *cc | *++ | gcc* | *-gcc*)
+    *cc | *++ | gcc* | *-gcc* | *CC)
       mode=link
       for arg
       do
@@ -494,11 +496,21 @@ if test -z "$show_help"; then
     # command doesn't match the default compiler.
     if test -n "$available_tags" && test -z "$tagname"; then
       case $base_compile in
-      "$CC "*) ;;
+      "$CC "*) tagname=CC ;;
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when ltconfig was run.
-      "`$echo $CC` "*) ;;
-      *)
+      "`$echo $CC` "*) tagname=CC ;;
+      *)   base_compiler=`echo $base_compile | awk '{ print $1 }'`
+	   case $base_compiler in
+	   *cc)	tagname=CC ;;
+	   *++)
+	     tagname=CXX
+	     eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+	     ;;
+	   esac ;;
+      esac
+    fi
+    if test -n "$available_tags" && test -z "$tagname"; then
         for z in $available_tags; do
           if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
 	    # Evaluate the configuration.
@@ -528,8 +540,6 @@ if test -z "$show_help"; then
 #        else
 #          echo "$modename: using $tagname tagged configuration"
         fi
-	;;
-      esac
     fi
 
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
@@ -1528,11 +1538,21 @@ EOF
     # command doesn't match the default compiler.
     if test -n "$available_tags" && test -z "$tagname"; then
       case $base_compile in
-      "$CC "*) ;;
+      "$CC "*) tagname=CC ;;
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when ltconfig was run.
-      "`$echo $CC` "*) ;;
-      *)
+      "`$echo $CC` "*) tagname=CC ;;
+      *)   base_compiler=`echo $base_compile | awk '{ print $1 }'`
+	   case $base_compiler in
+	   *cc)	tagname=CC ;;
+	   *++)
+	     tagname=CXX
+	     eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+	     ;;
+	   esac ;;
+      esac
+    fi
+    if test -n "$available_tags" && test -z "$tagname"; then
         for z in $available_tags; do
           if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
 	    # Evaluate the configuration.
@@ -1562,8 +1582,6 @@ EOF
 #       else
 #         echo "$modename: using $tagname tagged configuration"
         fi
-	;;
-      esac
     fi
 
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
@@ -1619,9 +1637,11 @@ EOF
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
       case "$libs " in
       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
       esac
+      fi
       libs="$libs $deplib"
     done
 
@@ -1632,12 +1652,14 @@ EOF
       # $postdeps and mark them as special (i.e., whose duplicates are
       # not to be eliminated).
       pre_post_deps=
+      if test "X$duplicate_deps" = "Xyes" ; then
       for pre_post_dep in $predeps $postdeps; do
         case "$pre_post_deps " in
 	*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
 	esac
 	pre_post_deps="$pre_post_deps $pre_post_dep"
       done
+      fi
       pre_post_deps=
     fi
 
@@ -1861,9 +1883,11 @@ EOF
 	    tmp_libs=
 	    for deplib in $dependency_libs; do
 	      deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	      esac
+              fi
 	      tmp_libs="$tmp_libs $deplib"
 	    done
 	  elif test $linkmode != prog && test $linkmode != lib; then
@@ -1986,9 +2010,11 @@ EOF
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
 	    case "$tmp_libs " in
 	    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	    esac
+	    fi
 	    tmp_libs="$tmp_libs $deplib"
 	  done # for deplib
 	  continue
@@ -2287,9 +2313,11 @@ EOF
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
 	    case "$tmp_libs " in
 	    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	    esac
+	    fi
 	    tmp_libs="$tmp_libs $deplib"
 	  done
 
@@ -2582,7 +2610,7 @@ EOF
 	  ;;
 
 	irix)
-	  major=`expr $current - $age + 1`
+	  major=`expr $current - $age`
 	  verstring="sgi$major.$revision"
 
 	  # Add in all the interfaces that we are compatible with.
@@ -2642,7 +2670,16 @@ EOF
 	# Clear the version info if we defaulted, and they specified a release.
 	if test -z "$vinfo" && test -n "$release"; then
 	  major=
-	  verstring="0.0"
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
 	  if test "$need_version" = no; then
 	    versuffix=
 	  else
@@ -5053,7 +5090,7 @@ relink_command=\"$relink_command\""
       fi
 
       # Now prepare to actually exec the command.
-      exec_cmd='"$cmd"$args'
+      exec_cmd="\$cmd$args"
     else
       # Display what would be done.
       if test -n "$shlibpath_var"; then