summaryrefslogtreecommitdiff
path: root/devel/libtool/patches/patch-aa
blob: 2a49f7c43bd76e994ecd2a5321e6907582ee4648 (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
$NetBSD: patch-aa,v 1.18 2000/11/26 21:00:11 mycroft Exp $

--- ltconfig.in.orig	Sat May 27 01:58:57 2000
+++ ltconfig.in	Sun Nov 26 20:58:13 2000
@@ -1194,11 +1194,17 @@
 
   netbsd*)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
+      wlarc=
+      # Add in C++ constructor/destructor support
+      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
+        archive_cmds="$archive_cmds ${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
+      elif test -f /usr/lib/c++rt0.o; then
+        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
+      fi
     else
-      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
-      # can we support soname and/or expsyms with a.out? -oliva
+      archive_cmds='$CC -shared $libobjs $deplibs $wllinkopts ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared $libobjs $deplibs $wllinkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
     fi
     ;;
 
@@ -1392,11 +1398,19 @@
 
   netbsd*)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
+      # Add in C++ constructor/destructor support
+      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
+        archive_cmds="$archive_cmds ${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
+      elif test -f /usr/lib/c++rt0.o; then
+        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
+      fi
     else
+      # I don't think there are any ELF toolchains with non-gnu ld.
+      # I'm not touching this just in case!
       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
     fi
-    hardcode_libdir_flag_spec='${wl}-R$libdir'
+    hardcode_libdir_flag_spec='-R$libdir'
     hardcode_direct=yes
     hardcode_shlibpath_var=no
     ;;
@@ -2007,14 +2021,23 @@
 
 netbsd*)
   version_type=sunos
+  need_lib_prefix=no
   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library'
+    file_magic_cmd=/usr/bin/file
+    file_magic_test_file=`echo /usr/lib/libc.so*`
     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
+    need_version=yes
   else
+    deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+    file_magic_cmd=/usr/bin/file
+    file_magic_test_file=`echo /usr/lib/libc.so*`
     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
     soname_spec='${libname}${release}.so$major'
     dynamic_linker='NetBSD ld.elf_so'
+    need_version=no
   fi
   shlibpath_var=LD_LIBRARY_PATH
   ;;
@@ -2069,7 +2092,7 @@
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'