summaryrefslogtreecommitdiff
path: root/devel/libtool/patches/patch-ag
blob: d7375fe4126d89cf9447a416736533b24a4fc414 (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
$NetBSD: patch-ag,v 1.3 2001/06/14 14:55:48 skrll Exp $

--- ltcf-cxx.sh.orig	Wed May 23 05:05:06 2001
+++ ltcf-cxx.sh
@@ -383,7 +383,23 @@
     esac
     ;;
   netbsd*)
-    # NetBSD uses g++ - do we need to do anything?
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      # Surely {pre|post}dep_objects should be added here!
+      archive_cmds='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      # Determine if we need to override the c++rt0 that is
+      # picked up by analysing output_verbose_link_cmds
+      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
+        cpprt0_file="${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
+      else
+        cpprt0_file=
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpathvar_var=no
+    fi
+    # Workaround for some pre-1.5 ELF toolchains
+    output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L" | sed -e "s/-lgcc -lc -lgcc//"'
     ;;
   osf3*)
     if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
@@ -982,6 +998,14 @@
 
     esac
   done
+
+  case "$host_os" in
+  netbsd*)
+    if test -n "$cpprt0_file"; then
+      predep_objects=`eval echo $predep_objects | sed -e 's:/usr/lib/c++rt0.o:$cpprt0_file:'`
+    fi
+    ;;
+  esac
 
   # Clean up.
   rm -f a.out