This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Encode 1.64.
[perl5.git] / hints / netbsd.sh
CommitLineData
a0d0e21e 1# hints/netbsd.sh
4633a7c4 2#
099685bc 3# talk to packages@netbsd.org if you want to change this file.
4633a7c4
LW
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
MG
9
10case "$archname" in
11'')
12 archname=`uname -m`-${osname}
13 ;;
14esac
15
a0d0e21e 16case "$osvers" in
4633a7c4 170.9|0.8*)
a0d0e21e
LW
18 usedl="$undef"
19 ;;
c9ef717e 20*)
6195bde2 21 if test -f /usr/libexec/ld.elf_so; then
099685bc
JH
22 d_dlopen=$define
23 d_dlerror=$define
900cf02d
JH
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 \
30afd0dc 28 -Wl,-E $ccdlflags"
099685bc
JH
29 cccdlflags="-DPIC -fPIC $cccdlflags"
30 lddlflags="--whole-archive -shared $lddlflags"
6195bde2 31 elif test "`uname -m`" = "pmax"; then
099685bc 32# NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so, which will not work.
900cf02d
JH
33 case "$osvers" in
34 1.3|1.3.1)
35 d_dlopen=$undef
36 ;;
37 esac
6195bde2 38 elif test -f /usr/libexec/ld.so; then
c9ef717e
MG
39 d_dlopen=$define
40 d_dlerror=$define
4633a7c4
LW
41# we use -fPIC here because -fpic is *NOT* enough for some of the
42# extensions like Tk on some netbsd platforms (the sparc is one)
c9ef717e 43 cccdlflags="-DPIC -fPIC $cccdlflags"
9f060c84 44 lddlflags="-Bshareable $lddlflags"
099685bc
JH
45 else
46 d_dlopen=$undef
47 fi
491527d0
GS
48 ;;
49esac
c9ef717e
MG
50
51# netbsd had these but they don't really work as advertised, in the
52# versions listed below. if they are defined, then there isn't a
53# way to make perl call setuid() or setgid(). if they aren't, then
54# ($<, $>) = ($u, $u); will work (same for $(/$)). this is because
55# you can not change the real userid of a process under 4.4BSD.
099685bc 56# netbsd fixed this in 1.3.2.
229e211d 57case "$osvers" in
099685bc 580.9*|1.[012]*|1.3|1.3.1)
4633a7c4
LW
59 d_setregid="$undef"
60 d_setreuid="$undef"
a0d0e21e
LW
61 ;;
62esac
c4f23d77 63
434e0566
JH
64# These are obsolete in any netbsd.
65d_setrgid="$undef"
66d_setruid="$undef"
67
099685bc 68# there's no problem with vfork.
900cf02d
JH
69usevfork=true
70
9a368ae6
JH
71# This is there but in machine/ieeefp_h.
72ieeefp_h="define"
73
7b938c21
JH
74# This script UU/usethreads.cbu will get 'called-back' by Configure
75# after it has prompted the user for whether to use threads.
76cat > UU/usethreads.cbu <<'EOCBU'
77case "$usethreads" in
78$define|true|[yY]*)
6195bde2
JH
79 lpthread=
80 for thislib in pthread; do
81 for thisdir in $loclibpth $plibpth $glibpth dummy; do
82 xxx=$thisdir/lib$thislib.a
83 if test -f "$xxx"; then
84 lpthread=$thislib
85 break;
86 fi
87 xxx=$thisdir/lib$thislib.so
88 if test -f "$xxx"; then
89 lpthread=$thislib
90 break;
91 fi
92 xxx=`ls $thisdir/lib$thislib.so.* 2>/dev/null`
93 if test "X$xxx" != X; then
94 lpthread=$thislib
95 break;
96 fi
97 done
98 if test "X$lpthread" != X; then
99 break;
100 fi
101 done
102 if test "X$lpthread" != X; then
103 # Add -lpthread.
104 libswanted="$libswanted $lpthread"
105 # There is no libc_r as of NetBSD 1.5.2, so no c -> c_r.
106 # This will be revisited when NetBSD gains a native pthreads
107 # implementation.
7b938c21 108 else
6195bde2
JH
109 echo "$0: No POSIX threads library (-lpthread) found. " \
110 "You may want to install GNU pth. Aborting." >&4
111 exit 1
112 fi
113 unset thisdir
114 unset thislib
115 unset lpthread
7b938c21
JH
116 ;;
117esac
0b196741 118EOCBU
7b938c21 119
2bf2710f 120# Recognize the NetBSD packages collection.
6195bde2 121# GDBM might be here, GNU pth might be there.
b9685307
JH
122if test -d /usr/pkg/lib; then
123 loclibpth="$loclibpth /usr/pkg/lib"
6195bde2 124 if test -f /usr/libexec/ld.elf_so; then
30afd0dc
JH
125 ldflags="$ldflags -Wl,-R/usr/pkg/lib"
126 else
127 ldflags="$ldflags -R/usr/pkg/lib"
128 fi
b9685307 129fi
2bf2710f 130test -d /usr/pkg/include && locincpth="$locincpth /usr/pkg/include"