=head1 NAME

B<Inline::Config> - Set configuration options for C<Inline>

=head1 SYNOPSIS

 BEGIN {
     use Inline;
     $Inline::Config::BUILD_PREFIX = '/tmp/Inline';
     $Inline::Config::INSTALL_PREFIX = '/home/ingy/Inline';
     $Inline::Config::FORCE_BUILD = 1;
     $Inline::Config::MAKEFILE{INC} = '-I/usr/include/other');
 }

or

 BEGIN {
     use Inline;
     Inline::Config::Build_Prefix('/tmp/Inline');
     Inline::Config::Install_Prefix('/home/ingy/Inline');
     Inline::Config::force_build(1);
     Inline::Config::makefile(INC => '-I/usr/include/other');
 }

or

 BEGIN {
     use Inline;
     my $ic = Inline::Config->new;
     $ic->build_prefix('/tmp/Inline');
     $ic->install_prefix('/home/ingy/Inline');
     $ic->force_build(1);
     $ic->makefile(INC => '-I/usr/include/other');
 }

or

 BEGIN {
     use Inline;
     Inline::Config->new
       ->build_prefix('/tmp/Inline')
       ->install_prefix('/home/ingy/Inline')
       ->force_build(1)
       ->makefile(INC => '-I/usr/include/other');
 }

=head1 DESCRIPTION

C<Inline::Config> is a helper module for C<Inline.pm>. It sets and saves all of C<Inline>'s configuration options and defaults. 

Currently there are two categories of settings: I<global> and I<makefile>. Global settings are a collection of various options. See L<"Global Settings"> below. Makefile settings are passed directly into the Makefile.PL file. See L<ExtUtils::MakeMaker> for an (long) list of available options.

=head2 Methods

All of the settings are stored as global variables in the C<Inline::Config> namespace and are spelled with capital letters. You can set them in several manners depending on your personal style (as shown in L<"SYNOPSIS"> above). 

 Direct:     $Inline::Config::BUILD_PREFIX = '/tmp/Inline';
 Function:   Inline::Config::Build_Prefix('/tmp/Inline');
 OO:         $ic->build_prefix('/tmp/Inline');
 Stacked OO: $ic->build_prefix('/tmp/Inline')->force_build(1);

When using the direct method, the name must be all capitals. When using the procedural methods, any case can be used.

=head2 Roll Your Own

Another option is to create your own C<Inline::Config.pm> module and set the base options there. Install the module higher up in the C<@::INC> path. Then you don't have to set the same options in all of your scripts. Use the C<PERL5LIB> environment variable, if you don't have install access to C<@::INC> on your system.

=head2 Global Settings

This is an alphabetical list of all the global settings currentlly available for C<Inline>. Many of them include command line shortcuts.

=over 4

=item

B<AUTO_INCLUDE_C> - Text to automatically prepend to your Inlined C<C> code. Normally used for header files that you always want. Default:

 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"

=item

B<BUILD_PREFIX> - Tells what directory C<Inline> should install the compiled code under. This is a base directory. "C<make install>" actually creates a bunch of other directories under this. (Default is generated by examining your system for the best possible location. Program dies if none is found.)

=item

B<CLEAN_AFTER_BUILD> - Tells C<Inline> to remove the build files after compiling. You can also turn this option B<off> from the command line with the special syntax "C<perl -MInline=NOCLEAN ...>". (Default = 1)

=item

B<CLEAN_BUILD_AREA> - Tells C<Inline> to remove any build directories that may be lying around in your build area. Normally these directories get removed immediately after a successful build. Exceptions are when the build fails, or when you use the NOCLEAN or REPORTBUG options. You can also turn this option B<on> from the command line with the special syntax "C<perl -MInline=CLEAN ...>". (Default = 0)

=item

B<FORCE_BUILD> - Forces the code to be recompiled, even if everything is up to date. You can also turn this option on from the command line with the special syntax "C<perl -MInline=FORCE ...>". (Default = 0)

=item

B<PRINT_INFO> - This is a very useful option when you want to know what's going on under the hood. It tells C<Inline> to print helpful information to C<STDERR>. Among the things that get printed is a list of which C<Inline> functions were successfully bound to Perl. You can also set this option from the command line with the special syntax "C<perl -MInline=INFO ...>". (Default = 0)

=item

B<INSTALL_LIB> - Tells what directory C<Inline> should add to C<@::INC> to find your compiled code. This is based off of "C<INSTALL_PREFIX>", so you shouldn't need to set this directly.

B<NOTE> - The code to calculate the INSTALL_LIB directory path is tricky, because it depends on what version of perl you have. If you have problems with functions not being found, you may need to set this yourself. Hopefully this will all get figured out soon.

=item

B<INSTALL_PREFIX> - Tells what directory C<Inline> should install the compiled code under. This is a base directory. "C<make install>" actually creates a bunch of other directories under this. (Default is generated by examining your system for the best possible location. Program dies if none is found.)

=item

B<REPORTBUG> - Puts Inline into 'REPORTBUG' mode, which does special processing when you want to report a bug. REPORTBUG also automatically forces a build, and doesn't clean up afterwards. This is so that you can tar and mail the build directory to me. REPORTBUG will print exact instructions on what to do. You can also set this option from the command line with the special syntax "C<perl -MInline=REPORTBUG ...>". (Default = 0)

=item

B<SITE_INSTALL> - Says that compiled code should be installed in the Perl installation's "C<site_perl>" directory. Use this to permanently install an Inlined module. You can also set this option from the command line with the special syntax "C<perl -MInline=SITE_INSTALL ...>". (Default = 0)

=item

B<TEMP_DIR> - The temporary directory that "C<BUILD_PREFIX>" and "C<INSTALL_PREFIX>" are based off of. Setting this one, in effect, sets the other two. This directory must exist and be writable or C<Inline> will croak. 

If you do not set this, then C<Inline> will attempt to set a reasonable default for you. See L<Inline/"Find a Place to Build and Install"> for more info.

=back

=head1 AUTHOR

Brian Ingerson <INGY@cpan.org>

=head1 COPYRIGHT

Copyright (c) 2000, Brian Ingerson. All Rights Reserved.  This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License
  (see http://www.perl.com/perl/misc/Artistic.html)

=cut
