Commit | Line | Data |
fec02dd3 |
1 | # machten.sh |
a55e790a |
2 | # This is for MachTen 4.0.3. It might work on other versions and variants too. |
db90f03e |
3 | # |
a55e790a |
4 | # Users of earlier MachTen versions might need a fixed tr from ftp.tenon.com. |
5 | # This should be described in the MachTen release notes. |
db90f03e |
6 | # |
7 | # MachTen 2.x has its own hint file. |
8 | # |
9 | # This file has been put together by Andy Dougherty |
10 | # <doughera@lafcol.lafayette.edu> based on comments from lots of |
11 | # folks, especially |
12 | # Mark Pease <peasem@primenet.com> |
13 | # Martijn Koster <m.koster@webcrawler.com> |
14 | # Richard Yeh <rcyeh@cco.caltech.edu> |
baf67fda |
15 | # |
38ac2dc8 |
16 | # Use vfork and perl's malloc by default |
17 | # -- Dominic Dunlop <domo@computer.org> 980630 |
83e898de |
18 | # Raise perl's stack size again; cut down reg_infty; document |
19 | # -- Dominic Dunlop <domo@computer.org> 980619 |
2ff233fa |
20 | # Use of semctl() can crash system: disable -- Dominic Dunlop 980506 |
da9788ee |
21 | # Raise stack size further; slight tweaks to accomodate MT 4.1 |
22 | # -- Dominic Dunlop <domo@computer.org> 980211 |
a55e790a |
23 | # Raise perl's stack size -- Dominic Dunlop <domo@tcp.ip.lu> 970922 |
44a8e56a |
24 | # Reinstate sigsetjmp iff version is 4.0.3 or greater; use nm |
25 | # (assumes Configure change); prune libswanted -- Dominic Dunlop 970113 |
26 | # Warn about test failure due to old Berkeley db -- Dominic Dunlop 970105 |
55497cff |
27 | # Do not use perl's malloc; SysV IPC OK -- Neil Cutcliffe, Tenon 961030 |
28 | # File::Find's use of link count disabled by Dominic Dunlop 960528 |
29 | # Perl's use of sigsetjmp etc. disabled by Dominic Dunlop 960521 |
db90f03e |
30 | # |
fec02dd3 |
31 | # Comments, questions, and improvements welcome! |
32 | # |
db90f03e |
33 | # MachTen 4.X does support dynamic loading, but perl doesn't |
34 | # know how to use it yet. |
55497cff |
35 | |
36 | # Power MachTen is a real memory system and its standard malloc |
37 | # has been optimized for this. Using this malloc instead of Perl's |
38ac2dc8 |
38 | # malloc may result in significant memory savings. In particular, |
39 | # unlike most UNIX memory allocation subsystems, MachTen's free() |
40 | # really does return unneeded process data memory to the system. |
41 | # However, MachTen's malloc() is woefully slow -- maybe 100 times |
42 | # slower than perl's own, so perl's own is usually the better |
43 | # choice. In order to use perl's malloc(), the sbrk() system call |
44 | # must be simulated using MachTen's malloc(). See malloc.c for |
45 | # precise details of how this is achieved. Recent improvements |
46 | # to perl's malloc() currently crash MachTen, and so are disabled |
47 | # by -DPLAIN_MALLOC and -DNO_FANCY_MALLOC. |
48 | usemymalloc=${usemymalloc:-y} |
49 | |
50 | # Do not wrap the following long line |
51 | malloc_cflags='ccflags="$ccflags -DPLAIN_MALLOC -DNO_FANCY_MALLOC -DUSE_PERL_SBRK"' |
52 | |
53 | # Note that an empty malloc_cflags appears in config.sh if perl's |
54 | # malloc() is not used. his is harmless. |
55 | case "$usemymalloc" in |
56 | n) unset malloc_cflags;; |
57 | *) ccflags="$ccflags -DHIDEMYMALLOC" |
58 | esac |
59 | |
60 | # When MachTen does a fork(), it immediately copies the whole of |
61 | # the parent process' data space for the child. This can be |
62 | # expensive. Using vfork() where appropriate avoids this cost. |
63 | d_vfork=${d_vfork:-define} |
64 | |
65 | # Specify a high level of optimization (-O3 wouldn't do much more) |
66 | optimize=${optimize:--O2 -fomit-frame-pointer} |
c07a80fd |
67 | |
44a8e56a |
68 | # Make symbol table listings les voluminous |
69 | nmopts=-gp |
c07a80fd |
70 | |
83e898de |
71 | # Set reg_infty -- the maximum allowable number of repeats in regular |
72 | # expressions such as /a{1,$max_repeats}/, and the maximum number of |
73 | # times /a*/ will match. Setting this too high without having a stack |
74 | # large enough to accommodate deep recursion in the regular expression |
75 | # engine allows perl to crash your Mac due to stack overrun if it |
76 | # encounters a pathological regular expression. The default is a |
77 | # compromise between capability and required stack size (see below). |
78 | # You may override the default value from the Configure command-line |
79 | # like this: |
80 | # |
81 | # Configure -Dreg_infty=16368 ... |
82 | |
83 | reg_infty=${reg_infty:-2047} |
84 | |
85 | # If you want to have many perl processes active simultaneously -- |
86 | # processing CGI forms -- for example, you should opt for a small stack. |
87 | # For safety, you should set reg_infty no larger than the corresponding |
88 | # value given in this table: |
89 | # |
90 | # Stack size reg_infty value supported |
91 | # ---------- ------------------------- |
92 | # 128k 2**8-1 (256) |
93 | # 256k 2**9-1 (511) |
94 | # 512k 2**10-1 (1023) |
95 | # 1M 2**11-1 (2047) |
96 | # ... |
97 | # 16M 2**15-1 (32767) (perl's default value) |
98 | |
99 | # This script selects a safe stack size based on the value of reg_infty |
100 | # specified above. However, you may choose to take a risk and set |
101 | # stack size lower: pathological regular expressions are rare in real-world |
102 | # programs. But be aware that, if perl does encounter one, it WILL |
103 | # crash your system. Do not set stack size lower than 96k unless |
104 | # you want perl's installation tests ( make test ) to crash your system. |
105 | # |
106 | # You may override the default value from the Configure command-line |
107 | # by specifying the required size in kilobytes like this: |
108 | # |
109 | # Configure -Dstack_size=96 |
110 | |
111 | if [ "X$stack_size" = 'X' ] |
112 | then |
113 | stack_size=128 |
114 | X=`expr $reg_infty / 256` |
115 | |
116 | while [ $X -gt 0 ] |
117 | do |
118 | X=`expr $X / 2` |
119 | stack_size=`expr $stack_size \* 2` |
120 | done |
38ac2dc8 |
121 | X=`expr $stack_size \* 1024` |
83e898de |
122 | fi |
123 | |
83e898de |
124 | ldflags="$ldflags -Xlstack=$X" |
125 | ccflags="$ccflags -DREG_INFTY=$reg_infty" |
a55e790a |
126 | |
55497cff |
127 | # Install in /usr/local by default |
128 | prefix='/usr/local' |
129 | |
db90f03e |
130 | # At least on PowerMac, doubles must be aligned on 8 byte boundaries. |
131 | # I don't know if this is true for all MachTen systems, or how to |
132 | # determine this automatically. |
133 | alignbytes=8 |
baf67fda |
134 | |
44a8e56a |
135 | # 4.0.2 and earlier had a problem with perl's use of sigsetjmp and |
baf67fda |
136 | # friends. Use setjmp and friends instead. |
44a8e56a |
137 | expr "$osvers" \< "4.0.3" > /dev/null && d_sigsetjmp='undef' |
138 | |
2ff233fa |
139 | # semctl(.., .., IPC_STATUS, ..) hangs system: say we don't have semctl() |
140 | d_semctl='undef' |
141 | |
44a8e56a |
142 | # Get rid of some extra libs which it takes Configure a tediously |
143 | # long time never to find on MachTen |
144 | set `echo X "$libswanted "|sed -e 's/ net / /' -e 's/ socket / /' \ |
145 | -e 's/ inet / /' -e 's/ nsl / /' -e 's/ nm / /' -e 's/ malloc / /' \ |
146 | -e 's/ ld / /' -e 's/ sun / /' -e 's/ posix / /' \ |
147 | -e 's/ cposix / /' -e 's/ crypt / /' \ |
148 | -e 's/ ucb / /' -e 's/ bsd / /' -e 's/ BSD / /' -e 's/ PW / /'` |
149 | shift |
150 | libswanted="$*" |
baf67fda |
151 | |
da9788ee |
152 | # While link counts on MachTen 4.1's fast file systems work correctly, |
153 | # on Macintosh Heirarchical File Systems, (and on HFS+) |
baf67fda |
154 | # MachTen always reports ony two links to directories, even if they |
155 | # contain subdirectories. Consequently, we use this variable to stop |
156 | # File::Find using the link count to determine whether there are |
157 | # subdirectories to be searched. This will generate a harmless message: |
158 | # Hmm...You had some extra variables I don't know about...I'll try to keep 'em. |
159 | # Propagating recommended variable dont_use_nlink |
160 | dont_use_nlink=define |
161 | |
83e898de |
162 | cat <<EOM >&4 |
baf67fda |
163 | |
2ff233fa |
164 | During Configure, you may see the message |
165 | |
166 | *** WHOA THERE!!! *** |
83e898de |
167 | The recommended value for \$d_semctl on this machine was "undef"! |
2ff233fa |
168 | Keep the recommended value? [y] |
169 | |
170 | Select the default answer: semctl() is buggy, and perl should be built |
171 | without it. |
baf67fda |
172 | |
38ac2dc8 |
173 | Similarly, when you see |
174 | |
175 | *** WHOA THERE!!! *** |
176 | The recommended value for \$d_vfork on this machine was "define"! |
177 | Keep the recommended value? [y] |
178 | |
179 | select the default answer: vfork() works, and avoids expensive data |
180 | copying. |
181 | |
baf67fda |
182 | At the end of Configure, you will see a harmless message |
183 | |
184 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em. |
185 | Propagating recommended variable dont_use_nlink |
44a8e56a |
186 | Propagating recommended variable nmopts |
38ac2dc8 |
187 | Propagating recommended variable malloc_cflags... |
83e898de |
188 | Propagating recommended variable reg_infty |
44a8e56a |
189 | Read the File::Find documentation for more information about dont_use_nlink |
baf67fda |
190 | |
83e898de |
191 | Your perl will be built with a stack size of ${stack_size}k and a regular |
192 | expression repeat count limit of $reg_infty. If you want alternative |
193 | values, see the file hints/machten.sh for advice on how to change them. |
194 | |
2ff233fa |
195 | Tests |
196 | io/fs test 4 and |
197 | op/stat test 3 |
198 | may fail since MachTen may not return a useful nlinks field to stat |
199 | on directories. |
200 | |
baf67fda |
201 | EOM |
2ff233fa |
202 | expr "$osvers" \< "4.1" >/dev/null && test -r ./broken-db.msg && \ |
203 | . ./broken-db.msg |
83e898de |
204 | |
205 | unset stack_size X |