Commit | Line | Data |
a0d0e21e |
1 | # hints/netbsd.sh |
4633a7c4 |
2 | # |
099685bc |
3 | # talk to packages@netbsd.org if you want to change this file. |
4633a7c4 |
4 | # |
5 | # netbsd keeps dynamic loading dl*() functions in /usr/lib/crt0.o, |
232e078e |
6 | # so Configure doesn't find them (unless you abandon the nm scan). |
4633a7c4 |
7 | # this should be *just* 0.9 below as netbsd 0.9a was the first to |
099685bc |
8 | # introduce shared libraries. |
c9ef717e |
9 | |
10 | case "$archname" in |
11 | '') |
12 | archname=`uname -m`-${osname} |
13 | ;; |
14 | esac |
15 | |
a0d0e21e |
16 | case "$osvers" in |
4633a7c4 |
17 | 0.9|0.8*) |
a0d0e21e |
18 | usedl="$undef" |
19 | ;; |
c9ef717e |
20 | *) |
67215f40 |
21 | # Note that we use the value of $prefix in this block. The user |
22 | # should specify -Dprefix=... to the Configure script. |
099685bc |
23 | if [ -f /usr/libexec/ld.elf_so ]; then |
24 | d_dlopen=$define |
25 | d_dlerror=$define |
900cf02d |
26 | # Include the whole libgcc.a, required for Xerces-P, which |
27 | # needs __eh_alloc, __pure_virtual, and others. |
28 | # XXX This should be obsoleted by gcc-3.0. |
29 | ccdlflags="-Wl,-whole-archive -lgcc -Wl,-no-whole-archive \ |
67215f40 |
30 | -Wl,-E -Wl,-R$prefix/lib $ccdlflags" |
099685bc |
31 | cccdlflags="-DPIC -fPIC $cccdlflags" |
32 | lddlflags="--whole-archive -shared $lddlflags" |
33 | elif [ "`uname -m`" = "pmax" ]; then |
34 | # NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so, which will not work. |
900cf02d |
35 | case "$osvers" in |
36 | 1.3|1.3.1) |
37 | d_dlopen=$undef |
38 | ;; |
39 | esac |
099685bc |
40 | elif [ -f /usr/libexec/ld.so ]; then |
c9ef717e |
41 | d_dlopen=$define |
42 | d_dlerror=$define |
67215f40 |
43 | ccdlflags="-Wl,-R$prefix/lib $ccdlflags" |
4633a7c4 |
44 | # we use -fPIC here because -fpic is *NOT* enough for some of the |
45 | # extensions like Tk on some netbsd platforms (the sparc is one) |
c9ef717e |
46 | cccdlflags="-DPIC -fPIC $cccdlflags" |
9f060c84 |
47 | lddlflags="-Bshareable $lddlflags" |
099685bc |
48 | else |
49 | d_dlopen=$undef |
50 | fi |
491527d0 |
51 | ;; |
52 | esac |
c9ef717e |
53 | |
54 | # netbsd had these but they don't really work as advertised, in the |
55 | # versions listed below. if they are defined, then there isn't a |
56 | # way to make perl call setuid() or setgid(). if they aren't, then |
57 | # ($<, $>) = ($u, $u); will work (same for $(/$)). this is because |
58 | # you can not change the real userid of a process under 4.4BSD. |
099685bc |
59 | # netbsd fixed this in 1.3.2. |
229e211d |
60 | case "$osvers" in |
099685bc |
61 | 0.9*|1.[012]*|1.3|1.3.1) |
4633a7c4 |
62 | d_setregid="$undef" |
63 | d_setreuid="$undef" |
a0d0e21e |
64 | ;; |
65 | esac |
c4f23d77 |
66 | |
434e0566 |
67 | # These are obsolete in any netbsd. |
68 | d_setrgid="$undef" |
69 | d_setruid="$undef" |
70 | |
099685bc |
71 | # there's no problem with vfork. |
900cf02d |
72 | usevfork=true |
73 | |
9a368ae6 |
74 | # This is there but in machine/ieeefp_h. |
75 | ieeefp_h="define" |
76 | |
7b938c21 |
77 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
78 | # after it has prompted the user for whether to use threads. |
79 | cat > UU/usethreads.cbu <<'EOCBU' |
80 | case "$usethreads" in |
81 | $define|true|[yY]*) |
82 | # The GNU pth is the recommended user-level pthreads implementation. |
83 | # As of NetBSD 1.5.2 there are no kernel pthreads. |
84 | if pkg_info -qe pth; then |
85 | # Add -lpthread. |
86 | libswanted="$libswanted pthread" |
7b938c21 |
87 | # There is no libc_r as of NetBSD 1.5.2, so no c -> c_r. |
88 | else |
89 | echo "$0: You need to install the GNU pth. Aborting." >&4 |
90 | exit 1 |
91 | fi |
92 | ;; |
93 | esac |
0b196741 |
94 | EOCBU |
7b938c21 |
95 | |
2bf2710f |
96 | # Recognize the NetBSD packages collection. |
b9685307 |
97 | # GDBM might be here, pth might be there. |
98 | if test -d /usr/pkg/lib; then |
99 | loclibpth="$loclibpth /usr/pkg/lib" |
100 | ldflags="$ldflags -R/usr/pkg/lib" |
101 | fi |
2bf2710f |
102 | test -d /usr/pkg/include && locincpth="$locincpth /usr/pkg/include" |