3 # Please check with packages@netbsd.org before making modifications
8 archname=`uname -m`-${osname}
12 # NetBSD keeps dynamic loading dl*() functions in /usr/lib/crt0.o,
13 # so Configure doesn't find them (unless you abandon the nm scan).
14 # Also, NetBSD 0.9a was the first release to introduce shared
24 # NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so,
25 # which will not work.
33 if test -f /usr/libexec/ld.elf_so; then
37 cccdlflags="-DPIC -fPIC $cccdlflags"
38 lddlflags="--whole-archive -shared $lddlflags"
39 rpathflag="-Wl,-rpath,"
43 # Include the whole libgcc.a into the perl executable
44 # so that certain symbols needed by loadable modules
45 # built as C++ objects (__eh_alloc, __pure_virtual,
46 # etc.) will always be defined.
48 ccdlflags="-Wl,-whole-archive -lgcc \
49 -Wl,-no-whole-archive -Wl,-E $ccdlflags"
52 ccdlflags="-Wl,-E $ccdlflags"
55 elif test -f /usr/libexec/ld.so; then
59 cccdlflags="-DPIC -fPIC $cccdlflags"
60 lddlflags="-Bshareable $lddlflags"
69 # netbsd had these but they don't really work as advertised, in the
70 # versions listed below. if they are defined, then there isn't a
71 # way to make perl call setuid() or setgid(). if they aren't, then
72 # ($<, $>) = ($u, $u); will work (same for $(/$)). this is because
73 # you can not change the real userid of a process under 4.4BSD.
74 # netbsd fixed this in 1.3.2.
76 0.9*|1.[012]*|1.3|1.3.1)
83 d_getprotoent_r="$undef"
84 d_getprotobyname_r="$undef"
85 d_getprotobynumber_r="$undef"
86 d_setprotoent_r="$undef"
87 d_endprotoent_r="$undef"
88 d_getservent_r="$undef"
89 d_getservbyname_r="$undef"
90 d_getservbyport_r="$undef"
91 d_setservent_r="$undef"
92 d_endservent_r="$undef"
93 d_getprotoent_r_proto="$undef"
94 d_getprotobyname_r_proto="$undef"
95 d_getprotobynumber_r_proto="$undef"
96 d_setprotoent_r_proto="$undef"
97 d_endprotoent_r_proto="$undef"
98 d_getservent_r_proto="$undef"
99 d_getservbyname_r_proto="$undef"
100 d_getservbyport_r_proto="$undef"
101 d_setservent_r_proto="$undef"
102 d_endservent_r_proto="$undef"
106 # @20070922: setlocale() doesn't support LC_COLLATE and LC_NUMERIC
109 # next two lines should start at column 0
110 locale_cflags='ccflags="$ccflags -DNO_LOCALE_COLLATE -DNO_LOCALE_NUMERIC"'
111 sv_cflags='ccflags="$ccflags -DNO_LOCALE_COLLATE"'
115 # These are obsolete in any netbsd.
119 # there's no problem with vfork.
122 # This is there but in machine/ieeefp_h.
125 # This script UU/usethreads.cbu will get 'called-back' by Configure
126 # after it has prompted the user for whether to use threads.
127 cat > UU/usethreads.cbu <<'EOCBU'
128 case "$usethreads" in
131 for xxx in pthread; do
132 for yyy in $loclibpth $plibpth $glibpth dummy; do
134 if test -f "$zzz"; then
139 if test -f "$zzz"; then
143 zzz=`ls $yyy/lib$xxx.so.* 2>/dev/null`
144 if test "X$zzz" != X; then
149 if test "X$lpthread" != X; then
153 if test "X$lpthread" != X; then
155 libswanted="$libswanted $lpthread"
156 # There is no libc_r as of NetBSD 1.5.2, so no c -> c_r.
157 # This will be revisited when NetBSD gains a native pthreads
160 echo "$0: No POSIX threads library (-lpthread) found. " \
161 "You may want to install GNU pth. Aborting." >&4
166 # several reentrant functions are embeded in libc, but haven't
167 # been added to the header files yet. Let's hold off on using
168 # them until they are a valid part of the API
171 d_getprotobyname_r=$undef
172 d_getprotobynumber_r=$undef
173 d_getprotoent_r=$undef
174 d_getservbyname_r=$undef
175 d_getservbyport_r=$undef
176 d_getservent_r=$undef
177 d_setprotoent_r=$undef
178 d_setservent_r=$undef
179 d_endprotoent_r=$undef
180 d_endservent_r=$undef ;;
187 # Set sensible defaults for NetBSD: look for local software in
188 # /usr/pkg (NetBSD Packages Collection) and in /usr/local.
190 loclibpth="/usr/pkg/lib /usr/local/lib"
191 locincpth="/usr/pkg/include /usr/local/include"
198 for yyy in $loclibpth; do
199 ldflags="$ldflags $rpathflag$yyy"
206 echo 'int main() {}' > try.c
207 gcc=`${cc:-cc} -v -c try.c 2>&1|grep 'gcc version egcs-2'`
209 '' | "gcc version egcs-2.95."[3-9]*) ;; # 2.95.3 or better okay
212 *** Your gcc ($gcc) is known to be
213 *** too buggy on netbsd/alpha to compile Perl with optimization.
214 *** It is suggested you install the lang/gcc package which should
215 *** have at least gcc 2.95.3 which should work okay: use for example
216 *** Configure -Dcc=/usr/pkg/gcc-2.95.3/bin/cc. You could also
217 *** Configure -Doptimize=-O0 to compile Perl without any optimization
218 *** but that is not recommended.
228 # NetBSD/sparc 1.5.3/1.6.1 dumps core in the semid_ds test of Configure.
230 sparc) d_semctl_semid_ds=undef ;;