[t] Sigh. unrevert last commit, as --master is defined elsewhere. Add a
[parrot.git] / Configure.pl
blob7288114342e6c7e50d6f497c97a1c084331c80cd
1 #! perl
3 # Copyright (C) 2001-2008, The Perl Foundation.
4 # $Id$
6 use 5.008;
7 use strict;
8 use warnings;
9 use lib 'lib';
11 use Parrot::Configure;
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Options::Test;
14 use Parrot::Configure::Options::Test::Prepare qw(
15 get_preconfiguration_tests
16 get_postconfiguration_tests
18 use Parrot::Configure::Messages qw(
19 print_introduction
20 print_conclusion
22 use Parrot::Configure::Step::List qw( get_steps_list );
23 use Parrot::Revision;
25 $| = 1; # $OUTPUT_AUTOFLUSH = 1;
27 # Install Option text was taken from:
29 # autoconf (GNU Autoconf) 2.59
30 # Written by David J. MacKenzie and Akim Demaille.
32 # Copyright (C) 2003 Free Software Foundation, Inc.
33 # This is free software; see the source for copying conditions. There is NO
34 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 # from Parrot::Configure::Options
37 my $args = process_options(
39 mode => 'configure',
40 argv => [@ARGV],
43 exit(1) unless defined $args;
45 my $opttest = Parrot::Configure::Options::Test->new($args);
47 # configuration tests will only be run if you requested them
48 # as command-line option
49 $opttest->run_configure_tests( get_preconfiguration_tests() );
51 my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version;
53 # from Parrot::Configure::Messages
54 print_introduction($parrot_version);
56 # Update revision number if needed
57 Parrot::Revision::update();
59 my $conf = Parrot::Configure->new();
61 # from Parrot::Configure::Step::List
62 $conf->add_steps( get_steps_list() );
64 # from Parrot::Configure::Data
65 $conf->options->set( %{$args} );
67 # Log files created by Configure.pl in MANIFEST.configure.generated
68 $conf->{active_configuration} = 1;
70 # Run the actual steps from Parrot::Configure
71 $conf->runsteps or exit(1);
73 # build tests will only be run if you requested them
74 # as command-line option
75 $opttest->run_build_tests( get_postconfiguration_tests() );
77 my $make = $conf->data->get('make');
78 # from Parrot::Configure::Messages
79 ( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1;
81 ################### DOCUMENTATION ###################
83 =head1 NAME
85 Configure.pl - Parrot's Configuration Script
87 =head1 SYNOPSIS
89 % perl Configure.pl [options]
91 =head1 DESCRIPTION
93 This is Parrot's configuration program. It should be run to create
94 the necessary system-specific files before building Parrot.
96 =head2 Command-line Options
98 General Options
100 =over
102 =item C<--help>
104 Prints out a description of the options and exits.
106 =item C<--version>
108 Prints out the version number of Configure.pl and exits.
110 =item C<--verbose>
112 Tells Configure.pl to output extra information about the configuration data it
113 is setting.
115 =item C<--verbose=2>
117 Tells Configure.pl to output information about i<every> setting added or
118 changed.
120 =item C<--verbose-step={N|regex}>
122 Run C<--verbose=2> for step number C<N> or matching description.
124 =item C<--fatal>
126 Tells Configure.pl to halt completely if any configuration step fails.
128 =item C<--fatal-step={init::alpha,inter::beta,auto::gamma}>
130 Tells Configure.pl to halt completely if any configuration step in
131 comma-delimited string individually fails.
133 =item C<--nomanicheck>
135 Tells Configure.pl not to run the MANIFEST check.
137 =item C<--prefix>
139 Sets the location where parrot will be installed.
141 =item C<--languages="list of languages">
143 Specify a list of languages to process (space separated.)
144 Used in combination with C<--step=gen::languages> to regenerate makefiles.
146 =item C<--ask>
148 This turns on the user prompts.
150 =item C<--test>
152 Run certain tests along with F<Configure.pl>:
154 =over 4
156 =item C<--test=configure>
158 Run tests found in F<t/configure/> I<before> beginning configuration. These
159 tests demonstrate that Parrot's configuration tools will work properly once
160 configuration has begun.
162 =item C<--test=build>
164 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
165 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
166 completed. These tests demonstrate (a) that certain of Parrot's configuration
167 tools are working properly post-configuration; and (b) that certain of
168 Parrot's build tools will work properly once you call F<make>.
170 =item C<--test>
172 Run the tests described in C<--test=configure>, conduct configuration, then
173 run the tests described in C<--test=build>.
175 =back
177 =back
179 Compile Options
181 =over
183 =item C<--debugging=0>
185 Debugging is turned on by default. Use this to disable it.
187 =item C<--parrot_is_shared>
189 Link parrot dynamically.
191 =item C<--m=32>
193 Create a 32-bit executable on 64-architectures like x86_64. This
194 option appends -m32 to compiler and linker programs and does
195 s/lib64/lib/g on link flags.
197 This option is experimental. See F<config/init/defaults.pm> for more.
199 =item C<--profile>
201 Turn on profiled compile (gcc only for now)
203 =item C<--cage>
205 [CAGE] compile includes many additional warnings
207 =item C<--optimize>
209 Add perl5's $Config{optimize} to the compiler flags.
211 =item C<--optimize=flags>
213 Add C<flags> to the compiler flags.
215 =item C<--inline>
217 Tell Configure that the compiler supports C<inline>.
219 =item C<--cc=(compiler)>
221 Specify which compiler to use.
223 =item C<--ccflags=(flags)>
225 Use the given compiler flags.
227 =item C<--ccwarn=(flags)>
229 Use the given compiler warning flags.
231 =item C<--cxx=(compiler)>
233 Specify which C++ compiler to use (for ICU).
235 =item C<--libs=(libs)>
237 Use the given libraries.
239 =item C<--link=(linker)>
241 Specify which linker to use.
243 =item C<--linkflags=(flags)>
245 Use the given linker flags
247 =item C<--ld=(linker)>
249 Specify which loader to use for shared libraries.
251 =item C<--ldflags=(flags)>
253 Use the given loader flags for shared libraries
255 =item C<--lex=(lexer)>
257 Specify which lexer to use.
259 =item C<--yacc=(parser)>
261 Specify which parser to use.
263 =item C<--define=val1[,val2]>
265 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
266 needed to use inet_aton for systems that lack inet_pton:
268 --define=inet_aton
270 =back
272 Parrot Options
274 =over
276 =item C<--intval=(type)>
278 Use the given type for C<INTVAL>.
280 =item C<--floatval=(type)>
282 Use the given type for C<FLOATVAL>.
284 =item C<--opcode=(type)>
286 Use the given type for opcodes.
288 =item C<--ops=(files)>
290 Use the given ops files.
292 =item C<--pmc=(files)>
294 Use the given PMC files.
296 =item C<--cgoto=0>
298 Don't build cgoto core. This is recommended when you are short of memory.
300 =item C<--jitcapable>
302 Use JIT system.
304 =item C<--execcapable>
306 Use JIT to emit a native executable.
308 =item C<--gc=(type)>
310 Determine the type of garbage collection. The value for C<type> should be one
311 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
313 =back
315 International Components For Unicode (ICU) Options
317 =over
319 =item C<--icu-config=/path/to/icu-config>
321 Use the specified icu-config script to determine the necessary ICU options.
323 Use --icu-config=none to disable the autodetect feature. Parrot will then be
324 build without ICU.
326 B<Note:> If you specify another ICU option than --icu-config, the autodetection
327 functionality will be disabled.
329 =item C<--icushared=(linkeroption)>
331 Linker command to link against ICU library.
333 E.g.
335 --icushared='-L /opt/openoffice/program -licudata -licuuc'
337 (The libs in openoffice are actually version 2.2 and do not work)
339 =item C<--icuheaders=(header_dir)>
341 Location of ICU header files without the /unicode suffix.
343 E.g.
345 --icuheaders='/home/lt/icu/'
347 =back
349 Other Options
351 =over
353 =item C<--maintainer>
355 Use this option if you want imcc's parser and lexer files to be generated.
356 Needs a working parser and lexer.
358 =item C<--miniparrot>
360 Build parrot assuming only pure ANSI C is available.
362 =back
364 =head1 SEE ALSO
366 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
367 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
369 =cut
371 # Local Variables:
372 # mode: cperl
373 # cperl-indent-level: 4
374 # fill-column: 100
375 # End:
376 # vim: expandtab shiftwidth=4: