Permalink
Newer
Older
100644 515 lines (351 sloc) 12.1 KB
3
# Copyright (C) 2001-2006, The Perl Foundation.
6
=head1 NAME
8
Configure.pl - Parrot's Configuration Script
10
=head1 SYNOPSIS
12
% perl Configure.pl [options]
Leopold Toetsch
Oct 28, 2003
13
14
=head1 DESCRIPTION
16
This is Parrot's configuration program. It should be run to create
17
the necessary system-specific files before building Parrot.
Michael Scott
Mar 17, 2004
21
General Options
23
=over
25
=item C<--help>
27
Prints out a description of the options and exits.
29
=item C<--version>
May 24, 2002
30
31
Prints out the version number of Configure.pl and exits.
33
=item C<--verbose>
35
Tells Configure.pl to output extra information about the configuration data it
36
is setting.
40
Tells Configure.pl to output information about i<every> setting added or
43
=item C<--verbose-step={N|regex}>
44
45
Run C<--verbose=2> for step number C<N> or matching description.
46
47
=item C<--nomanicheck>
49
Tells Configure.pl not to run the MANIFEST check.
51
=item C<--prefix>
52
53
Sets the location where parrot will be installed.
54
59
=back
Michael Scott
Mar 17, 2004
61
Compile Options
63
=over
65
=item C<--debugging=0>
67
Debugging is turned on by default. Use this to disable it.
69
=item C<--parrot_is_shared>
70
71
Link parrot dynamically.
72
73
=item C<--m=32>
74
75
Create a 32-bit executable on 64-architectures like x86_64. This
76
option appends -m32 to compiler and linker programs and does
77
s/lib64/lib/g on link flags.
78
79
This option is experimental. See F<config/init/defaults.pm> for more.
80
81
=item C<--profile>
82
83
Turn on profiled compile (gcc only for now)
84
85
=item C<--optimize>
87
Add perl5's $Config{optimize} to the compiler flags.
88
89
=item C<--optimize=flags>
90
91
Add C<flags> to the compiler flags.
92
93
=item C<--inline>
94
95
Tell Configure that the compiler supports C<inline>.
96
97
=item C<--cc=(compiler)>
98
99
Specify which compiler to use.
100
101
=item C<--ccflags=(flags)>
102
103
Use the given compiler flags.
104
105
=item C<--ccwarn=(flags)>
106
107
Use the given compiler warning flags.
108
109
=item C<--cxx=(compiler)>
110
111
Specify which C++ compiler to use (for ICU).
112
113
=item C<--libs=(libs)>
114
115
Use the given libraries.
116
117
=item C<--link=(linker)>
118
119
Specify which linker to use.
120
121
=item C<--linkflags=(flags)>
122
123
Use the given linker flags
124
125
=item C<--ld=(linker)>
126
127
Specify which loader to use for shared libraries.
128
129
=item C<--ldflags=(flags)>
130
131
Use the given loader flags for shared libraries
132
133
=item C<--lex=(lexer)>
134
135
Specify which lexer to use.
136
137
=item C<--yacc=(parser)>
138
139
Specify which parser to use.
Leopold Toetsch
Feb 28, 2004
140
141
=item C<--define=val1[,val2]>
142
143
Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
144
needed to use inet_aton for systems that lack inet_pton:
145
146
--define=inet_aton
147
148
=back
149
Michael Scott
Mar 17, 2004
150
Parrot Options
154
=item C<--intval=(type)>
155
156
Use the given type for C<INTVAL>.
157
158
=item C<--floatval=(type)>
159
160
Use the given type for C<FLOATVAL>.
161
162
=item C<--opcode=(type)>
163
164
Use the given type for opcodes.
165
166
=item C<--ops=(files)>
167
168
Use the given ops files.
169
170
=item C<--pmc=(files)>
172
Use the given PMC files.
173
174
=item C<--cgoto=0>
175
176
Don't build cgoto core. This is recommended when you are short of memory.
177
178
=item C<--jitcapable>
179
180
Use JIT system.
181
182
=item C<--execcapable>
183
Leopold Toetsch
Feb 28, 2004
184
Use JIT to emit a native executable.
185
186
=item C<--gc=(type)>
187
188
Determine the type of garbage collection. The value for C<type> should be one
189
of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
190
191
=back
192
193
ICU Options
194
195
=over
196
197
=item C<--icu-config=/path/to/icu-config>
198
199
Use the specified icu-config script to determine the necessary ICU options.
201
Use --icu-config=none to disable the autodetect feature. Parrot will then be
202
build without ICU.
204
B<Note:> If you specify another ICU option than --icu-config, the autodetection
205
functionality will be disabled.
207
=item C<--icushared=(linkeroption)>
208
Leopold Toetsch
Dec 14, 2005
209
Linker command to link against ICU library.
210
211
E.g.
212
213
--icushared='-L /opt/openoffice/program -licudata -licuuc'
214
215
(The libs in openoffice are actually version 2.2 and do not work)
216
217
=item C<--icuheaders=(header_dir)>
218
219
Location of ICU header files without the /unicode suffix.
220
221
E.g.
222
223
--icuheaders='/home/lt/icu/'
224
225
=back
226
227
Other Options
233
Use this option if you want imcc's parser and lexer files to be generated.
234
Needs a working parser and lexer.
238
Build parrot assuming only pure ANSI C is available.
May 24, 2002
240
=back
242
=head1 SEE ALSO
243
244
F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
245
F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
246
247
=cut
249
use 5.006_001;
250
use strict;
Feb 26, 2006
251
use warnings;
252
use lib 'lib';
Feb 26, 2006
254
use English qw( -no_match_vars );
255
use Parrot::BuildUtil;
256
use Parrot::Configure;
Feb 26, 2006
258
# These globals are accessed in config/init/defaults.pm
259
our $parrot_version = Parrot::BuildUtil::parrot_version();
260
our @parrot_version = Parrot::BuildUtil::parrot_version();
Feb 26, 2006
262
$OUTPUT_AUTOFLUSH = 1;
264
# Install Option text was taken from:
265
#
266
# autoconf (GNU Autoconf) 2.59
267
# Written by David J. MacKenzie and Akim Demaille.
268
#
269
# Copyright (C) 2003 Free Software Foundation, Inc.
270
# This is free software; see the source for copying conditions. There is NO
271
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
272
# Installation directories:
273
274
275
# Handle options
276
my %args;
277
for (@ARGV) {
278
my($key, $value) = m/--([-\w]+)(?:=(.*))?/;
279
$key = 'help' unless defined $key;
280
$value = 1 unless defined $value;
282
for ($key) {
283
m/version/ && do {
285
print <<"END";
286
Parrot Version $parrot_version Configure 2.0
288
END
289
exit;
290
};
293
print <<"EOT";
294
$0 - Parrot Configure 2.0
296
General Options:
298
--help Show this text
299
--version Show version information
300
--verbose Output extra information
301
--verbose=2 Output every setting change
302
--verbose-step=N Set verbose for step N only
303
--verbose-step=regex Set verbose for step matching description
304
--nomanicheck Don't check the MANIFEST
306
--ask Have Configure ask for commonly-changed info
307
308
Compile Options:
310
--debugging=0 Disable debugging, default = 1
311
--inline Compiler supports inline
312
--optimize Optimized compile
313
--optimize=flags Add given optimizer flags
314
--parrot_is_shared Link parrot dynamically
315
--m=32 Build 32bit executable on 64-bit architecture.
316
--profile Turn on profiled compile (gcc only for now)
Leopold Toetsch
Feb 28, 2004
317
318
--cc=(compiler) Use the given compiler
319
--ccflags=(flags) Use the given compiler flags
320
--ccwarn=(flags) Use the given compiler warning flags
321
--cxx=(compiler) Use the given C++ compiler
322
--libs=(libs) Use the given libraries
323
--link=(linker) Use the given linker
324
--linkflags=(flags) Use the given linker flags
325
--ld=(linker) Use the given loader for shared libraries
326
--ldflags=(flags) Use the given loader flags for shared libraries
327
--lex=(lexer) Use the given lexical analyzer generator
328
--yacc=(parser) Use the given parser generator
Leopold Toetsch
Feb 28, 2004
329
330
--define=inet_aton Quick hack to use inet_aton instead of inet_pton
331
332
Parrot Options:
333
334
--intval=(type) Use the given type for INTVAL
335
--floatval=(type) Use the given type for FLOATVAL
336
--opcode=(type) Use the given type for opcodes
337
--ops=(files) Use the given ops files
338
--pmc=(files) Use the given PMC files
339
340
--cgoto=0 Don't build cgoto core - recommended when short of mem
Leopold Toetsch
Feb 28, 2004
341
--jitcapable Use JIT
342
--execcapable Use JIT to emit a native executable
343
--gc=(type) Determine the type of garbage collection
344
type=(gc|libc|malloc|malloc-trace) default is gc
345
346
ICU Options:
347
348
For using a system ICU, these options can be used:
349
350
--icu-config=/path/to/icu-config
351
Location of the script used for ICU autodetection.
352
You just need to specify this option if icu-config
353
is not in you PATH.
354
355
--icu-config=none can be used to disable the autodetection feature.
356
It will also be disabled if you specify any other
357
of the following ICU options.
358
359
If you do not have a full ICU installation:
360
361
--without-icu Build parrot without ICU support
362
--icuheaders=(path) Location of ICU headers without /unicode
363
--icushared=(flags) Full linker command to create shared libraries
364
--icudatadir=(path) Directory to locate ICU's data file(s)
365
366
Other Options (may not be implemented):
367
368
--maintainer Create imcc's parser and lexer files. Needs a working
369
parser and lexer.
370
--miniparrot Build parrot assuming only pure ANSI C is available
Leopold Toetsch
Feb 28, 2004
371
372
Install Options:
373
374
--prefix=PREFIX install architecture-independent files in PREFIX
375
[/usr/local]
376
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
377
[PREFIX]
378
379
By default, `make install' will install all the files in
380
`/usr/local/bin', `/usr/local/lib' etc. You can specify
381
an installation prefix other than `/usr/local' using `--prefix',
382
for instance `--prefix=\$HOME'.
383
384
For better control, use the options below.
385
386
Fine tuning of the installation directories:
387
--bindir=DIR user executables [EPREFIX/bin]
388
--sbindir=DIR system admin executables [EPREFIX/sbin]
389
--libexecdir=DIR program executables [EPREFIX/libexec]
390
--datadir=DIR read-only architecture-independent data [PREFIX/share]
391
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
392
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
393
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
394
--libdir=DIR object code libraries [EPREFIX/lib]
395
--includedir=DIR C header files [PREFIX/include]
396
--oldincludedir=DIR C header files for non-gcc [/usr/include]
397
--infodir=DIR info documentation [PREFIX/info]
398
--mandir=DIR man documentation [PREFIX/man]
399
400
EOT
401
exit;
402
};
404
}
405
}
406
407
$args{debugging} = 1 unless ((exists $args{debugging}) && !$args{debugging});
408
$args{maintainer} = 1 if defined $args{lex} or defined $args{yacc};
409
410
print <<"END";
411
Parrot Version $parrot_version Configure 2.0
412
Copyright (C) 2001-2006, The Perl Foundation.
413
414
Hello, I'm Configure. My job is to poke and prod your system to figure out
415
how to build Parrot. The process is completely automated, unless you passed in
416
the `--ask' flag on the command line, in which case it'll prompt you for a few
417
pieces of info.
418
419
Since you're running this program, you obviously have Perl 5--I'll be pulling
420
some defaults from its configuration.
421
END
422
423
# EDIT HERE TO ADD NEW TESTS
424
my @steps = qw(
425
init::manifest
426
init::defaults
428
init::miniparrot
429
init::hints
430
init::headers
431
inter::progs
432
inter::make
435
auto::gcc
436
auto::msvc
437
init::optimize
438
inter::shlibs
439
inter::libparrot
440
inter::charset
441
inter::encoding
442
inter::types
443
inter::ops
444
inter::pmc
445
auto::alignptrs
446
auto::headers
447
auto::sizes
448
auto::byteorder
449
auto::va_ptr
450
auto::pack
451
auto::format
452
auto::isreg
453
auto::jit
454
gen::cpu
455
auto::funcptr
456
auto::cgoto
457
auto::inline
458
auto::gc
459
auto::memalign
460
auto::signal
461
auto::socklen_t
462
auto::env
463
auto::aio
464
auto::gmp
466
auto::gdbm
467
auto::snprintf
468
auto::perldoc
469
auto::python
470
auto::bc
471
auto::m4
Charles Reiss
Aug 16, 2006
472
auto::cpu
473
gen::icu
474
gen::revision
475
gen::config_h
476
gen::core_pmcs
477
gen::parrot_include
479
gen::makefiles
480
gen::platform
481
gen::config_pm
484
my $conf = Parrot::Configure->new;
485
{
486
# XXX $Parrot::Configure::Step::conf is a temporty hack
487
no warnings qw(once);
488
$Parrot::Configure::Step::conf = $conf;
489
}
490
$conf->add_steps(@steps);
491
$conf->add_step('inter::lex', require => '2.5.33');
492
$conf->add_step('inter::yacc', require => '2.1');
493
$conf->add_steps(@steps2);
494
$conf->options->set(%args);
495
# Run the actual steps
496
$conf->runsteps or exit(1);
497
498
# tell users what to do next
499
my $make = $conf->data->get('make');
501
print <<"END";
502
503
Okay, we're done!
504
505
You can now use `$make' to build your Parrot.
506
(NOTE: do not use `$make -j <n>'!)
507
After that, you can use `$make test' to run the test suite.
508
509
Happy Hacking,
510
The Parrot Team
511
512
END
513
514
exit(0);