xref: /openbsd/gnu/usr.bin/perl/hints/bsdos.sh (revision e5dd7070)
1# hints/bsdos.sh
2#
3# hints file for BSD/OS (adapted from bsd386.sh)
4# Original by Neil Bowers <neilb@khoros.unm.edu>; Tue Oct  4 12:01:34 EDT 1994
5# Updated by Tony Sanders <sanders@bsdi.com>; Sat Aug 23 12:47:45 MDT 1997
6#     Added 3.1 with ELF dynamic libraries (NOT in 3.1 yet.
7#     Estimated for 4.0) SYSV IPC tested Ok so I re-enabled.
8#
9# Updated to work in post-4.0 by Todd C. Miller <millert@openbsd.org>
10#
11# Updated for threads by "Timur I. Bakeyev" <bsdi@listserv.bat.ru>
12#
13# To override the compiler on the command line:
14#     ./Configure -Dcc=gcc2
15#
16# The BSD/OS distribution is built with:
17#     ./Configure -des -Dbsdos_distribution=defined
18
19signal_t='void'
20d_voidsig='define'
21
22usemymalloc='n'
23
24# malloc wrap works
25case "$usemallocwrap" in
26'') usemallocwrap='define' ;;
27esac
28
29# setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions.
30# See man 2 setuid
31d_setregid='undef'
32d_setreuid='undef'
33d_setrgid='undef'
34d_setruid='undef'
35
36# we don't want to use -lnm, since exp() is busted (in 1.1 anyway)
37set `echo X "$libswanted "| sed -e 's/ nm / /'`
38shift
39libswanted="$*"
40
41# X libraries are in their own tree
42glibpth="$glibpth /usr/X11/lib"
43ldflags="$ldflags -L/usr/X11/lib"
44
45case "$optimize" in
46'')     optimize='-O2' ;;
47esac
48
49case "$bsdos_distribution" in
50''|undef|false)	;;
51*)
52	d_dosuid='define'
53	d_portable='undef'
54	prefix='/usr/contrib'
55	perlpath='/usr/bin/perl5'
56	startperl='#!/usr/bin/perl5'
57	scriptdir='/usr/contrib/bin'
58	privlib='/usr/libdata/perl5'
59	man1dir='/usr/contrib/man/man1'
60	man3dir='/usr/contrib/man/man3'
61	# phlib added by BSDI -- we share the *.ph include dir with perl4
62	phlib="/usr/libdata/perl5/site_perl/$(arch)-$osname/include"
63	phlibexp="/usr/libdata/perl5/site_perl/$(arch)-$osname/include"
64	;;
65esac
66
67case "$osvers" in
681.0*)
69	# Avoid problems with HUGE_VAL in POSIX in 1.0's cc.
70	POSIX_cflags='ccflags="$ccflags -UHUGE_VAL"'
71	;;
721.1*)
73	# Use gcc2
74	case "$cc" in
75	'')	cc='gcc2' ;;
76	esac
77	;;
782.0*|2.1*|3.0*|3.1*)
79	so='o'
80
81	# default to GCC 2.X w/shared libraries
82	case "$cc" in
83	'')	cc='shlicc2'
84		cccdlflags=' ' ;; # Avoid the dreaded -fpic
85	esac
86
87	# default ld to shared library linker
88	case "$ld" in
89	'')	ld='shlicc2'
90		lddlflags='-r' ;; # this one is necessary
91	esac
92
93	# Must preload the static shared libraries.
94	libswanted="Xpm Xaw Xmu Xt SM ICE Xext X11 $libswanted"
95	libswanted="rpc curses termcap $libswanted"
96	;;
974.*)
98	# ELF dynamic link libraries starting in 4.0
99        useshrplib='true'
100	so='so'
101	dlext='so'
102
103	case "$cc" in
104	'')	cc='cc'			# cc is gcc2 in 4.0
105		cccdlflags="-fPIC"
106		;;
107	esac
108
109	case "$ld" in
110	'')	ld='ld'
111		lddlflags="-shared -x $lddlflags" ;;
112	esac
113	# Due usage of static pointer from crt.o
114	libswanted="util $libswanted" ;;
115esac
116
117# This script UU/usethreads.cbu will get 'called-back' by Configure
118# after it has prompted the user for whether to use threads.
119cat > UU/usethreads.cbu <<'EOCBU'
120case "$usethreads" in
121$define|true|[yY]*)
122	case "$osvers" in
123	3.*|4.*)        ccflags="-D_REENTRANT -D_THREAD_SAFE -pthread $ccflags"
124	    ;;
125	*)   cat <<EOM >&4
126I did not know that BSD/OS $osvers supports POSIX threads.
127
128Feel free to tell https://github.com/Perl/perl5/issues otherwise.
129EOM
130	    exit 1
131	    ;;
132	esac
133	;;
134esac
135EOCBU
136