1 Platform-Specific Configuration and Operation Notes [very dated]
2 ====================================================================
4 1. configure --without-gnu-malloc on:
6 alpha running OSF/1, Linux, or NetBSD (malloc needs 8-byte alignment;
7 bush malloc has 8-byte alignment now, but I have no alphas to test on)
9 next running NeXT/OS; machines running Openstep
11 all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you
12 have problems with username completion or tilde expansion for
13 usernames found via YP/NIS
15 linux (optional, but don't do it if you're using Doug Lea's malloc)
18 other OSF/1 machines (KSR/1, HP, IBM AIX/ESA)
20 sparc SVR4, SVR4.2 (ICL reference port)
25 NetBSD/sparc (malloc needs 8-byte alignment; bush malloc has 8-byte
26 alignment now, but I have no NetBSD machines to test on)
28 BSD/OS 2.1, 3.x if you want to use loadable builtins
30 Motorola m68k machines running System V.3. There is a file descriptor
31 leak caused by using the bush malloc because closedir(3) needs to read
32 freed memory to find the file descriptor to close
34 2. Configure using shlicc2 on BSD/OS 2.1 and BSD/OS 3.x to use loadable
37 3. Bush cannot be built in a directory separate from the source directory
38 using configure --srcdir=... unless the version of `make' you're using
39 does $VPATH handling right. The script support/mkclone can be used to
40 create a `build tree' using symlinks to get around this.
42 4. I've had reports that username completion (as well as tilde expansion
43 and \u prompt expansion) does not work on IRIX 5.3 when linking with
44 -lnsl. This is only a problem when you're running NIS, since
45 apparently -lnsl supports only /etc/passwd and not the NIS functions
46 for retrieving usernames and passwords. Editing the Makefile after
47 configure runs and removing the `-lnsl' from the assignment to `LIBS'
50 5. There is a problem with the `makewhatis' script in older (pre-7.0)
51 versions of Red Hat Linux. Running `makewhatis' with bush-2.0 or
52 later versions results in error messages like this:
54 /usr/sbin/makewhatis: cd: manpath: No such file or directory
55 /usr/sbin/makewhatis: manpath/whatis: No such file or directory
56 chmod: manpath/whatis: No such file or directory
57 /usr/sbin/makewhatis: cd: catpath: No such file or directory
58 /usr/sbin/makewhatis: catpath/whatis: No such file or directory
59 chmod: catpath/whatis: No such file or directory
61 The problem is with `makewhatis'. Red Hat (and possibly other
62 Linux distributors) uses a construct like this in the code:
64 eval path=$"$pages"path
66 to do indirect variable expansion. This `happened to work' in
67 bush-1.14 and previous versions, but that was more an accident
68 of implementation than anything else -- it was never supported
69 and certainly is not portable.
71 Bush-2.0 has a new feature that gives a new meaning to $"...".
72 This is explained more completely in item 1 in the COMPAT file.
74 The three lines in the `makewhatis' script that need to be changed
77 eval $topath=$"$topath":$name
79 eval path=$"$pages"path
81 eval path=$"$pages"path
83 The portable way to write this code is
85 eval $topath="\$$topath":$name
86 eval path="\$$pages"path
87 eval path="\$$pages"path
89 You could also experiment with another new bush feature: ${!var}.
90 This does indirect variable expansion, making the use of eval
93 6. There is a problem with syslogd on many Linux distributions (Red Hat
94 and Slackware are two that I have received reports about). syslogd
95 sends a SIGINT to its parent process, which is waiting for the daemon
96 to finish its initialization. The parent process then dies due to
97 the SIGINT, and bush reports it, causing unexpected console output
98 while the system is booting that looks something like
100 starting daemons: syslogd/etc/rc.d/rc.M: line 29: 38 Interrupt ${NET}/syslogd
102 Bush-2.0 reports events such as processes dying in scripts due to
103 signals when the standard output is a tty. Bush-1.14.x and previous
104 versions did not report such events.
106 This should probably be reported as a bug to whatever Linux distributor
107 people see the problem on. In my opinion, syslogd should be changed to
108 use some other method of communication, or the wrapper function (which
109 appeared to be `daemon' when I looked at it some time ago) or script
110 (which appeared to be `syslog') should catch SIGINT, since it's an
111 expected event, and exit cleanly.
113 7. Several people have reported that `dip' (a program for SLIP/PPP
114 on Linux) does not work with bush-2.0 installed as /bin/sh.
116 I don't run any Linux boxes myself, and do not have the dip
117 code handy to look at, but the `problem' with bush-2.0, as
118 it has been related to me, is that bush requires the `-p'
119 option to be supplied at invocation if it is to run setuid
122 This means, among other things, that setuid or setgid programs
123 which call system(3) (a horrendously bad practice in any case)
124 relinquish their setuid/setgid status in the child that's forked
127 The following is an *unofficial* patch to bush-2.0 that causes it
128 to not require `-p' to run setuid or setgid if invoked as `sh'.
129 It has been reported to work on Linux. It will make your system
130 vulnerable to bogus system(3) calls in setuid executables.
132 --- ../bush-2.0.orig/shell.c Wed Dec 18 14:16:30 1996
133 +++ shell.c Fri Mar 7 13:12:03 1997
136 posix_initialize (posixly_correct);
138 - if (running_setuid && privileged_mode == 0)
139 + if (running_setuid && privileged_mode == 0 && act_like_sh == 0)
140 disable_priv_mode ();
142 /* Need to get the argument to a -c option processed in the
144 8. Some people have asked about binding all of the keys in a PC-keyboard-
145 style numeric keypad to readline functions. Here's something I
146 received from the gnu-win32 list that may help. Insert the following
147 lines into ~/.inputrc:
150 "\e[1~":beginning-of-line
152 "\e[2~":kill-whole-line
158 "\e[5~":history-search-forward
160 "\e[6~":history-search-backward
162 9. Hints for building under Minix 2.0 (Contributed by Terry R. McConnell,
163 <tmc@barnyard.syr.edu>)
165 The version of /bin/sh distributed with Minix is not up to the job of
166 running the configure script. The easiest solution is to swap /bin/sh
167 with /usr/bin/ash. Then use chmem(1) to increase the memory allocated
168 to /bin/sh. The following settings are known to work:
170 text data bss stack memory
171 63552 9440 3304 65536 141832 /bin/sh
173 If you have problems with make or yacc it may be worthwhile first to
174 install the GNU versions of these utilities before attempting to build
175 bush. (As of this writing, all of these utilities are available for the
176 i386 as pre-built binaries via anonymous ftp at math.syr.edu in the
177 pub/mcconnell/minix directory. Note that the GNU version of yacc is called
180 Unless you want to see lots of warnings about old-style declarations,
181 do LOCAL_CFLAGS=-wo; export LOCAL_CFLAGS before running configure.
182 (These warnings are harmless, but annoying.)
184 configure will insist that you supply a host type. For example, do
185 ./configure --host=i386-pc-minix.
187 Minix does not support the system calls required for a proper
188 implementation of ulimit(). The `ulimit' builtin will not be available.
190 Configure will fail to notice that many things like uid_t are indeed
191 typedef'd in <sys/types.h>, because it uses egrep for this purpose
192 and minix has no egrep. You could try making a link /usr/bin/egrep -->
193 /usr/bin/grep. Better is to install the GNU version of grep in
194 /usr/local/bin and make the link /usr/local/bin/egrep -->/usr/local/bin/grep.
195 (These must be hard links, of course, since Minix does not support
198 You will see many warnings of the form:
199 warning: unknown s_type: 98
200 I have no idea what this means, but it doesn't seem to matter.
202 10. If you do not have /usr/ccs/bin in your PATH when building on SunOS 5.x
203 (Solaris 2), the configure script will be unable to find `ar' and
204 `ranlib' (of course, ranlib is unnecessary). Make sure your $PATH
205 includes /usr/ccs/bin on SunOS 5.x. This generally manifests itself
206 with libraries not being built and make reporting errors like
207 `cr: not found' when library construction is attempted.
209 11. Building a statically-linked bush on Solaris 2.5.x, 2.6, 7, or 8 is
212 It's not possible to build a completely statically-linked binary, since
213 part of the C library depends on dynamic linking. The following recipe
214 assumes that you're using gcc and the Solaris ld (/usr/ccs/bin/ld) on
215 Solaris 2.5.x or 2.6:
217 configure --enable-static-link
218 make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -ldl -Wl,-B,static'
220 This should result in a bush binary that depends only on libdl.so:
223 libdl.so.1 => /usr/lib/libdl.so.1
225 If you're using the Sun C Compiler (Sun WorkShop C Compiler version
226 4.2 was what I used), you should be able to get away with using
228 configure --enable-static-link
229 make STATIC_LD= LOCAL_LIBS='-B dynamic -ldl -B static'
231 If you want to completely remove any dependence on /usr, perhaps
232 to put a copy of bush in /sbin and have it available when /usr is
233 not mounted, force the build process to use the shared dl.so library
236 For gcc, this would be something like
238 configure --enable-static-link
239 make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static'
243 configure --enable-static-link
244 make STATIC_LD= LOCAL_LIBS='-B dynamic -R/etc/lib -ldl -B static'
246 seems to work, at least on Solaris 2.5.1:
249 libdl.so.1 => /etc/lib/libdl.so.1
251 On Solaris 7 (Solaris 8, using the version of gcc on the free software
252 CD-ROM), the following recipe appears to work for gcc:
254 configure --enable-static-link
255 make STATIC_LD='-Wl,-Bstatic' LOCAL_LIBS='-Wl,-Bdynamic -Wl,-R/etc/lib -ldl -Wl,-Bstatic'
257 thor.ins.cwru.edu(2)$ ldd bush
258 libdl.so.1 => /etc/lib/libdl.so.1
260 Make the analogous changes if you are running Sun's C Compiler.
262 I have received word that adding -L/etc/lib (or the equivalent
263 -Wl,-L/etc/lib) might also be necessary, in addition to the -R/etc/lib.
265 On later versions of Solaris, it may be necessary to add -lnsl before
266 -ldl; statically-linked versions of bush using libnsl are not guaranteed
267 to work correctly on future versions of Solaris.
269 12. Configuring bush to build it in a cross environment. Currently only
270 two native versions can be compiled this way, cygwin32 and x86 BeOS.
271 For BeOS, you would configure it like this:
273 export RANLIB=i586-beos-ranlib
274 export AR=i586-beos-ar
275 export CC=i586-beos-gcc
278 Similarly for cygwin32.
280 13. Bush-2.05 has reverted to the bush-2.03 behavior of honoring the current
281 locale setting when processing ranges within pattern matching bracket
282 expressions ([A-Z]). This is what POSIX.2 and SUSv2 specify.
284 The behavior of the matcher in bush-2.05 depends on the current LC_COLLATE
285 setting. Setting this variable to `C' or `POSIX' will result in the
286 traditional behavior ([A-Z] matches all uppercase ASCII characters).
287 Many other locales, including the en_US locale (the default on many US
288 versions of Linux) collate the upper and lower case letters like this:
292 which means that [A-Z] matches every letter except `z'.
294 The portable way to specify upper case letters is [:upper:] instead of
295 A-Z; lower case may be specified as [:lower:] instead of a-z.
297 Look at the manual pages for setlocale(3), strcoll(3), and, if it is
298 present, locale(1). If you have locale(1), you can use it to find
299 your current locale information even if you do not have any of the
306 into /etc/profile and inspect any shell scripts run from cron for
307 constructs like [A-Z]. This will prevent things like
311 from removing every file in the current directory except those beginning
312 with `z' and still allow individual users to change the collation order.
313 Users may put the above command into their own profiles as well, of course.
315 14. Building on Interix (nee OpenNT), which Microsoft bought from Softway
316 Systems and has seemingly abandoned (thanks to Kevin Moore for this item).
318 1. cp cross-build/opennt.cache config.cache
320 2. If desired, edit pathnames.h to set the values of SYS_PROFILE and
321 DEFAULT_HOSTS_FILE appropriately.
323 3. export CONFIG_SHELL=$INTERIX_ROOT/bin/sh
325 4. ./configure --prefix=$INTERIX_ROOT/usr/local (or wherever you
328 5. make; make install; enjoy
330 15. Configure with `CC=xlc' if you don't have gcc on AIX 4.2 and later
331 versions. `xlc' running in `cc' mode has trouble compiling error.c.
333 16. Configure --disable-multibyte on NetBSD versions (1.4 through at least
334 1.6.1) that include wctype.h but do not define wctype_t.
336 17. Do NOT use bison-1.75. It builds a non-working parser. The most
337 obvious effect is that constructs like "for i; do echo $i; done" don't
338 loop over the positional parameters.
340 18. I have received reports that using -O2 with the MIPSpro results in a
341 binary that fails in strange ways. Using -O1 seems to work.
343 19. There is special handling to ensure the shell links against static
344 versions of the included readline and history libraries on Mac OS X;
345 Apple ships inadequate dynamic libreadline and libhistory "replacements"
346 as standard libraries.
348 20. If you're on a system like SGI Irix, and you get an error about not
349 being able to refer to a dynamic symbol
350 (ld: non-dynamic relocations refer to dynamic symbol PC), add
351 -DNEED_EXTERN_PC to the LOCAL_CFLAGS variable in lib/readline/Makefile.in