| [3181] | 1 | =head1 NAME
|
|---|
| 2 |
|
|---|
| 3 | README.hints
|
|---|
| 4 |
|
|---|
| 5 | =head1 DESCRIPTION
|
|---|
| 6 |
|
|---|
| 7 | These files are used by Configure to set things which Configure either
|
|---|
| 8 | can't or doesn't guess properly. Most of these hint files have been
|
|---|
| 9 | tested with at least some version of perl5, but some are still left
|
|---|
| 10 | over from perl4.
|
|---|
| 11 |
|
|---|
| 12 | Please send any problems or suggested changes to [email protected].
|
|---|
| 13 |
|
|---|
| 14 | =head1 Hint file naming convention.
|
|---|
| 15 |
|
|---|
| 16 | Each hint file name should have only
|
|---|
| 17 | one '.'. (This is for portability to non-unix file systems.) Names
|
|---|
| 18 | should also fit in <= 14 characters, for portability to older SVR3
|
|---|
| 19 | systems. File names are of the form $osname_$osvers.sh, with all '.'
|
|---|
| 20 | changed to '_', and all characters (such as '/') that don't belong in
|
|---|
| 21 | Unix filenames omitted.
|
|---|
| 22 |
|
|---|
| 23 | For example, consider Sun OS 4.1.3. Configure determines $osname=sunos
|
|---|
| 24 | (all names are converted to lower case) and $osvers=4.1.3. Configure
|
|---|
| 25 | will search for an appropriate hint file in the following order:
|
|---|
| 26 |
|
|---|
| 27 | sunos_4_1_3.sh
|
|---|
| 28 | sunos_4_1.sh
|
|---|
| 29 | sunos_4.sh
|
|---|
| 30 | sunos.sh
|
|---|
| 31 |
|
|---|
| 32 | If you need to create a hint file, please try to use as general a name
|
|---|
| 33 | as possible and include minor version differences inside case or test
|
|---|
| 34 | statements. For example, for IRIX 6.X, we have the following hints
|
|---|
| 35 | files:
|
|---|
| 36 |
|
|---|
| 37 | irix_6_0.sh
|
|---|
| 38 | irix_6_1.sh
|
|---|
| 39 | irix_6.sh
|
|---|
| 40 |
|
|---|
| 41 | That is, 6.0 and 6.1 have their own special hints, but 6.2, 6.3, and
|
|---|
| 42 | up are all handled by the same irix_6.sh. That way, we don't have to
|
|---|
| 43 | make a new hint file every time the IRIX O/S is upgraded.
|
|---|
| 44 |
|
|---|
| 45 | If you need to test for specific minor version differences in your
|
|---|
| 46 | hints file, be sure to include a default choice. (See aix.sh for one
|
|---|
| 47 | example.) That way, if you write a hint file for foonix 3.2, it might
|
|---|
| 48 | still work without any changes when foonix 3.3 is released.
|
|---|
| 49 |
|
|---|
| 50 | Please also comment carefully on why the different hints are needed.
|
|---|
| 51 | That way, a future version of Configure may be able to automatically
|
|---|
| 52 | detect what is needed.
|
|---|
| 53 |
|
|---|
| 54 | A glossary of config.sh variables is in the file Porting/Glossary.
|
|---|
| 55 |
|
|---|
| 56 | =head1 Setting variables
|
|---|
| 57 |
|
|---|
| 58 | =head2 Optimizer
|
|---|
| 59 |
|
|---|
| 60 | If you want to set a variable, try to allow for Configure command-line
|
|---|
| 61 | overrides. For example, suppose you think the default optimizer
|
|---|
| 62 | setting to be -O2 for a particular platform. You should allow for
|
|---|
| 63 | command line overrides with something like
|
|---|
| 64 |
|
|---|
| 65 | case "$optimize" in
|
|---|
| 66 | '') optimize='-O2' ;;
|
|---|
| 67 | esac
|
|---|
| 68 |
|
|---|
| 69 | or, if your system has a decent test(1) command,
|
|---|
| 70 |
|
|---|
| 71 | test -z "$optimize" && optimize='-O2'
|
|---|
| 72 |
|
|---|
| 73 | This allows the user to select a different optimization level, e.g.
|
|---|
| 74 | -O6 or -g.
|
|---|
| 75 |
|
|---|
| 76 | =head2 Compiler and Linker flags
|
|---|
| 77 |
|
|---|
| 78 | If you want to set $ccflags or $ldflags, you should append to the existing
|
|---|
| 79 | value to allow Configure command-line settings, e.g. use
|
|---|
| 80 |
|
|---|
| 81 | ccflags="$ccflags -DANOTHER_OPTION_I_NEED"
|
|---|
| 82 |
|
|---|
| 83 | so that the user can do something like
|
|---|
| 84 |
|
|---|
| 85 | sh Configure -Dccflags='FIX_NEGATIVE_ZERO'
|
|---|
| 86 |
|
|---|
| 87 | and have the FIX_NEGATIVE_ZERO value preserved by the hints file.
|
|---|
| 88 |
|
|---|
| 89 | =head2 Libraries
|
|---|
| 90 |
|
|---|
| 91 | Configure will attempt to use the libraries listed in the variable
|
|---|
| 92 | $libswanted. If necessary, you should remove broken libraries from
|
|---|
| 93 | that list, or add additional libraries to that list. You should
|
|---|
| 94 | *not* simply set $libs -- that ignores the possibilities of local
|
|---|
| 95 | variations. For example, a setting of libs='-lgdbm -lm -lc' would
|
|---|
| 96 | fail if another user were to try to compile Perl on a system without
|
|---|
| 97 | GDBM but with Berkeley DB. See hints/dec_osf.sh and hints/solaris_2.sh
|
|---|
| 98 | for examples.
|
|---|
| 99 |
|
|---|
| 100 | =head2 Other
|
|---|
| 101 |
|
|---|
| 102 | In general, try to avoid hard-wiring something that Configure will
|
|---|
| 103 | figure out anyway. Also try to allow for Configure command-line
|
|---|
| 104 | overrides.
|
|---|
| 105 |
|
|---|
| 106 | =head1 Working around compiler bugs
|
|---|
| 107 |
|
|---|
| 108 | Occasionally, the root cause of a bug in perl turns out to be due to a bug
|
|---|
| 109 | in the compiler. Often, changing the compilation options (particularly the
|
|---|
| 110 | optimization level) can work around the bug. However, if you try to do
|
|---|
| 111 | this on the command line, you will be changing the compilation options for
|
|---|
| 112 | every component of perl, which can really hurt perl's performance.
|
|---|
| 113 | Instead, consider placing a test case into the hints directory to detect
|
|---|
| 114 | whether the compiler bug is present, and add logic to the hints file to
|
|---|
| 115 | take a specific and appropriate action
|
|---|
| 116 |
|
|---|
| 117 | =head2 Test-case conventions
|
|---|
| 118 |
|
|---|
| 119 | Test cases should be named "tNNN.c", where NNN is the next unused sequence
|
|---|
| 120 | number. The test case must be executable and should display a message
|
|---|
| 121 | containing the word "fails" when the compiler bug is present. It should
|
|---|
| 122 | display the word "works" with the compiler bug is not present. The test
|
|---|
| 123 | cases should be liberally commented and may be used by any hints file that
|
|---|
| 124 | needs them. See the first hints file (t001.c) for an example.
|
|---|
| 125 |
|
|---|
| 126 | =head2 Hint file processing
|
|---|
| 127 |
|
|---|
| 128 | The hint file must define a call-back unit (see below) that will compile,
|
|---|
| |
|---|