Give a PARROT_API to pobject_lives(),
[parrot.git] / Configure.pl
blob894846acf78fca2544bb4ddcf18d4f20f50d5a32
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<--nomanicheck>
49 Tells Configure.pl not to run the MANIFEST check.
51 =item C<--prefix>
53 Sets the location where parrot will be installed.
55 =item C<--step==>
57 execute a single configure step
59 =item C<--ask>
61 This turns on the user prompts.
63 =item C<--test>
65 Run certain tests along with F<Configure.pl>:
67 =over 4
69 =item C<--test=configure>
71 Run tests found in F<t/configure/> I<before> beginning configuration. These
72 tests demonstrate that Parrot's configuration tools will work properly once
73 configuration has begun.
75 =item C<--test=build>
77 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
78 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
79 completed. These tests demonstrate (a) that certain of Parrot's configuration
80 tools are working properly post-configuration; and (b) that certain of
81 Parrot's build tools will work properly once you call F<make>.
83 =item C<--test>
85 Run the tests described in C<--test=configure>, conduct configuration, then
86 run the tests described in C<--test=build>.
88 =back
90 =back
92 Compile Options
94 =over
96 =item C<--debugging=0>
98 Debugging is turned on by default. Use this to disable it.
100 =item C<--parrot_is_shared>
102 Link parrot dynamically.
104 =item C<--m=32>
106 Create a 32-bit executable on 64-architectures like x86_64. This
107 option appends -m32 to compiler and linker programs and does
108 s/lib64/lib/g on link flags.
110 This option is experimental. See F<config/init/defaults.pm> for more.
112 =item C<--profile>
114 Turn on profiled compile (gcc only for now)
116 =item C<--cage>
118 [CAGE] compile includes many additional warnings
120 =item C<--optimize>
122 Add perl5's $Config{optimize} to the compiler flags.
124 =item C<--optimize=flags>
126 Add C<flags> to the compiler flags.
128 =item C<--inline>
130 Tell Configure that the compiler supports C<inline>.
132 =item C<--cc=(compiler)>
134 Specify which compiler to use.
136 =item C<--ccflags=(flags)>
138 Use the given compiler flags.
140 =item C<--ccwarn=(flags)>
142 Use the given compiler warning flags.
144 =item C<--cxx=(compiler)>
146 Specify which C++ compiler to use (for ICU).
148 =item C<--libs=(libs)>
150 Use the given libraries.
152 =item C<--link=(linker)>
154 Specify which linker to use.
156 =item C<--linkflags=(flags)>
158 Use the given linker flags
160 =item C<--ld=(linker)>
162 Specify which loader to use for shared libraries.
164 =item C<--ldflags=(flags)>
166 Use the given loader flags for shared libraries
168 =item C<--lex=(lexer)>
170 Specify which lexer to use.
172 =item C<--yacc=(parser)>
174 Specify which parser to use.
176 =item C<--define=val1[,val2]>
178 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
179 needed to use inet_aton for systems that lack inet_pton:
181 --define=inet_aton
183 =back
185 Parrot Options
187 =over
189 =item C<--intval=(type)>
191 Use the given type for C<INTVAL>.
193 =item C<--floatval=(type)>
195 Use the given type for C<FLOATVAL>.
197 =item C<--opcode=(type)>
199 Use the given type for opcodes.
201 =item C<--ops=(files)>
203 Use the given ops files.
205 =item C<--pmc=(files)>
207 Use the given PMC files.
209 =item C<--cgoto=0>
211 Don't build cgoto core. This is recommended when you are short of memory.
213 =item C<--jitcapable>
215 Use JIT system.
217 =item C<--execcapable>
219 Use JIT to emit a native executable.
221 =item C<--gc=(type)>
223 Determine the type of garbage collection. The value for C<type> should be one
224 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
226 =back
228 International Components For Unicode (ICU) Options
230 =over
232 =item C<--icu-config=/path/to/icu-config>
234 Use the specified icu-config script to determine the necessary ICU options.
236 Use --icu-config=none to disable the autodetect feature. Parrot will then be
237 build without ICU.
239 B<Note:> If you specify another ICU option than --icu-config, the autodetection
240 functionality will be disabled.
242 =item C<--icushared=(linkeroption)>
244 Linker command to link against ICU library.
246 E.g.
248 --icushared='-L /opt/openoffice/program -licudata -licuuc'
250 (The libs in openoffice are actually version 2.2 and do not work)
252 =item C<--icuheaders=(header_dir)>
254 Location of ICU header files without the /unicode suffix.
256 E.g.
258 --icuheaders='/home/lt/icu/'
260 =back
262 Other Options
264 =over
266 =item C<--maintainer>
268 Use this option if you want imcc's parser and lexer files to be generated.
269 Needs a working parser and lexer.
271 =item C<--miniparrot>
273 Build parrot assuming only pure ANSI C is available.
275 =back
277 =head1 SEE ALSO
279 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
280 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
282 =cut
284 use 5.006_001;
285 use strict;
286 use warnings;
287 use Data::Dumper;
288 $Data::Dumper::Indent = 1;
289 use lib 'lib';
291 use Parrot::BuildUtil;
292 use Parrot::Configure;
293 use Parrot::Configure::Options qw( process_options );
294 use Parrot::Configure::Options::Test;
295 use Parrot::Configure::Messages qw(
296 print_introduction
297 print_conclusion
299 use Parrot::Configure::Step::List qw( get_steps_list );
301 my $parrot_version = Parrot::BuildUtil::parrot_version();
303 $| = 1; # $OUTPUT_AUTOFLUSH = 1;
305 # Install Option text was taken from:
307 # autoconf (GNU Autoconf) 2.59
308 # Written by David J. MacKenzie and Akim Demaille.
310 # Copyright (C) 2003 Free Software Foundation, Inc.
311 # This is free software; see the source for copying conditions. There is NO
312 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
314 # from Parrot::Configure::Options
315 my $args = process_options( {
316 argv => [ @ARGV ],
317 script => $0,
318 parrot_version => $parrot_version,
319 svnid => '$Id$',
320 } );
321 exit unless defined $args;
323 my $opttest = Parrot::Configure::Options::Test->new($args);
324 # configuration tests will only be run if you requested them
325 # as command-line option
326 $opttest->run_configure_tests();
328 # from Parrot::Configure::Messages
329 print_introduction($parrot_version);
331 my $conf = Parrot::Configure->new;
333 # from Parrot::Configure::Step::List
334 $conf->add_steps(get_steps_list());
336 my %args = %{$args};
337 # from Parrot::Configure::Data
338 $conf->options->set(%args);
340 if ( exists $args{step} ) {
341 # from Parrot::Configure::Data
342 $conf->data()->slurp();
343 # from Parrot::Configure
344 $conf->runstep( $args{step} );
345 print "\n";
347 else {
348 # Run the actual steps
349 # from Parrot::Configure
350 $conf->runsteps or exit(1);
353 # build tests will only be run if you requested them
354 # as command-line option
355 $opttest->run_build_tests();
357 # from Parrot::Configure::Messages
358 print_conclusion($conf->data->get('make'));
360 exit(0);
362 ################### DOCUMENTATION ###################
365 # Local Variables:
366 # mode: cperl
367 # cperl-indent-level: 4
368 # fill-column: 100
369 # End:
370 # vim: expandtab shiftwidth=4: