* docs/pdds/pdd15_objects.pod:
[parrot.git] / Configure.pl
blob8fa8435eeeb8ee65d8d346164b43b288c9b26319
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<--languages="list of languages">
61 Specify a list of languages to process (space separated.)
62 Used in combination with C<--step=gen::languages> to regenerate makefiles.
64 =item C<--ask>
66 This turns on the user prompts.
68 =item C<--test>
70 Run certain tests along with F<Configure.pl>:
72 =over 4
74 =item C<--test=configure>
76 Run tests found in F<t/configure/> I<before> beginning configuration. These
77 tests demonstrate that Parrot's configuration tools will work properly once
78 configuration has begun.
80 =item C<--test=build>
82 Run tests found in F<t/postconfigure/>, F<t/tools/pmc2cutils/>,
83 F<t/tools/ops2cutils/> and F<t/tools/ops2pmutils/> I<after> configuration has
84 completed. These tests demonstrate (a) that certain of Parrot's configuration
85 tools are working properly post-configuration; and (b) that certain of
86 Parrot's build tools will work properly once you call F<make>.
88 =item C<--test>
90 Run the tests described in C<--test=configure>, conduct configuration, then
91 run the tests described in C<--test=build>.
93 =back
95 =back
97 Compile Options
99 =over
101 =item C<--debugging=0>
103 Debugging is turned on by default. Use this to disable it.
105 =item C<--parrot_is_shared>
107 Link parrot dynamically.
109 =item C<--m=32>
111 Create a 32-bit executable on 64-architectures like x86_64. This
112 option appends -m32 to compiler and linker programs and does
113 s/lib64/lib/g on link flags.
115 This option is experimental. See F<config/init/defaults.pm> for more.
117 =item C<--profile>
119 Turn on profiled compile (gcc only for now)
121 =item C<--cage>
123 [CAGE] compile includes many additional warnings
125 =item C<--optimize>
127 Add perl5's $Config{optimize} to the compiler flags.
129 =item C<--optimize=flags>
131 Add C<flags> to the compiler flags.
133 =item C<--inline>
135 Tell Configure that the compiler supports C<inline>.
137 =item C<--cc=(compiler)>
139 Specify which compiler to use.
141 =item C<--ccflags=(flags)>
143 Use the given compiler flags.
145 =item C<--ccwarn=(flags)>
147 Use the given compiler warning flags.
149 =item C<--cxx=(compiler)>
151 Specify which C++ compiler to use (for ICU).
153 =item C<--libs=(libs)>
155 Use the given libraries.
157 =item C<--link=(linker)>
159 Specify which linker to use.
161 =item C<--linkflags=(flags)>
163 Use the given linker flags
165 =item C<--ld=(linker)>
167 Specify which loader to use for shared libraries.
169 =item C<--ldflags=(flags)>
171 Use the given loader flags for shared libraries
173 =item C<--lex=(lexer)>
175 Specify which lexer to use.
177 =item C<--yacc=(parser)>
179 Specify which parser to use.
181 =item C<--define=val1[,val2]>
183 Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h. Currently
184 needed to use inet_aton for systems that lack inet_pton:
186 --define=inet_aton
188 =back
190 Parrot Options
192 =over
194 =item C<--intval=(type)>
196 Use the given type for C<INTVAL>.
198 =item C<--floatval=(type)>
200 Use the given type for C<FLOATVAL>.
202 =item C<--opcode=(type)>
204 Use the given type for opcodes.
206 =item C<--ops=(files)>
208 Use the given ops files.
210 =item C<--pmc=(files)>
212 Use the given PMC files.
214 =item C<--cgoto=0>
216 Don't build cgoto core. This is recommended when you are short of memory.
218 =item C<--jitcapable>
220 Use JIT system.
222 =item C<--execcapable>
224 Use JIT to emit a native executable.
226 =item C<--gc=(type)>
228 Determine the type of garbage collection. The value for C<type> should be one
229 of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
231 =back
233 International Components For Unicode (ICU) Options
235 =over
237 =item C<--icu-config=/path/to/icu-config>
239 Use the specified icu-config script to determine the necessary ICU options.
241 Use --icu-config=none to disable the autodetect feature. Parrot will then be
242 build without ICU.
244 B<Note:> If you specify another ICU option than --icu-config, the autodetection
245 functionality will be disabled.
247 =item C<--icushared=(linkeroption)>
249 Linker command to link against ICU library.
251 E.g.
253 --icushared='-L /opt/openoffice/program -licudata -licuuc'
255 (The libs in openoffice are actually version 2.2 and do not work)
257 =item C<--icuheaders=(header_dir)>
259 Location of ICU header files without the /unicode suffix.
261 E.g.
263 --icuheaders='/home/lt/icu/'
265 =back
267 Other Options
269 =over
271 =item C<--maintainer>
273 Use this option if you want imcc's parser and lexer files to be generated.
274 Needs a working parser and lexer.
276 =item C<--miniparrot>
278 Build parrot assuming only pure ANSI C is available.
280 =back
282 =head1 SEE ALSO
284 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
285 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
287 =cut
289 use 5.008_000;
290 use strict;
291 use warnings;
292 use Data::Dumper;
293 $Data::Dumper::Indent = 1;
294 use lib 'lib';
296 use Parrot::BuildUtil;
297 use Parrot::Configure;
298 use Parrot::Configure::Options qw( process_options );
299 use Parrot::Configure::Options::Test;
300 use Parrot::Configure::Messages qw(
301 print_introduction
302 print_conclusion
304 use Parrot::Configure::Step::List qw( get_steps_list );
306 my $parrot_version = Parrot::BuildUtil::parrot_version();
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( {
321 argv => [ @ARGV ],
322 script => $0,
323 parrot_version => $parrot_version,
324 svnid => '$Id$',
325 } );
326 exit unless defined $args;
327 my %args = %{$args};
329 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 # from Parrot::Configure::Messages
335 print_introduction($parrot_version) unless exists $args{step};
337 my $conf = Parrot::Configure->new;
339 # from Parrot::Configure::Step::List
340 $conf->add_steps(get_steps_list());
342 # from Parrot::Configure::Data
343 $conf->options->set(%args);
345 if ( exists $args{step} ) {
346 # from Parrot::Configure::Data
347 $conf->data()->slurp();
348 # from Parrot::Configure
349 $conf->runstep( $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};
365 exit(0);
367 ################### DOCUMENTATION ###################
370 # Local Variables:
371 # mode: cperl
372 # cperl-indent-level: 4
373 # fill-column: 100
374 # End:
375 # vim: expandtab shiftwidth=4: