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