summaryrefslogtreecommitdiff
path: root/devel/libtool/patches/patch-ab
blob: fff1616641eb4fbf07ab683485ef4cfa520ee3a8 (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
$NetBSD: patch-ab,v 1.14 2001/01/15 15:18:24 jlam Exp $

--- ltmain.in.orig	Fri May 26 21:53:15 2000
+++ ltmain.in
@@ -819,6 +819,7 @@
     old_convenience=
     deplibs=
     linkopts=
+    wllinkopts=
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
@@ -1154,6 +1155,25 @@
 	continue
 	;;
 
+      -Wl,*)
+       args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+       arg=
+       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+         case "$flag" in
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+           flag="\"$flag\""
+           ;;
+         esac
+         arg="$arg $wl$flag"
+         linkopts="$linkopts $flag"
+         wllinkopts="$wllinkopts $wl$flag"
+       done
+       IFS="$save_ifs"
+       arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+       ;;
+
       # Some other compiler flag.
       -* | +*)
 	# Unknown arguments in both finalize_command and compile_command need
@@ -1772,7 +1792,7 @@
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test "$avoid_version" = yes; then
 	  major=
 	  versuffix=
 	  verstring=""
@@ -1799,6 +1819,9 @@
 	  # rhapsody is a little odd...
 	  deplibs="$deplibs -framework System"
 	  ;;
+        *-*-netbsd*)
+	  # Don't link with libc until the a.out ld.so is fixed.
+	  ;;
 	*)
 	  # Add libc to deplibs on all other systems.
 	  deplibs="$deplibs -lc"
@@ -2103,6 +2126,16 @@
 	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
 	fi
 
+	# Check whether we need to link in c++rt0.o on a.out because of
+	# constructors/destructors
+	if test -n "$ctor_check_cmd"; then
+	  eval cmd=\"$ctor_check_cmd\"
+	  #$show "$cmd"
+	  if $run eval "$cmd" ; then
+	    cppopts="$cpprt0"
+	  fi
+	fi
+
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec"; then
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
@@ -2146,6 +2179,7 @@
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  linkopts="$linkopts $flag"
+          wllinkopts="$wllinkopts $wl$flag"
 	fi
 
 	# Do each of the archive commands.