6.2 Brief introduction to portable sh
If you read a number of `configure.in's, you'll quickly notice that they tend to be written in an unusual style. For instance, you'll notice you hardly ever see the `[' program used; instead you'll see `test' invoked. We won't go into all the details of writing a portable shell script here; instead we leave that for 22. Writing Portable Bourne Shell.
Like other aspects of portability, the approach you take to writing
shell scripts in `configure.in' and `Makefile.am' should
depend on your goals. Some platforms have notoriously broken
Also, it doesn't really make sense to talk about portable
This seems daunting, but in practice it doesn't seem to be too hard to
write portable shell scripts -- once you've internalized the rules.
Unfortunately, this process can take a long time. Meanwhile, a
pragmatic `try and see' approach, while noting other portable code
you've seen elsewhere, works fairly well. Once again, it pays to be
aware of which architectures you'll probably care about -- you will make
different choices if you are writing an extremely portable program like