* src/pmc/multisub.pmc:
[parrot.git] / Configure.pl
blob591126944976f699765625ba38046c192d3e209e
1 #! perl
3 # Copyright (C) 2001-2007, The Perl Foundation.
4 # $Id$
6 =head1 NAME
8 Configure.pl - Parrot's Configuration Script
10 =head1 SYNOPSIS
12 % perl Configure.pl [options]
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.
19 =head2 Command-line Options
21 General Options
23 =over
25 =item C<--help>
27 Prints out a description of the options and exits.
29 =item C<--version>
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.
38 =item C<--verbose=2>
40 Tells Configure.pl to output information about i<every> setting added or
41 changed.
43 =item C<--verbose-step={N|name|regex}>
45 Run one step with C<--verbose=2>; step indicated by step number C<N>, by step
46 name (I<e.g.>, C<--verbose-step=inter::make>), or by matching description.
48 =item C<--nomanicheck>
50 Tells Configure.pl not to run the MANIFEST check.
52 =item C<--prefix>
54 Sets the location where parrot will be installed.
56 =item C<--step=>
58 Execute a single configure step.
60 =item C<--languages="list of languages">
62 Specify a list of languages to process (space separated.)
63 Used in combination with C<--step=gen::languages> to regenerate makefiles.
65 =item C<--ask>
67 This turns on the user prompts.
69 =item C<--test>
71 Run certain tests along with F<Configure.pl>:
73 =over 4
75 =item C<--test=configure>
77 Run tests found in F<t/configure/> I<before> beginning configuration. These
78 tests demonstrate that Parrot's configuration tools will work properly once
79 configuration has begun.
81 =item C<--test=build>
83 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
84 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
85 completed. These tests demonstrate (a) that certain of Parrot's configuration
86 tools are working properly post-configuration; and (b) that certain of
87 Parrot's build tools will work properly once you call F<make>.
89 =item C<--test>
91 Run the tests described in C<--test=configure>, conduct configuration, then
92 run the tests described in C<--test=build>.
94 =back
96 =back
98 Compile Options
100 =over
102 =item C<--debugging=0>
104 Debugging is turned on by default. Use this to disable it.
106 =item C<--parrot_is_shared>
108 Link parrot dynamically.
110 =item C<--m=32>
112 Create a 32-bit executable on 64-architectures like x86_64. This
113 option appends -m32 to compiler and linker programs and does
114 s/lib64/lib/g on link flags.
116 This option is experimental. See F<config/init/defaults.pm> for more.
118 =item C<--profile>
120 Turn on profiled compile (gcc only for now)
122 =item C<--cage>
124 [CAGE] compile includes many additional warnings
126 =item C<--optimize>
128 Add perl5's $Config{optimize} to the compiler flags.
130 =item C<--optimize=flags>
132 Add C<flags> to the compiler flags.
134 =item C<--inline>
136 Tell Configure that the compiler supports C<inline>.
138 =item C<--cc=(compiler)>
140 Specify which compiler to use.
142 =item C<--ccflags=(flags)>
144 Use the given compiler flags.
146 =item C<--ccwarn=(flags)>
148 Use the given compiler warning flags.
150 =item C<--cxx=(compiler)>
152 Specify which C++ compiler to use (for ICU).
154 =item C<--libs=(libs)>
156 Use the given libraries.
158 =item C<--link=(linker)>
160 Specify which linker to use.
162 =item C<--linkflags=(flags)>
164 Use the given linker flags
166 =item C<--ld=(linker)>
168 Specify which loader to use for shared libraries.
170 =item C<--ldflags=(flags)>
172 Use the given loader flags for shared libraries
174 =item C<--lex=(lexer)>
176 Specify which lexer to use.
178 =item C<--yacc=(parser)>
180 Specify which parser to use.
182 =item C<--define=val1[,val2]>
184 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
185 needed to use inet_aton for systems that lack inet_pton:
187 --define=inet_aton
189 =back
191 Parrot Options
193 =over
195 =item C<--intval=(type)>
197 Use the given type for C<INTVAL>.
199 =item C<--floatval=(type)>
201 Use the given type for C<FLOATVAL>.
203 =item C<--opcode=(type)>
205 Use the given type for opcodes.
207 =item C<--ops=(files)>
209 Use the given ops files.
211 =item C<--pmc=(files)>
213 Use the given PMC files.
215 =item C<--cgoto=0>
217 Don't build cgoto core. This is recommended when you are short of memory.
219 =item C<--jitcapable>
221 Use JIT system.
223 =item C<--execcapable>
225 Use JIT to emit a native executable.
227 =item C<--gc=(type)>
229 Determine the type of garbage collection. The value for C<type> should be one
230 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
232 =back
234 International Components For Unicode (ICU) Options
236 =over
238 =item C<--icu-config=/path/to/icu-config>
240 Use the specified icu-config script to determine the necessary ICU options.
242 Use --icu-config=none to disable the autodetect feature. Parrot will then be
243 build without ICU.
245 B<Note:> If you specify another ICU option than --icu-config, the autodetection
246 functionality will be disabled.
248 =item C<--icushared=(linkeroption)>
250 Linker command to link against ICU library.
252 E.g.
254 --icushared='-L /opt/openoffice/program -licudata -licuuc'
256 (The libs in openoffice are actually version 2.2 and do not work)
258 =item C<--icuheaders=(header_dir)>
260 Location of ICU header files without the /unicode suffix.
262 E.g.
264 --icuheaders='/home/lt/icu/'
266 =back
268 Other Options
270 =over
272 =item C<--maintainer>
274 Use this option if you want imcc's parser and lexer files to be generated.
275 Needs a working parser and lexer.
277 =item C<--miniparrot>
279 Build parrot assuming only pure ANSI C is available.
281 =back
283 =head1 SEE ALSO
285 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
286 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
288 =cut
290 use 5.008_000;
291 use strict;
292 use warnings;
293 use lib 'lib';
295 use Parrot::BuildUtil;
296 use Parrot::Configure;
297 use Parrot::Configure::Options qw( process_options );
298 use Parrot::Configure::Options::Test;
299 use Parrot::Configure::Messages qw(
300 print_introduction
301 print_conclusion
303 use Parrot::Configure::Step::List qw( get_steps_list );
305 my $parrot_version = Parrot::BuildUtil::parrot_version();
307 $| = 1; # $OUTPUT_AUTOFLUSH = 1;
309 # Install Option text was taken from:
311 # autoconf (GNU Autoconf) 2.59
312 # Written by David J. MacKenzie and Akim Demaille.
314 # Copyright (C) 2003 Free Software Foundation, Inc.
315 # This is free software; see the source for copying conditions. There is NO
316 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
318 # from Parrot::Configure::Options
319 my $args = process_options( {
320 argv => [ @ARGV ],
321 script => $0,
322 parrot_version => $parrot_version,
323 svnid => '$Id$',
324 } );
325 exit(1) unless defined $args;
327 my $opttest = Parrot::Configure::Options::Test->new($args);
328 # configuration tests will only be run if you requested them
329 # as command-line option
330 $opttest->run_configure_tests();
332 # from Parrot::Configure::Messages
333 print_introduction($parrot_version) unless exists $args->{step};
335 my $conf = Parrot::Configure->new;
337 # from Parrot::Configure::Step::List
338 $conf->add_steps(get_steps_list());
340 # from Parrot::Configure::Data
341 $conf->options->set(%{$args});
343 if ( exists $args->{step} ) {
344 # from Parrot::Configure::Data
345 $conf->data()->slurp();
346 $conf->data()->slurp_temp()
347 if $args->{step} =~ /gen::makefiles/;
348 # from Parrot::Configure
349 $conf->run_single_step( $args->{step} );
350 print "\n";
352 else {
353 # Run the actual steps
354 # from Parrot::Configure
355 $conf->runsteps or exit(1);
358 # build tests will only be run if you requested them
359 # as command-line option
360 $opttest->run_build_tests();
362 # from Parrot::Configure::Messages
363 print_conclusion($conf->data->get('make')) unless exists $args->{step};
364 exit(0);
366 ################### DOCUMENTATION ###################
369 # Local Variables:
370 # mode: cperl
371 # cperl-indent-level: 4
372 # fill-column: 100
373 # End:
374 # vim: expandtab shiftwidth=4: