[devel]:
[parrot.git] / Configure.pl
blob876bc235d44fbdd821cc93d6ce6925a7cfcfaadd
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|regex}>
45 Run C<--verbose=2> for step number C<N> or matching description.
47 =item C<--fatal>
49 Tells Configure.pl to halt completely if any configuration step fails.
51 =item C<--fatal-step={init::alpha,inter::beta,auto::gamma}>
53 Tells Configure.pl to halt completely if any configuration step in
54 comma-delimited string individually fails.
56 =item C<--nomanicheck>
58 Tells Configure.pl not to run the MANIFEST check.
60 =item C<--prefix>
62 Sets the location where parrot will be installed.
64 =item C<--languages="list of languages">
66 Specify a list of languages to process (space separated.)
67 Used in combination with C<--step=gen::languages> to regenerate makefiles.
69 =item C<--ask>
71 This turns on the user prompts.
73 =item C<--test>
75 Run certain tests along with F<Configure.pl>:
77 =over 4
79 =item C<--test=configure>
81 Run tests found in F<t/configure/> I<before> beginning configuration. These
82 tests demonstrate that Parrot's configuration tools will work properly once
83 configuration has begun.
85 =item C<--test=build>
87 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
88 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
89 completed. These tests demonstrate (a) that certain of Parrot's configuration
90 tools are working properly post-configuration; and (b) that certain of
91 Parrot's build tools will work properly once you call F<make>.
93 =item C<--test>
95 Run the tests described in C<--test=configure>, conduct configuration, then
96 run the tests described in C<--test=build>.
98 =back
100 =back
102 Compile Options
104 =over
106 =item C<--debugging=0>
108 Debugging is turned on by default. Use this to disable it.
110 =item C<--parrot_is_shared>
112 Link parrot dynamically.
114 =item C<--m=32>
116 Create a 32-bit executable on 64-architectures like x86_64. This
117 option appends -m32 to compiler and linker programs and does
118 s/lib64/lib/g on link flags.
120 This option is experimental. See F<config/init/defaults.pm> for more.
122 =item C<--profile>
124 Turn on profiled compile (gcc only for now)
126 =item C<--cage>
128 [CAGE] compile includes many additional warnings
130 =item C<--optimize>
132 Add perl5's $Config{optimize} to the compiler flags.
134 =item C<--optimize=flags>
136 Add C<flags> to the compiler flags.
138 =item C<--inline>
140 Tell Configure that the compiler supports C<inline>.
142 =item C<--cc=(compiler)>
144 Specify which compiler to use.
146 =item C<--ccflags=(flags)>
148 Use the given compiler flags.
150 =item C<--ccwarn=(flags)>
152 Use the given compiler warning flags.
154 =item C<--cxx=(compiler)>
156 Specify which C++ compiler to use (for ICU).
158 =item C<--libs=(libs)>
160 Use the given libraries.
162 =item C<--link=(linker)>
164 Specify which linker to use.
166 =item C<--linkflags=(flags)>
168 Use the given linker flags
170 =item C<--ld=(linker)>
172 Specify which loader to use for shared libraries.
174 =item C<--ldflags=(flags)>
176 Use the given loader flags for shared libraries
178 =item C<--lex=(lexer)>
180 Specify which lexer to use.
182 =item C<--yacc=(parser)>
184 Specify which parser to use.
186 =item C<--define=val1[,val2]>
188 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
189 needed to use inet_aton for systems that lack inet_pton:
191 --define=inet_aton
193 =back
195 Parrot Options
197 =over
199 =item C<--intval=(type)>
201 Use the given type for C<INTVAL>.
203 =item C<--floatval=(type)>
205 Use the given type for C<FLOATVAL>.
207 =item C<--opcode=(type)>
209 Use the given type for opcodes.
211 =item C<--ops=(files)>
213 Use the given ops files.
215 =item C<--pmc=(files)>
217 Use the given PMC files.
219 =item C<--cgoto=0>
221 Don't build cgoto core. This is recommended when you are short of memory.
223 =item C<--jitcapable>
225 Use JIT system.
227 =item C<--execcapable>
229 Use JIT to emit a native executable.
231 =item C<--gc=(type)>
233 Determine the type of garbage collection. The value for C<type> should be one
234 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
236 =back
238 International Components For Unicode (ICU) Options
240 =over
242 =item C<--icu-config=/path/to/icu-config>
244 Use the specified icu-config script to determine the necessary ICU options.
246 Use --icu-config=none to disable the autodetect feature. Parrot will then be
247 build without ICU.
249 B<Note:> If you specify another ICU option than --icu-config, the autodetection
250 functionality will be disabled.
252 =item C<--icushared=(linkeroption)>
254 Linker command to link against ICU library.
256 E.g.
258 --icushared='-L /opt/openoffice/program -licudata -licuuc'
260 (The libs in openoffice are actually version 2.2 and do not work)
262 =item C<--icuheaders=(header_dir)>
264 Location of ICU header files without the /unicode suffix.
266 E.g.
268 --icuheaders='/home/lt/icu/'
270 =back
272 Other Options
274 =over
276 =item C<--maintainer>
278 Use this option if you want imcc's parser and lexer files to be generated.
279 Needs a working parser and lexer.
281 =item C<--miniparrot>
283 Build parrot assuming only pure ANSI C is available.
285 =back
287 =head1 SEE ALSO
289 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
290 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
292 =cut
294 use 5.008_000;
295 use strict;
296 use warnings;
297 use lib 'lib';
299 use Parrot::Configure;
300 use Parrot::Configure::Options qw( process_options );
301 use Parrot::Configure::Options::Test;
302 use Parrot::Configure::Messages qw(
303 print_introduction
304 print_conclusion
306 use Parrot::Configure::Step::List qw( get_steps_list );
308 $| = 1; # $OUTPUT_AUTOFLUSH = 1;
310 # Install Option text was taken from:
312 # autoconf (GNU Autoconf) 2.59
313 # Written by David J. MacKenzie and Akim Demaille.
315 # Copyright (C) 2003 Free Software Foundation, Inc.
316 # This is free software; see the source for copying conditions. There is NO
317 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
319 # from Parrot::Configure::Options
320 my $args = process_options(
322 mode => 'configure',
323 argv => [@ARGV],
326 exit(1) unless defined $args;
328 my $opttest = Parrot::Configure::Options::Test->new($args);
330 # configuration tests will only be run if you requested them
331 # as command-line option
332 $opttest->run_configure_tests();
334 my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version;
336 # from Parrot::Configure::Messages
337 print_introduction($parrot_version);
339 my $conf = Parrot::Configure->new;
341 # from Parrot::Configure::Step::List
342 $conf->add_steps( get_steps_list() );
344 # from Parrot::Configure::Data
345 $conf->options->set( %{$args} );
347 # Run the actual steps
348 # from Parrot::Configure
349 $conf->runsteps or exit(1);
351 # build tests will only be run if you requested them
352 # as command-line option
353 $opttest->run_build_tests();
355 my $make = $conf->data->get('make');
356 # from Parrot::Configure::Messages
357 ( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1;
359 ################### DOCUMENTATION ###################
361 # Local Variables:
362 # mode: cperl
363 # cperl-indent-level: 4
364 # fill-column: 100
365 # End:
366 # vim: expandtab shiftwidth=4: