xref: /openbsd-src/gnu/usr.bin/perl/hints/minix.sh (revision f3efcd0145415b7d44d9da97e0ad5c21b186ac61)
1# hints/minix.sh
2#
3# Please check with packages@netbsd.org before making modifications
4# to this file.
5
6case "$archname" in
7'')
8    archname=`uname -m`-${osname}
9    ;;
10esac
11
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#
15case "$osvers" in
16*)
17	if test -f /usr/libexec/ld.elf_so; then
18		# ELF
19		d_dlopen=$define
20		d_dlerror=$define
21		cccdlflags="-DPIC -fPIC $cccdlflags"
22		lddlflags="-shared $lddlflags"
23		rpathflag="-Wl,-rpath,"
24		ccdlflags="-Wl,-E $ccdlflags"
25	elif test -f /usr/libexec/ld.so; then
26		# a.out
27		d_dlopen=$define
28		d_dlerror=$define
29		cccdlflags="-DPIC -fPIC $cccdlflags"
30		lddlflags="-Bshareable $lddlflags"
31		rpathflag="-R"
32	else
33		d_dlopen=$undef
34		rpathflag=
35	fi
36	d_getprotoent_r="$undef"
37	d_getprotobyname_r="$undef"
38	d_getprotobynumber_r="$undef"
39	d_setprotoent_r="$undef"
40	d_endprotoent_r="$undef"
41	d_getservent_r="$undef"
42	d_getservbyname_r="$undef"
43	d_getservbyport_r="$undef"
44	d_setservent_r="$undef"
45	d_endservent_r="$undef"
46	d_gethostbyname_r="$undef"
47	d_gethostbyaddr2_r="$undef"
48	d_gethostbyaddr_r="$undef"
49	d_sethostent_r="$undef"
50	d_gethostent_r="$undef"
51	d_endhostent_r="$undef"
52	d_getprotoent_r_proto="0"
53	d_getprotobyname_r_proto="0"
54	d_getprotobynumber_r_proto="0"
55	d_setprotoent_r_proto="0"
56	d_endprotoent_r_proto="0"
57	d_getservent_r_proto="0"
58	d_getservbyname_r_proto="0"
59	d_getservbyport_r_proto="0"
60	d_setservent_r_proto="0"
61	d_endservent_r_proto="0"
62	d_gethostbyname_r_proto="0"
63	d_gethostbyaddr2_r_proto="0"
64	d_gethostbyaddr_r_proto="0"
65	d_sethostent_r_proto="0"
66	d_endhostent_r_proto="0"
67	d_gethostent_r_proto="0"
68	;;
69esac
70
71# there's no problem with vfork.
72usevfork=true
73
74# This is there but in machine/ieeefp_h.
75ieeefp_h="define"
76
77# This script UU/usethreads.cbu will get 'called-back' by Configure
78# after it has prompted the user for whether to use threads.
79cat > UU/usethreads.cbu <<'EOCBU'
80case "$usethreads" in
81$define|true|[yY]*)
82	lpthread=
83	for xxx in pthread; do
84		for yyy in $loclibpth $plibpth $glibpth dummy; do
85			zzz=$yyy/lib$xxx.a
86			if test -f "$zzz"; then
87				lpthread=$xxx
88				break;
89			fi
90			zzz=$yyy/lib$xxx.so
91			if test -f "$zzz"; then
92				lpthread=$xxx
93				break;
94			fi
95			zzz=`ls $yyy/lib$xxx.so.* 2>/dev/null`
96			if test "X$zzz" != X; then
97				lpthread=$xxx
98				break;
99			fi
100		done
101		if test "X$lpthread" != X; then
102			break;
103		fi
104	done
105	if test "X$lpthread" != X; then
106		# Add -lpthread.
107		libswanted="$libswanted $lpthread"
108		# There is no libc_r as of NetBSD 1.5.2, so no c -> c_r.
109		# This will be revisited when NetBSD gains a native pthreads
110		# implementation.
111	else
112		echo "$0: No POSIX threads library (-lpthread) found.  " \
113		     "You may want to install GNU pth.  Aborting." >&4
114		exit 1
115	fi
116	unset lpthread
117esac
118EOCBU
119
120# Set sensible defaults for Minix: look for local software in
121# /usr/local, plus the build prefix, which might or might not be
122# /usr/pkg.
123#
124loclibpth="/usr/local/lib ${prefix}/lib"
125locincpth="/usr/local/include ${prefix}/include"
126
127case "$rpathflag" in
128'')
129	ldflags=
130	;;
131*)
132	ldflags=
133	for yyy in $loclibpth; do
134		ldflags="$ldflags $rpathflag$yyy"
135	done
136	;;
137esac
138
139# malloc wrap works
140case "$usemallocwrap" in
141'') usemallocwrap='define' ;;
142esac
143
144# don't use perl malloc by default
145case "$usemymalloc" in
146'') usemymalloc=n ;;
147esac
148