File Coverage

File:lib/Parrot/Configure/Options/Conf.pm
Coverage:100.0%

linestmtbrancondsubcode
1# Copyright (C) 2007-2011, Parrot Foundation.
2package Parrot::Configure::Options::Conf;
3
4
103
103
103
use strict;
5
103
103
103
use warnings;
6
103
103
103
use base qw( Exporter );
7our @EXPORT_OK = qw(
8    $script
9    $parrot_version
10    print_help
11    print_version
12);
13
103
103
103
use lib qw( lib );
14
103
103
103
use Parrot::BuildUtil ();
15
103
103
103
use FindBin qw($Bin);
16
17our $script = q{Configure.pl};
18our $parrot_version = Parrot::BuildUtil::parrot_version("$Bin/../../");
19
20sub print_version {
21
1
    print "Parrot Version $parrot_version Configure 2.0\n";
22
1
    return 1;
23}
24
25sub print_help {
26
2
    print <<"EOT";
27$script - Parrot Configure 2.0
28
29General Options:
30
31   --help Show this text
32   --version Show version information
33   --verbose Output extra information
34   --verbose=2 Output every setting change
35   --verbose-step Comma-delimited string of configuration steps
36                        for which output will be verbose
37   --fatal Failure of any configuration step will cause
38                        Configure.pl to halt
39   --fatal-step Comma-delimited string of configuration steps
40                        which upon failure cause Configure.pl to halt
41   --silent Don't be verbose, interactive or fatal
42   --nomanicheck Don't check the MANIFEST
43
44   --ask Have Configure ask for commonly-changed info
45   --test=configure Run tests of configuration tools before configuring
46   --test=build Run tests of build tools after configuring but before
47                        calling 'make'
48   --test Run configuration tools tests, configure, then run
49                        build tools tests
50
51
52Compile Options:
53
54   --debugging=0 Disable debugging, default = 1
55   --inline Compiler supports inline
56   --optimize Optimized compile
57   --optimize=flags Add given optimizer flags
58   --parrot_is_shared Link parrot dynamically
59   --disable-rpath Link without rpath (user must set LD_LIBRARY_PATH)
60   --m=32 Build 32bit executable on 64-bit architecture.
61   --profile Turn on profiled compile (gcc only for now)
62   --cage [CAGE] compile includes many additional warnings
63
64   --cc=(compiler) Use the given compiler
65   --ccflags=(flags) Use the given compiler flags
66   --ccwarn=(flags) Use the given compiler warning flags
67   --libs=(libs) Use the given libraries
68   --link=(linker) Use the given linker
69   --linkflags=(flags) Use the given linker flags
70   --ar=(archiver) Use the given librarian for static libraries
71   --arflags=(flags) Use the given flags for static libraries
72   --ld=(linker) Use the given loader for shared libraries
73   --ldflags=(flags) Use the given loader flags for shared libraries
74   --lex=(lexer) Use the given lexical analyzer generator
75   --make=(make tool) Use the given make utility
76   --yacc=(parser) Use the given parser generator
77
78   --no-line-directives Disable creation of C #line directives
79   --define=inet_aton Quick hack to use inet_aton instead of inet_pton
80   --gc=(type) Which implementation of GC to use. One of ms, ms2 or gms.
81
82Parrot Options:
83
84   --intval=(type) Use the given type for INTVAL
85   --floatval=(type) Use the given type for FLOATVAL
86   --opcode=(type) Use the given type for opcodes
87   --ops=(files) Use the given ops files
88
89   --without-threads Build parrot without thread support
90   --without-core-nci-thunks
91                        Build parrot without core-required
92                        statically compiled NCI call frames
93                        (useful for testing dynamic frame builders)
94   --without-extra-nci-thunks
95                        Build parrot without unnecessary
96                        statically compiled NCI call frames
97
98External Library Options:
99
100   --with-llvm Link to LLVM if it is available
101   --without-gettext Build parrot without gettext support
102   --without-gmp Build parrot without GMP support
103   --without-libffi Build parrot without libffi support
104   --without-opengl Build parrot without OpenGL support (GL/GLU/GLUT)
105   --without-readline Build parrot without readline support
106   --without-pcre Build parrot without pcre support
107   --without-zlib Build parrot without zlib support
108
109ICU Options:
110
111   For using a system ICU, these options can be used:
112
113   --icu-config=/path/to/icu-config
114                        Location of the script used for ICU autodetection.
115                        You just need to specify this option if icu-config
116                        is not in your PATH.
117
118   --icu-config=none Can be used to disable the autodetection feature.
119                        It will also be disabled if you specify any other
120                        of the following ICU options.
121
122   If you do not have a full ICU installation:
123
124   --without-icu Build parrot without ICU support
125   --icuheaders=(path) Location of ICU headers without /unicode
126   --icushared=(flags) Full linker command to create shared libraries
127
128Other Options (may not be implemented):
129
130   --maintainer Create imcc's parser and lexer files. Needs a working
131                        parser and lexer.
132
133Install Options:
134
135    --prefix=PREFIX Install architecture-independent files in PREFIX
136                            [/usr/local]
137    --exec-prefix=EPREFIX Install architecture-dependent files in EPREFIX
138                            [PREFIX]
139
140    By default, `make install' will install all the files in
141    `/usr/local/bin', `/usr/local/lib' etc. You can specify
142    an installation prefix other than `/usr/local' using `--prefix',
143    for instance `--prefix=\$HOME'.
144
145    For better control, use the options below.
146
147    Fine tuning of the installation directories:
148    --bindir=DIR user executables [EPREFIX/bin]
149    --sbindir=DIR system admin executables [EPREFIX/sbin]
150    --libexecdir=DIR program executables [EPREFIX/libexec]
151    --datadir=DIR read-only architecture-independent data [PREFIX/share]
152    --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
153    --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
154    --localstatedir=DIR modifiable single-machine data [PREFIX/var]
155    --libdir=DIR object code libraries [EPREFIX/lib]
156    --includedir=DIR C header files [PREFIX/include]
157    --oldincludedir=DIR C header files for non-gcc [/usr/include]
158    --infodir=DIR info documentation [PREFIX/info]
159    --mandir=DIR man documentation [PREFIX/man]
160
161EOT
162
2
    return 1;
163}
164
1651;
166
167#################### DOCUMENTATION ####################
168
169 - 239
=head1 NAME

Parrot::Configure::Options::Conf - Functionality shared by all Parrot
configuration options processing modes

=head1 SYNOPSIS

    use Parrot::Configure::Options::Conf qw(
        $script
        $parrot_version
        print_help
        print_version
     );

=head1 DESCRIPTION

Parrot::Configure::Options::Conf exports on demand certain variables and
subroutines used in other packages which implement different modes of
configuration options processing.  Currently, these packages are:

=over 4

=item * Parrot::Configure:Options::Conf::CLI

... for the command-line interface to F<Configure.pl>; and

=item * Parrot::Configure::Options::Conf::File

... for the configuration-file interface to that same program.

=back

=head1 EXPORTED VARIABLES

Three variables are exported on demand.

=head2 C<$script>

Defaults to string 'Configure.pl', but may be overridden for testing purposes.

=head2 C<$parrot_version>

String which is return value of C<Parrot::BuildUtil::parrot_version()>; may be
overridden for testing purposes.

=head1 EXPORTED SUBROUTINES

Two subroutines are exported on demand.

=head2 C<print_help()>

Help message printed when C<perl Configure.pl --help>  is called.  Takes no
arguments; prints to STDOUT; implicitly returns true value upon success.

=head2 C<print_version()>

Version number printed when C<perl Configure.pl --version>  is called.  Takes
no arguments; prints to STDOUT; implicitly returns true value upon success.

=head1 NOTES

The functionality in this package originally appeared in F<Configure.pl>.  It
was transferred here and refactored by James E Keenan.

=head1 SEE ALSO

F<Configure.pl>. Parrot::Configure::Options::Conf.
Parrot::Configure::Options::Reconf.  Parrot::Configure::Options::Conf::CLI.
Parrot::Configure::Options::Conf::File.

=cut
240
241# Local Variables:
242# mode: cperl
243# cperl-indent-level: 4
244# fill-column: 100
245# End:
246# vim: expandtab shiftwidth=4: