xref: /openbsd/gnu/usr.bin/perl/hints/dcosx.sh (revision 3cab2bb3)
1# hints/dcosx.sh
2# Last modified:  Thu Jan 16 11:38:12 EST 1996
3# Stephen Zander  <stephen.zander@interlock.mckesson.com>
4# hints for DC/OSx (Pyramid) & SINIX (Seimens: dc/osx rebadged)
5# Based on the hints/solaris_2.sh file
6
7# See man vfork.
8usevfork=false
9
10d_suidsafe=define
11
12# Avoid all libraries in /usr/ucblib.
13set `echo $glibpth | sed -e 's@/usr/ucblib@@'`
14glibpth="$*"
15
16# Remove bad libraries.
17# -lucb contains incompatible routines.
18set `echo " $libswanted " | sed -e 's@ ucb @ @'`
19libswanted="$*"
20
21# Here's another draft of the perl5/solaris/gcc sanity-checker.
22
23case $PATH in
24*/usr/ucb*:/usr/bin:*|*/usr/ucb*:/usr/bin) cat <<END >&2
25
26NOTE:  /usr/ucb/cc does not function properly.
27Remove /usr/ucb from your PATH.
28
29END
30;;
31esac
32
33
34# Check that /dev/fd is mounted.  If it is not mounted, let the
35# user know that suid scripts may not work.
36/usr/bin/df /dev/fd 2>&1 > /dev/null
37case $? in
380) ;;
39*)
40      cat <<END >&4
41
42NOTE: Your system does not have /dev/fd mounted.  If you want to
43be able to use set-uid scripts you must ask your system administrator
44to mount /dev/fd.
45
46END
47      ;;
48esac
49
50
51# See if libucb can be found in /usr/lib.  If it is, warn the user
52# that this may cause problems while building Perl extensions.
53/usr/bin/ls /usr/lib/libucb* >/dev/null 2>&1
54case $? in
550)
56      cat <<END >&4
57
58NOTE: libucb has been found in /usr/lib.  libucb should reside in
59/usr/ucblib.  You may have trouble while building Perl extensions.
60
61END
62;;
63esac
64
65
66# See if make(1) is GNU make(1).
67# If it is, make sure the setgid bit is not set.
68make -v > make.vers 2>&1
69if grep GNU make.vers > /dev/null 2>&1; then
70    tmp=`/usr/bin/ksh -c "whence make"`
71    case "`/usr/bin/ls -l $tmp`" in
72    ??????s*)
73          cat <<END >&2
74      
75NOTE: Your PATH points to GNU make, and your GNU make has the set-group-id
76bit set.  You must either rearrange your PATH to put /usr/ccs/bin before the
77GNU utilities or you must ask your system administrator to disable the
78set-group-id bit on GNU make.
79
80END
81          ;;
82    esac
83fi
84rm -f make.vers
85
86# If the C compiler is gcc:
87#   - check the fixed-includes
88#   - check as(1) and ld(1), they should not be GNU
89# If the C compiler is not gcc:
90#   - check as(1) and ld(1), they should not be GNU
91#   - increase the optimizing level to prevent object size warnings
92#
93# Watch out in case they have not set $cc.
94case "`${cc:-cc} -v 2>&1`" in
95*gcc*)
96      #
97      # Using gcc.
98      #
99      #echo Using gcc
100
101      # Get gcc to share its secrets.
102      echo 'main() { return 0; }' > try.c
103      verbose=`${cc:-cc} -v -o try try.c 2>&1`
104      rm -f try try.c
105      tmp=`echo "$verbose" | grep '^Reading' |
106              awk '{print $NF}'  | sed 's/specs$/include/'`
107
108      # Determine if the fixed-includes look like they'll work.
109      # Doesn't work anymore for gcc-2.7.2.
110
111      # See if as(1) is GNU as(1).  GNU as(1) won't work for this job.
112      case $verbose in
113      */usr/ccs/bin/as*) ;;
114      *)
115          cat <<END >&2
116
117NOTE: You are using GNU as(1).  GNU as(1) will not build Perl.
118You must arrange to use /usr/ccs/bin/as, perhaps by setting
119GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command.
120
121END
122      ;;
123      esac
124
125      # See if ld(1) is GNU ld(1).  GNU ld(1) won't work for this job.
126      case $verbose in
127      */usr/ccs/bin/ld*) ;;
128      *)
129          cat <<END >&2
130
131NOTE: You are using GNU ld(1).  GNU ld(1) will not build Perl.
132You must arrange to use /usr/ccs/bin/ld, perhaps by setting
133GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command.
134
135END
136      ;;
137      esac
138
139      ;; #using gcc
140*)
141      optimize='-O -K Olimit:3064'
142      #
143      # Not using gcc.
144      #
145      #echo Not using gcc
146
147      # See if as(1) is GNU as(1).  GNU as(1) won't work for this job.
148      case `as --version < /dev/null 2>&1` in
149      *GNU*)
150              cat <<END >&2
151
152NOTE: You are using GNU as(1).  GNU as(1) will not build Perl.
153You must arrange to use /usr/ccs/bin, perhaps by adding it to the
154beginning of your PATH.
155
156END
157              ;;
158      esac
159
160      # See if ld(1) is GNU ld(1).  GNU ld(1) won't work for this job.
161      case `ld --version < /dev/null 2>&1` in
162      *GNU*)
163              cat <<END >&2
164
165NOTE: You are using GNU ld(1).  GNU ld(1) will not build Perl.
166You must arrange to use /usr/ccs/bin, perhaps by adding it to the
167beginning of your PATH
168
169END
170              ;;
171      esac
172
173      ;; #not using gcc
174esac
175
176# as --version or ld --version might dump core.
177rm -f core
178
179# DC/OSx hides certain functions in a libc that looks dynamic but isn't
180# because of this we reinclude -lc when building dynamic extensions
181libc='/usr/ccs/lib/libc.so'
182lddlflags='-G -lc'
183
184# DC/OSx gets overenthusiastic with symbol removal when building dynamically
185ccdlflags='-Blargedynsym'
186
187# System malloc is safer when using third part libs
188usemymalloc='n'
189