* lib/Parrot/Pmc2c/MethodEmitter.pm:
[parrot.git] / Configure.pl
blob65224b0b1d934067cda7e3986c1a40a3615be855
1 #! perl
3 # Copyright (C) 2001-2008, The Perl Foundation.
4 # $Id$
6 use 5.008_000;
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 );
24 $| = 1; # $OUTPUT_AUTOFLUSH = 1;
26 # Install Option text was taken from:
28 # autoconf (GNU Autoconf) 2.59
29 # Written by David J. MacKenzie and Akim Demaille.
31 # Copyright (C) 2003 Free Software Foundation, Inc.
32 # This is free software; see the source for copying conditions. There is NO
33 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35 # from Parrot::Configure::Options
36 my $args = process_options(
38 mode => 'configure',
39 argv => [@ARGV],
42 exit(1) unless defined $args;
44 my $opttest = Parrot::Configure::Options::Test->new($args);
46 # configuration tests will only be run if you requested them
47 # as command-line option
48 $opttest->run_configure_tests( get_preconfiguration_tests() );
50 my $parrot_version = $Parrot::Configure::Options::Conf::parrot_version;
52 # from Parrot::Configure::Messages
53 print_introduction($parrot_version);
55 my $conf = Parrot::Configure->new();
57 # from Parrot::Configure::Step::List
58 $conf->add_steps( get_steps_list() );
60 # from Parrot::Configure::Data
61 $conf->options->set( %{$args} );
63 # Run the actual steps
64 # from Parrot::Configure
65 $conf->{active_configuration} = 1;
66 $conf->runsteps or exit(1);
68 # build tests will only be run if you requested them
69 # as command-line option
70 $opttest->run_build_tests( get_postconfiguration_tests() );
72 my $make = $conf->data->get('make');
73 # from Parrot::Configure::Messages
74 ( print_conclusion( $conf, $make ) ) ? exit 0 : exit 1;
76 ################### DOCUMENTATION ###################
78 =head1 NAME
80 Configure.pl - Parrot's Configuration Script
82 =head1 SYNOPSIS
84 % perl Configure.pl [options]
86 =head1 DESCRIPTION
88 This is Parrot's configuration program. It should be run to create
89 the necessary system-specific files before building Parrot.
91 =head2 Command-line Options
93 General Options
95 =over
97 =item C<--help>
99 Prints out a description of the options and exits.
101 =item C<--version>
103 Prints out the version number of Configure.pl and exits.
105 =item C<--verbose>
107 Tells Configure.pl to output extra information about the configuration data it
108 is setting.
110 =item C<--verbose=2>
112 Tells Configure.pl to output information about i<every> setting added or
113 changed.
115 =item C<--verbose-step={N|regex}>
117 Run C<--verbose=2> for step number C<N> or matching description.
119 =item C<--fatal>
121 Tells Configure.pl to halt completely if any configuration step fails.
123 =item C<--fatal-step={init::alpha,inter::beta,auto::gamma}>
125 Tells Configure.pl to halt completely if any configuration step in
126 comma-delimited string individually fails.
128 =item C<--nomanicheck>
130 Tells Configure.pl not to run the MANIFEST check.
132 =item C<--prefix>
134 Sets the location where parrot will be installed.
136 =item C<--languages="list of languages">
138 Specify a list of languages to process (space separated.)
139 Used in combination with C<--step=gen::languages> to regenerate makefiles.
141 =item C<--ask>
143 This turns on the user prompts.
145 =item C<--test>
147 Run certain tests along with F<Configure.pl>:
149 =over 4
151 =item C<--test=configure>
153 Run tests found in F<t/configure/> I<before> beginning configuration. These
154 tests demonstrate that Parrot's configuration tools will work properly once
155 configuration has begun.
157 =item C<--test=build>
159 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
160 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
161 completed. These tests demonstrate (a) that certain of Parrot's configuration
162 tools are working properly post-configuration; and (b) that certain of
163 Parrot's build tools will work properly once you call F<make>.
165 =item C<--test>
167 Run the tests described in C<--test=configure>, conduct configuration, then
168 run the tests described in C<--test=build>.
170 =back
172 =back
174 Compile Options
176 =over
178 =item C<--debugging=0>
180 Debugging is turned on by default. Use this to disable it.
182 =item C<--parrot_is_shared>
184 Link parrot dynamically.
186 =item C<--m=32>
188 Create a 32-bit executable on 64-architectures like x86_64. This
189 option appends -m32 to compiler and linker programs and does
190 s/lib64/lib/g on link flags.
192 This option is experimental. See F<config/init/defaults.pm> for more.
194 =item C<--profile>
196 Turn on profiled compile (gcc only for now)
198 =item C<--cage>
200 [CAGE] compile includes many additional warnings
202 =item C<--optimize>
204 Add perl5's $Config{optimize} to the compiler flags.
206 =item C<--optimize=flags>
208 Add C<flags> to the compiler flags.
210 =item C<--inline>
212 Tell Configure that the compiler supports C<inline>.
214 =item C<--cc=(compiler)>
216 Specify which compiler to use.
218 =item C<--ccflags=(flags)>
220 Use the given compiler flags.
222 =item C<--ccwarn=(flags)>
224 Use the given compiler warning flags.
226 =item C<--cxx=(compiler)>
228 Specify which C++ compiler to use (for ICU).
230 =item C<--libs=(libs)>
232 Use the given libraries.
234 =item C<--link=(linker)>
236 Specify which linker to use.
238 =item C<--linkflags=(flags)>
240 Use the given linker flags
242 =item C<--ld=(linker)>
244 Specify which loader to use for shared libraries.
246 =item C<--ldflags=(flags)>
248 Use the given loader flags for shared libraries
250 =item C<--lex=(lexer)>
252 Specify which lexer to use.
254 =item C<--yacc=(parser)>
256 Specify which parser to use.
258 =item C<--define=val1[,val2]>
260 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
261 needed to use inet_aton for systems that lack inet_pton:
263 --define=inet_aton
265 =back
267 Parrot Options
269 =over
271 =item C<--intval=(type)>
273 Use the given type for C<INTVAL>.
275 =item C<--floatval=(type)>
277 Use the given type for C<FLOATVAL>.
279 =item C<--opcode=(type)>
281 Use the given type for opcodes.
283 =item C<--ops=(files)>
285 Use the given ops files.
287 =item C<--pmc=(files)>
289 Use the given PMC files.
291 =item C<--cgoto=0>
293 Don't build cgoto core. This is recommended when you are short of memory.
295 =item C<--jitcapable>
297 Use JIT system.
299 =item C<--execcapable>
301 Use JIT to emit a native executable.
303 =item C<--gc=(type)>
305 Determine the type of garbage collection. The value for C<type> should be one
306 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
308 =back
310 International Components For Unicode (ICU) Options
312 =over
314 =item C<--icu-config=/path/to/icu-config>
316 Use the specified icu-config script to determine the necessary ICU options.
318 Use --icu-config=none to disable the autodetect feature. Parrot will then be
319 build without ICU.
321 B<Note:> If you specify another ICU option than --icu-config, the autodetection
322 functionality will be disabled.
324 =item C<--icushared=(linkeroption)>
326 Linker command to link against ICU library.
328 E.g.
330 --icushared='-L /opt/openoffice/program -licudata -licuuc'
332 (The libs in openoffice are actually version 2.2 and do not work)
334 =item C<--icuheaders=(header_dir)>
336 Location of ICU header files without the /unicode suffix.
338 E.g.
340 --icuheaders='/home/lt/icu/'
342 =back
344 Other Options
346 =over
348 =item C<--maintainer>
350 Use this option if you want imcc's parser and lexer files to be generated.
351 Needs a working parser and lexer.
353 =item C<--miniparrot>
355 Build parrot assuming only pure ANSI C is available.
357 =back
359 =head1 SEE ALSO
361 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
362 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
364 =cut
366 # Local Variables:
367 # mode: cperl
368 # cperl-indent-level: 4
369 # fill-column: 100
370 # End:
371 # vim: expandtab shiftwidth=4: