summaryrefslogtreecommitdiff
path: root/devel/libtool/patches/patch-ag
blob: 3dee189d0a4fb303cf93f0225cb67237e25406b9 (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
$NetBSD: patch-ag,v 1.6 2002/05/21 14:03:37 schmonz Exp $

--- ltcf-cxx.sh.orig	Wed May 23 05:05:06 2001
+++ ltcf-cxx.sh
@@ -382,8 +382,40 @@
         ;;
     esac
     ;;
+  darwin* | rhapsody*)
+	case "$host_os" in
+	rhapsody* | darwin1.[012])
+	  allow_undefined_flag='-undefined suppress'
+	  ;;
+	*) # Darwin 1.3 on
+	  allow_undefined_flag='-flat_namespace -undefined suppress'
+	  ;;
+	esac
+    archive_cmds='$CC $(if test .$module = .yes; then echo -bundle; else echo -dynamiclib; fi) $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts -install_name $rpath/$soname $verstring'
+    # We need to add '_' to the symbols in $export_symbols first 
+    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols $lib'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    whole_archive_flag_spec='-all_load $convenience'
+    ;;
   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_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep conftest.$objext | sed -e "s/-lgcc -lc -lgcc//"'
     ;;
   osf3*)
     if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
@@ -690,7 +722,7 @@
   darwin* | rhapsody*)
     # PIC is the default on this platform
     # Common symbols not allowed in MH_DYLIB files
-    lt_cv_prog_cc_pic='-fno-common'
+    ac_cv_prog_cc_pic='-fno-common'
     ;;
   *djgpp*)
     # DJGPP does not support shared libraries at all
@@ -982,6 +1014,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