166830Sobrien# hints/sunos_4_1.sh
266830Sobrien# Last modified:  Wed May 27 11:00:02 EDT 1998
366830Sobrien# Andy Dougherty  <doughera@lafayette.edu>
466830Sobrien
566830Sobriencase "$cc" in
666830Sobrien*gcc*)	usevfork=false 
766830Sobrien	# GNU as and GNU ld might not work.  See the INSTALL file.
866830Sobrien	;;
966830Sobrien*)	usevfork=true ;;
1066830Sobrienesac
1166830Sobrien
1266830Sobrien# Configure finds getzname, not tzname.  If you're in the System V
1366830Sobrien# environment, you can set d_tzname='define' since tzname[] is
1466830Sobrien# available in the System V environment.
1566830Sobriend_tzname='undef'
1666830Sobrien
1766830Sobrien# unistd.h contains incorrect prototypes for some functions in the usual
1866830Sobrien# BSD-ish environment.  In particular, it has
1966830Sobrien# extern int	getgroups(/* int gidsetsize, gid_t grouplist[] */);
2066830Sobrien# but groupslist[] ought to be of type int, not gid_t.
2166830Sobrien# This is only really a problem for perl if the
2266830Sobrien# user is using gcc, and not running in the SysV environment.
2366830Sobrien# The gcc fix-includes script exposes those incorrect prototypes.
2466830Sobrien# There may be other examples as well.  Volunteers are welcome to
25100280Sgordon# track them all down :-).  In the meantime, we'll just skip unistd.h
2651231Ssheldonh# for SunOS in most of the code.   
2766830Sobrien# However, see ext/POSIX/hints/sunos_4.pl for one exception.
2866830Sobrieni_unistd='undef'
2943803Sdillon# See util.c for another:  We need _SC_OPEN_MAX, which is in
30127345Sbrooks# <unistd.h>.
31240336Sobrien
3275931Simp# fflush(NULL) will core dump on SunOS 4.1.3.  In util.c we'll
33240336Sobrien# try explicitly fflushing all open files.  Unfortunately,
34240336Sobrien# on my SunOS 4.1.3 system, sysconf(_SC_OPEN_MAX) returns
35127345Sbrooks# 64, but only 32 of those file pointers can be accessed 
3676409Sbsd# directly by _iob[i].  The remainder are off in dynamically
37127345Sbrooks# allocated memory somewhere and I don't know to automatically
38174464Sdougb# fflush() them.  -- Andy Dougherty  Wed May 26 15:25:22 EDT 1999
3976409Sbsdutil_cflags='ccflags="$ccflags -DPERL_FFLUSH_ALL_FOPEN_MAX=32"'
40127345Sbrooks
4143803Sdillon# The correct setting of groupstype depends on which version of the C
42165664Syar# library is used.  If you are in the 'System V environment'
43127345Sbrooks# (i.e. you have /usr/5bin ahead of /usr/bin in your PATH), and
44127345Sbrooks# you use Sun's cc compiler, then you'll pick up /usr/5bin/cc, which
45127345Sbrooks# links against the C library in /usr/5lib.  This library has
46127345Sbrooks# groupstype='gid_t'.
47127345Sbrooks# If you are in the normal BSDish environment, then you'll pick up
48127345Sbrooks# /usr/ucb/cc, which links against the C library in /usr/lib.  That
49127345Sbrooks# library has groupstype='int'.
50127345Sbrooks#
51127345Sbrooks# If you are using gcc, it links against the C library in /usr/lib
52127345Sbrooks# independent of whether or not you are in the 'System V environment'.
53108191Sdillon# If you want to use the System V libraries, then you need to 
54127345Sbrooks# manually set groupstype='gid_t' and add explicit references to 
55127345Sbrooks# /usr/5lib when Configure prompts you for where to look for libraries.
56127345Sbrooks#
57127345Sbrooks# Check if user is in a bsd or system 5 type environment
58108191Sdillonif cat -b /dev/null 2>/dev/null
59127345Sbrooksthen # bsd
60127345Sbrooks      groupstype='int'
61137451Skeramidaelse # sys5
62100285Sbsd    case "$cc" in
63127345Sbrooks	*gcc*) groupstype='int';; # gcc doesn't do anything special
64127345Sbrooks	*) groupstype='gid_t';; # /usr/5bin/cc pulls in /usr/5lib/ stuff.
65100285Sbsd    esac
66169923Srsefi
67127345Sbrooks
68127345Sbrooks# If you get the message "unresolved symbol '__lib_version' " while
69137451Skeramida# linking, your system probably has the optional 'acc' compiler (and
70127345Sbrooks# libraries) installed, but you are using the bundled 'cc' compiler with
71100285Sbsd# the unbundled libraries.  The solution is either to use 'acc' and the
72100285Sbsd# unbundled libraries (specifically /lib/libm.a), or 'cc' and the bundled
7375898Simp# library.
74127345Sbrooks# 
75127345Sbrooks# Thanks to William Setzer <William_Setzer@ncsu.edu> for this info.
76127345Sbrooks
77127345Sbrooks# Don't use the GNU ld, that doesn't work, you'll get a lot of
78127345Sbrooks# relocation truncated to fit: BASE13 ...
79165664Syar# from many extensions, like B and Data::Dumper.
80124149Sbrooksld=/usr/bin/ld
81127345Sbrooks
82142957Sbrooks# As of Perl 5.8.1 it seems that dynaloading is broken in SunOS 4.x, sniff.
83127345Sbrookscase "$usedl" in
84124149Sbrooks'') usedl=undef ;;
85127345Sbrooksesac
86127345Sbrooks
87142965Sbrooks