3 # Copyright (C) 2001-2008, The Perl Foundation.
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(
22 use Parrot
::Configure
::Step
::List
qw( get_steps_list );
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
(
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 ###################
85 Configure.pl - Parrot's Configuration Script
89 % perl Configure.pl [options]
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
104 Prints out a description of the options and exits.
108 Prints out the version number of Configure.pl and exits.
112 Tells Configure.pl to output extra information about the configuration data it
117 Tells Configure.pl to output information about i<every> setting added or
120 =item C<--verbose-step={N|regex}>
122 Run C<--verbose=2> for step number C<N> or matching description.
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.
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.
148 This turns on the user prompts.
152 Run certain tests along with F<Configure.pl>:
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>.
172 Run the tests described in C<--test=configure>, conduct configuration, then
173 run the tests described in C<--test=build>.
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.
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.
201 Turn on profiled compile (gcc only for now)
205 [CAGE] compile includes many additional warnings
209 Add perl5's $Config{optimize} to the compiler flags.
211 =item C<--optimize=flags>
213 Add C<flags> to the compiler flags.
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:
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.
298 Don't build cgoto core. This is recommended when you are short of memory.
300 =item C<--jitcapable>
304 =item C<--execcapable>
306 Use JIT to emit a native executable.
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>.
315 International Components For Unicode (ICU) Options
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
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.
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.
345 --icuheaders='/home/lt/icu/'
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.
366 F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
367 F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
373 # cperl-indent-level: 4
376 # vim: expandtab shiftwidth=4: