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 | *) |
099685bc |
21 | if [ -f /usr/libexec/ld.elf_so ]; then |
22 | d_dlopen=$define |
23 | d_dlerror=$define |
900cf02d |
24 | # Include the whole libgcc.a, required for Xerces-P, which |
25 | # needs __eh_alloc, __pure_virtual, and others. |
26 | # XXX This should be obsoleted by gcc-3.0. |
27 | ccdlflags="-Wl,-whole-archive -lgcc -Wl,-no-whole-archive \ |
28 | -Wl,-E -Wl,-R${PREFIX}/lib $ccdlflags" |
099685bc |
29 | cccdlflags="-DPIC -fPIC $cccdlflags" |
30 | lddlflags="--whole-archive -shared $lddlflags" |
31 | elif [ "`uname -m`" = "pmax" ]; then |
32 | # NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so, which will not work. |
900cf02d |
33 | case "$osvers" in |
34 | 1.3|1.3.1) |
35 | d_dlopen=$undef |
36 | ;; |
37 | esac |
099685bc |
38 | elif [ -f /usr/libexec/ld.so ]; then |
c9ef717e |
39 | d_dlopen=$define |
40 | d_dlerror=$define |
099685bc |
41 | ccdlflags="-Wl,-R${PREFIX}/lib $ccdlflags" |
4633a7c4 |
42 | # we use -fPIC here because -fpic is *NOT* enough for some of the |
43 | # extensions like Tk on some netbsd platforms (the sparc is one) |
c9ef717e |
44 | cccdlflags="-DPIC -fPIC $cccdlflags" |
9f060c84 |
45 | lddlflags="-Bshareable $lddlflags" |
099685bc |
46 | else |
47 | d_dlopen=$undef |
48 | fi |
491527d0 |
49 | ;; |
50 | esac |
c9ef717e |
51 | |
52 | # netbsd had these but they don't really work as advertised, in the |
53 | # versions listed below. if they are defined, then there isn't a |
54 | # way to make perl call setuid() or setgid(). if they aren't, then |
55 | # ($<, $>) = ($u, $u); will work (same for $(/$)). this is because |
56 | # you can not change the real userid of a process under 4.4BSD. |
099685bc |
57 | # netbsd fixed this in 1.3.2. |
229e211d |
58 | case "$osvers" in |
099685bc |
59 | 0.9*|1.[012]*|1.3|1.3.1) |
4633a7c4 |
60 | d_setregid="$undef" |
61 | d_setreuid="$undef" |
a0d0e21e |
62 | ;; |
63 | esac |
c4f23d77 |
64 | |
434e0566 |
65 | # These are obsolete in any netbsd. |
66 | d_setrgid="$undef" |
67 | d_setruid="$undef" |
68 | |
099685bc |
69 | # there's no problem with vfork. |
900cf02d |
70 | usevfork=true |
71 | |
72 | # Using perl's malloc leads to trouble on some toolchain versions. |
73 | usemymalloc="$undef" |
099685bc |
74 | |
099685bc |
75 | # Pre-empt the /usr/bin/perl question of installperl. |
900cf02d |
76 | installusrbinperl="$undef" |
099685bc |
77 | |
9a368ae6 |
78 | # This is there but in machine/ieeefp_h. |
79 | ieeefp_h="define" |
80 | |
7b938c21 |
81 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
82 | # after it has prompted the user for whether to use threads. |
83 | cat > UU/usethreads.cbu <<'EOCBU' |
84 | case "$usethreads" in |
85 | $define|true|[yY]*) |
86 | # The GNU pth is the recommended user-level pthreads implementation. |
87 | # As of NetBSD 1.5.2 there are no kernel pthreads. |
88 | if pkg_info -qe pth; then |
89 | # Add -lpthread. |
90 | libswanted="$libswanted pthread" |
91 | # -R so that we find the libpthread.so from /usr/pkg/lib |
92 | # during Configure and build. |
93 | ldflags="-R/usr/pkg/lib $ldflags" |
94 | # There is no libc_r as of NetBSD 1.5.2, so no c -> c_r. |
95 | else |
96 | echo "$0: You need to install the GNU pth. Aborting." >&4 |
97 | exit 1 |
98 | fi |
99 | ;; |
100 | esac |
101 | EOCBU |
102 | |
2bf2710f |
103 | # Recognize the NetBSD packages collection. |
104 | # GDBM might be here. |
105 | test -d /usr/pkg/lib && loclibpth="$loclibpth /usr/pkg/lib" |
106 | test -d /usr/pkg/include && locincpth="$locincpth /usr/pkg/include" |