This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
NetBSD update, based on patches from the NetBSD packages system.
[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 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*)
099685bc
JH
21 if [ -f /usr/libexec/ld.elf_so ]; then
22 d_dlopen=$define
23 d_dlerror=$define
24 ccdlflags="-Wl,-E -Wl,-R${PREFIX}/lib $ccdlflags"
25 cccdlflags="-DPIC -fPIC $cccdlflags"
26 lddlflags="--whole-archive -shared $lddlflags"
27 elif [ "`uname -m`" = "pmax" ]; then
28# NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so, which will not work.
c9ef717e 29 d_dlopen=$undef
099685bc 30 elif [ -f /usr/libexec/ld.so ]; then
c9ef717e 31 d_dlopen=$define
32 d_dlerror=$define
099685bc 33 ccdlflags="-Wl,-R${PREFIX}/lib $ccdlflags"
4633a7c4
LW
34# we use -fPIC here because -fpic is *NOT* enough for some of the
35# extensions like Tk on some netbsd platforms (the sparc is one)
c9ef717e 36 cccdlflags="-DPIC -fPIC $cccdlflags"
37 lddlflags="-Bforcearchive -Bshareable $lddlflags"
099685bc
JH
38 else
39 d_dlopen=$undef
40 fi
491527d0
GS
41 ;;
42esac
c9ef717e 43
44# netbsd had these but they don't really work as advertised, in the
45# versions listed below. if they are defined, then there isn't a
46# way to make perl call setuid() or setgid(). if they aren't, then
47# ($<, $>) = ($u, $u); will work (same for $(/$)). this is because
48# you can not change the real userid of a process under 4.4BSD.
099685bc 49# netbsd fixed this in 1.3.2.
229e211d 50case "$osvers" in
099685bc 510.9*|1.[012]*|1.3|1.3.1)
4633a7c4
LW
52 d_setregid="$undef"
53 d_setreuid="$undef"
54 d_setrgid="$undef"
55 d_setruid="$undef"
a0d0e21e
LW
56 ;;
57esac
c4f23d77 58
099685bc 59# there's no problem with vfork.
c4f23d77
AD
60case "$usevfork" in
61'') usevfork=true ;;
62esac
099685bc
JH
63
64# Avoid telldir prototype conflict in pp_sys.c (NetBSD uses const DIR *)
65# Configure should test for this. Volunteers?
66pp_sys_cflags='ccflags="$ccflags -DHAS_TELLDIR_PROTOTYPE"'
67
68# Pre-empt the /usr/bin/perl question of installperl.
69installusrbinperl='n'
70