This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
BeOS update (Mirror maint-5.005 change #2727).
[perl5.git] / hints / sco.sh
1 # sco.sh
2 # Courtesy of Joel Rosi-Schwartz <j.schwartz@agonet.it>
3
4 # Additional SCO version info from
5 # Peter Wolfe   <wolfe@teloseng.com>
6 # Last revised
7 # Fri Jul 19 14:54:25 EDT 1996
8 # and again Tue Sep 29 16:37:25 EDT 1998
9 # by Andy Dougherty  <doughera@lafayette.edu>
10
11 # To use gcc, use   sh Configure -Dcc=gcc
12 # To use icc, use   sh Configure -Dcc=icc
13
14 # figure out what SCO version we are. The output of uname -X is
15 # something like:
16 #       System = SCO_SV
17 #       Node = xxxxx
18 #       Release = 3.2v5.0.0
19 #       KernelID = 95/08/08
20 #       Machine = Pentium
21 #       BusType = ISA
22 #       Serial = xxxxx
23 #       Users = 5-user
24 #       OEM# = 0
25 #       Origin# = 1
26 #       NumCPU = 1
27
28 # Use /bin/uname (because GNU uname may be first in $PATH and
29 # it does not support -X) to figure out what SCO version we are:
30 case `/bin/uname -X | egrep '^Release'` in
31 *3.2v4.*) scorls=3 ;;   # I don't know why this is 3 instead of 4.
32 *3.2v5.*) scorls=5 ;;
33 *) scorls=5 ;; # Hope the future will be compatible.
34 esac
35
36 # Try to use libintl.a since it has strcoll and strxfrm
37 libswanted="intl $libswanted"
38 # Try to use libdbm.nfs.a since it has dbmclose.
39 #
40 if test -f /usr/lib/libdbm.nfs.a ; then
41     libswanted=`echo "dbm.nfs $libswanted " | sed -e 's/ dbm / /'`
42     set X $libswanted
43     shift
44     libswanted="$*"
45 fi
46
47 # We don't want Xenix cross-development libraries
48 glibpth=`echo $glibpth | sed -e 's! /usr/lib/386 ! !' -e 's! /lib/386 ! !'`
49 xlibpth=''
50
51 # Common fix for all compilers.
52 ccflags="$ccflags -U M_XENIX"
53
54 # Set flags for optimization and warning levels.
55 case "$cc" in
56 *gcc*)  case "$optimize" in
57         '') optimize='-O2' ;;
58         esac
59         ;;
60 scocc)  ;;  # Anybody know anything about this?
61 *)      # icc or cc  -- only relevant difference is safe level of
62         # optimization.  Apparently.
63         case $scorls in
64         3)  ccflags="$ccflags -W0 -quiet" ;;
65         *)  ccflags="$ccflags -w0 -DPERL_SCO5" ;;
66         esac
67         case "$optimize" in
68         '') case "$cc" in
69             icc) optimize="-O1" ;;
70             *) optimize="-O0" ;;
71             esac
72             ;;
73         esac
74         ;;
75 esac
76
77 # DYNAMIC LOADING:  Dynamic loading won't work with scorls=3.
78 # It ought to work with Release = 3.2v5.0.0 or later.
79 if test "$scorls" = "3" -a "X$usedl" = "X"; then
80     usedl=$undef
81 else
82     # I do not know exactly which of these are essential,
83     # but this set has been recommended. --AD
84     # These ought to be patched back into metaconfig, but the
85     # current metaconfig units don't touch ccflags.
86     # Unfortunately, the default on SCO is to produce COFF output, but
87     # ELF is needed for dynamic loading, and the cc man page recommends
88     # "Always specify option -b elf if ELF and COFF files might be mixed."
89     # Therefore, we'll compile everything with -b elf.
90     case "$cc" in
91     *gcc*)  ;;
92     *)  ccflags="$ccflags -b elf" ;;
93     esac
94     cccdlflags=none
95     ccdlflags='-W l,-Bexport'
96     lddlflags="$lddlflags -b elf -G"
97     ldflags="$ldflags -b elf -W l,-Bexport"
98     dlext='so'
99     dlsrc='dl_dlopen.xs'
100     d_dlerror='define'
101     d_dlopen='define'
102     usedl='define'
103 fi
104
105 # I have received one report that nm extraction doesn't work if you're
106 # using the scocc compiler.  This system had the following 'myconfig'
107 # uname='xxx xxx 3.2 2 i386 '
108 # cc='scocc', optimize='-O'
109 # You can override this with Configure -Dusenm.
110 case "$usenm" in
111 '') usenm='false' ;;
112 esac
113
114 # If you want to use nm, you'll probably have to use nm -p.  The
115 # following does that for you:
116 nm_opt='-p'
117
118 # I have received one report that you can't include utime.h in
119 # pp_sys.c.  Uncomment the following line if that happens to you:
120 # i_utime=undef
121
122 # Perl 5.003_05 and later try to include both <time.h> and <sys/select.h>
123 # in pp_sys.c, but that fails due to a redefinition of struct timeval.
124 # This will generate a WHOA THERE.  Accept the default.
125 i_sysselct=$undef