This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get rid of the hasfield_t global variable
[metaconfig.git] / README
CommitLineData
e00c5fdc 1 Jarkko's How to build Configure tweaked by Nick and Merijn.
2eb0fc7c
MB
2
3The Configure script and config_h.SH file in the Perl distribution are
4generated by a program called metaconfig. Metaconfig was originally
5written by Larry Wall, and was subsequently enhanced and maintained
6by Raphael Manfredi.
13b7c768
NIS
7
8You have presumably obtained the metaconfig from the repository e.g.
6475898c
MB
9
10 $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
11
12or some other way to obtain this file, like a complete compressed archive
13from the previous pumpkin.
13b7c768
NIS
14
15Normally this directory and perl directory are next to each other
16so ../perl will get you to perl and ../perl/../metaconfig will get you
17back here.
18
2eb0fc7c
MB
19Contents of this directory:
20
21 README: This file.
07438c4f 22 U: Metaconfig units used for building Perl's Configure
2eb0fc7c
MB
23 U.check: Sample directory used for testing new metaconfig units.
24 see U.check/README for more information.
e00c5fdc
MB
25 dist-3.5-20:
26 dist-3.5-20 is almost meta-4.0, still maintained by Raphael
27 Manfredi, but with a lot of fixes over 3.0, some changes
1e695180
MB
28 from the perl modifications merged and a much better
29 metalint. This directory comes from a tar distribution.
30 dist-svn:
31 a git clone of "dist". Optionally present. See (a) below.
e412846d
MBT
32 This is where dist/meta resided before 2016-04-01
33 dist-git:
34 a git clone of "dist". Optionally present. See (a) below.
35 This is where dist/meta resides as of 2016-04-01
e00c5fdc
MB
36 dist:
37 a symlink to the lib you actually use. For Merijn that is
38 metaconfig/dist -> ../lib/dist
2eb0fc7c 39
13b7c768
NIS
40(a) You need to have dist installed so that you have metalint and metaconfig
41 in your $PATH.
e00c5fdc 42 The dist version used for perl is dist-3.5-20 in this directory, which is
e412846d
MBT
43 a slightly modified version of the original, which you can get at GITHUB
44 repository https://github.com/rmanfredi/dist.git. If you'd like to keep
45 up to date with changes in dist, you can use git to create your own clone.
46 For git, that would be something like:
1e695180 47
e412846d 48 $ git clone https://github.com/rmanfredi/dist.git dist-git
1e695180 49
13b7c768
NIS
50 Unsurprisingly 'dist' uses (its) Configure to generate itself:
51
e412846d 52 $ cd dist-3.5-20 # or dist-git
1e695180
MB
53 $ chmod -R +w . # We have derived files in git :-(
54 $ ./Configure
55 $ make
56 $ make install
13b7c768 57
e00c5fdc 58 After make install, remove lib/U/d_debugging.U in your target lib, as perl
07438c4f 59 uses its own way to set/define debugging (see INSTALL)
e00c5fdc
MB
60
61 the dist-3.5-20 installation as used by Merijn is available on his CPAN as
62 perl-meta-3.5-20.tgz
63
64 dist's 'Configure' is similar to perl's but perhaps not quite as polished.
13b7c768
NIS
65
66 There are some perl specific "dist units" in the 'U' directory.
e00c5fdc
MB
67 The U directory also contains some patches to 'dist' which have already
68 been applied to dist-3.5-20 directory.
69 We have not yet arranged for metaconfig to use perl's versions of the
70 'units' by default so you need some housekeeping in the perl directory...
71
352aa7ee
MB
72(aa) -- optional --
73
74 If you plan to make changes to metaconfig or metalint locally (and you
75 probably want to, as both are written for perl4), consider installing
76 mconfig and mlint from the cmon subdirectory into your $PATH too. These
77 are the non-autoloading versions and can easily be changed. Here is what
78 I added at the beginning of mconfig:
79
80 --8<---
81 BEGIN { $ENV{LC_ALL} = "C"; }
82 chdir "/pro/3gl/CPAN/perl";
83 { my @Cc = qw( Configure config_h.SH );
84 system "chown merijn @Cc";
85 chmod 0775, @Cc;
86 #-d "merijn" or mkdir "merijn";
87 #system "cp -f Configure config_h.SH Porting/Glossary Porting/config.sh merijn/";
88 system "ls", "-l", @Cc;
89 }
90 -->8---
91
cf3c5365 92 I also added the first two lines of that patch to mlint
352aa7ee 93
e00c5fdc
MB
94(b) You need to be in a/the Perl directory, i.e. either something from
95 //depot/perl/... or one of its branches
13b7c768
NIS
96 (e.g. Nick I-S is usually in //depot/perlio/...)
97 and you need:
98 1) have a symlink to ../metaconfig/U called U
99 2) have a symlink to ../metaconfig/.package called .package
100 3) have a symlink to MANIFEST called MANIFEST.new
2eb0fc7c 101 4) chmod +w Configure config_h.SH Porting/Glossary Porting/config*
13b7c768 102
6475898c
MB
103(c) Write the new unit as U/perl/d_bar.U ('perl' can also be 'modified',
104 'compline' or any other existing folder, except for 'all'). Choose
105 the best appropriate subdir of U. See U/README for a description of
106 the various subdirectories.)
13b7c768 107
352aa7ee
MB
108(d) Run metalint (or mlint) to see nits: as opposed to lint, the gripings
109 of metalint are usually serious :-) and need fixing
13b7c768
NIS
110
111 Exceptions are lots of
cb69034d 112 Your private U/modified/issymlink.U overrides the public one.
13b7c768
NIS
113 due to the perl special units
114
e00c5fdc
MB
115 an alias to something like
116 $ metalint |& grep -v -e '^ Your private U/'
352aa7ee
MB
117 will make the process silence up on that (of course you can add an
118 option to mlint to disable that warning (which is already disabled
119 by the undocumented and forgotten -s option, but that also suppresses
120 other warnings)
e00c5fdc 121
13b7c768
NIS
122 and
123
124 "End.U": stale ?MAKE: dependency '$W'.
125
126 which is apparently normal ...
127
6475898c
MB
128-- the next steps are in the perl folder
129
130(e) chmod +w Configure config_h.SH
13b7c768 131
352aa7ee 132(f) metaconfig -m to regenerate Configure (or mconfig -m)
13b7c768 133
b15dd5ec
MB
134(g) metaconfig does not deal with depends in config_h.SH, so some
135 reorganization is needed.
136
137 perl Porting/config_h.SH
138
139 will fix the ordering
140
141(h) The messy not-yet-automated part is that the knowledge of the new symbol
974341ad
JH
142 needs to be propagated to non-Configure lands like Win32, WinCE, Netware,
143 VMS, VOS, EPOC, ... see previous Configure changes to see which are these
144 heathen lands. Files to take care of are
145 {win32,wince,NetWare}/config_[hH]*, (Win32, WinCE, NetWare),
146 configure.com (VMS), VOS/config* (since 5.9 VOS uses Configure, though),
147 epoc/config.sh (EPOC). Depending on the kind of patch djgpp/config*
148 might also need adjusting (for example when adding/changing the list
149 of extensions)
13b7c768
NIS
150
151 For Win32 the process is semi-automated - if you have a Win32
152 machine to run dmake on ...
153
b15dd5ec 154(i) Edit U/mkglossary (right near the top) to point to where you keep
2eb0fc7c 155 dist's standard metaconfig units as well as your perl-specific ones.
13b7c768 156
b15dd5ec 157(j) Run U/mksample to freshen the Porting/config* and Porting/Glossary.
2eb0fc7c
MB
158 Adjust the various compile-time options (e.g. 64bit, threads) as
159 you see fit.
160 You can skip this phase, it's not essential, just good housekeeping.
13b7c768 161
cf3c5365
MB
162(k) Run the perl build chain
163
164 make veryclean
165 sh ./Configure -des -Dusedevel
166
167 The dependency for uconfig.h isn't carved in stone, so you might
168 need to regenerate it
169
170 perl regen/uconfig_h.pl
171
172 Then make and make test or make test_harness (with TEST_JOBS=5)
173
174 make all test_harness
175
176 Before you start committing, make sure that the other developers
177 are happy and run
178
179 make test_porting
6475898c
MB
180
181-- the next steps are in the metaconfig folder again
182
183(l) git add U/perl/foo/bar.U when you are ready ...
184
185(m) git commit -m "Your commit description"
13b7c768 186
6475898c
MB
187(n) When all patches are applied, tested and committed, and you are happy,
188 git push
13b7c768 189
6475898c 190 Merijn prefers to do steps (l) through (n) in git-gui