xref: /openbsd-src/gnu/usr.bin/perl/hints/svr4.sh (revision 9f11ffb7133c203312a01e4b986886bc88c7d74b)
1# svr4 hints, System V Release 4.x
2# Last modified 1996/10/25 by Tye McQueen, tye@metronet.com
3# Merged 1998/04/23 with perl5.004_04 distribution by
4# Andy Dougherty <doughera@lafayette.edu>
5
6# Use Configure -Dcc=gcc to use gcc.
7case "$cc" in
8'') cc='/bin/cc'
9    test -f $cc || cc='/usr/ccs/bin/cc'
10    ;;
11esac
12
13# We include support for using libraries in /usr/ucblib, but the setting
14# of libswanted excludes some libraries found there.  If you run into
15# problems, you may have to remove "ucb" from libswanted.  Just delete
16# the comment '#' from the sed command below.
17ldflags='-L/usr/ccs/lib -L/usr/ucblib'
18ccflags='-I/usr/include -I/usr/ucbinclude'
19# Don't use problematic libraries:
20libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
21# libmalloc.a - Probably using Perl's malloc() anyway.
22# libucb.a - Remove it if you have problems ld'ing.  We include it because
23#   it is needed for ODBM_File and NDBM_File extensions.
24
25if [ -r /usr/ucblib/libucb.a ]; then	# If using BSD-compat. library:
26    gconvert_preference='gcvt sprintf'	# Try gcvt() before gconvert().
27    # Use the "native" counterparts, not the BSD emulation stuff:
28    d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
29    d_setlinebuf='undef'
30    # d_setregid='undef' d_setreuid='undef'  # ???
31fi
32
33# UnixWare has /usr/lib/libc.so.1, /usr/lib/libc.so.1.1, and
34# /usr/ccs/lib/libc.so.  Configure chooses libc.so.1.1 while it
35# appears that /usr/ccs/lib/libc.so contains more symbols:
36#
37# Try the following if you want to use nm-extraction.  We'll just
38# skip the nm-extraction phase, since searching for all the different
39# library versions will be hard to keep up-to-date.
40#
41# if [ "" = "$libc" -a -f /usr/ccs/lib/libc.so -a \
42#   -f /usr/lib/libc.so.1 -a -f /usr/lib/libc.so.1.1 ]; then
43#     if nm -h /usr/ccs/lib/libc.so | egrep '\<_?select$' >/dev/null; then
44# 	if nm -h /usr/lib/libc.so.1 | egrep '\<_?select$'` >/dev/null ||
45# 	   nm -h /usr/lib/libc.so.1.1 | egrep '\<_?select$'` >/dev/null; then
46# 	    :
47# 	else
48# 	    libc=/usr/ccs/lib/libc.so
49# 	fi
50#     fi
51# fi
52#
53#  Don't bother with nm.  Just compile & link a small C program.
54case "$usenm" in
55'') usenm=false;;
56esac
57
58# Broken C-Shell tests (Thanks to Tye McQueen):
59# The OS-specific checks may be obsoleted by the this generic test.
60	sh_cnt=`sh -c 'echo /*' | wc -c`
61	csh_cnt=`csh -f -c 'glob /*' 2>/dev/null | wc -c`
62	csh_cnt=`expr 1 + $csh_cnt`
63if [ "$sh_cnt" -ne "$csh_cnt" ]; then
64    echo "You're csh has a broken 'glob', disabling..." >&2
65    d_csh='undef'
66fi
67
68# Unixware-specific problems.  The undocumented -X argument to uname
69# is probably a reasonable way of detecting UnixWare.
70# UnixWare has a broken csh.  (This might already be detected above).
71# In Unixware 2.1.1 the fields in FILE* got renamed!
72# Unixware 1.1 can't cast large floats to 32-bit ints.
73# Configure can't detect memcpy or memset on Unixware 2 or 7
74#
75#    Leave leading tabs on the next two lines so Configure doesn't
76#    propagate these variables to config.sh
77	uw_ver=`uname -v`
78	uw_isuw=`uname -X 2>&1 | grep Release`
79
80if [ "$uw_isuw" = "Release = 4.2" ]; then
81   case $uw_ver in
82   1.1)
83      d_casti32='undef'
84      ;;
85   esac
86fi
87if [ "$uw_isuw" = "Release = 4.2MP" ]; then
88   case $uw_ver in
89   2.1)
90	d_csh='undef'
91	;;
92   2.1.*)
93	d_csh='undef'
94	stdio_cnt='((fp)->__cnt)'
95	d_stdio_cnt_lval='define'
96	stdio_ptr='((fp)->__ptr)'
97	d_stdio_ptr_lval='define'
98	;;
99   esac
100fi
101if [ "$uw_isuw" = "Release = 5" ]; then
102   case $uw_ver in
103   7)
104	d_csh='undef'
105	stdio_cnt='((fp)->__cnt)'
106	d_stdio_cnt_lval='define'
107	stdio_ptr='((fp)->__ptr)'
108	d_stdio_ptr_lval='define'
109	;;
110   esac
111fi
112# End of Unixware-specific tests.
113
114# DDE SMES Supermax Enterprise Server
115case "`uname -sm`" in
116"UNIX_SV SMES")
117    # the *grent functions are in libgen.
118    libswanted="$libswanted gen"
119    # csh is broken (also) in SMES
120    # This may already be detected by the generic test above.
121    d_csh='undef'
122    case "$cc" in
123    *gcc*) ;;
124    *)	# for cc we need -K PIC (not -K pic)
125 	cccdlflags="$cccdlflags -K PIC"
126	;;
127    esac
128    ;;
129esac
130
131# NCR MP-RAS.  Thanks to Doug Hendricks for this info.
132# The output of uname -a looks like this
133#	foo foo 4.0 3.0 3441 Pentium III(TM)-ISA/PCI
134# Similar errors reported for
135#       foo foo 4.0 3.0 4400 pentium ii(tm)-isapci '
136# and also for
137#	foo foo 4.2 1.1.2 shg2 386at
138# W. Geoffrey Rommel, 2003-09-09 reported:
139# I have talked to a developer at NCR, and there seems to be no
140# reliable way to make sure that this is really MP-RAS. It's not
141# in uname, it's not in the kernel, it's not in sysinfo ...
142# However, the files /etc/issue and /etc/.relid are present in MP-RAS.
143#
144# Other System V-derived systems may have /etc/issue, but /etc/.relid
145# may well be unique.  Configure-time tests for the POSIX
146# _mwoflocheckl issue (see ext/POSIX/hints/svr4.pl) would be appreciated.
147#
148if test -f /etc/issue -a -f /etc/.relid; then
149    # libcrypt contains nothing libc wouldn't have.
150    libswanted=`echo " $libswanted " | sed -e 's/ crypt / /'`
151    # With the NCR High Performance C Compiler R3.0c, miniperl fails
152    # t/op/regexp.t test 461 unless we compile with optimize=-O0.
153    # Volunteers are needed to determine just which files need special
154    # treatment.  For now, use optimize=-O0 for everything.
155    #
156    d_usleep='undef'
157    d_ualarm='undef'
158    case "$optimize" in
159    '') optimize='-O0' ;;
160    esac
161fi
162
163# Configure may fail to find lstat() since it's a static/inline function
164# in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
165# SVR4 derivatives.  (Though UnixWare has it in /usr/ccs/lib/libc.so.)
166d_lstat=define
167
168d_suidsafe='define'	# "./Configure -d" can't figure this out easily
169
170