config.html

来自「perl教程」· HTML 代码 · 共 179 行

HTML
179
字号
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>ActivePerl::Config - Override the ActivePerl configuration</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>

<script>writelinks('__top__',2);</script>
<h1><a>ActivePerl::Config - Override the ActivePerl configuration</a></h1>
<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<ul>

		<li><a href="#windows_overrides">Windows overrides</a></li>
		<li><a href="#mac_os_x_overrides">Mac OS X overrides</a></li>
		<li><a href="#hpux_and_solaris_overrides">HP-UX and Solaris overrides</a></li>
	</ul>

	<li><a href="#environment">ENVIRONMENT</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ActivePerl::Config - Override the ActivePerl configuration</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  <span class="keyword">use</span> <span class="variable">Config</span> <span class="string">qw(%Config)</span><span class="operator">;</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The standard <code>Config</code> module provides the %Config hash containing
information about how this perl was built.  These configuration values
are used by modules and programs with the assumption that they still
apply for the system where perl is deployed.  This assumption does not
always hold.  The <code>ExtUtils::MakeMaker</code> module will for instance
assume that it can use the compiler $Config{cc} for building new
extensions, but another compiler might be the only one available.</p>
<p>The <code>ActivePerl::Config</code> module provides a solution for this.  It
overrides the values of %Config to better match the system where perl
currently runs.  For example, on Windows allows you to build extensions
with the free compiler <em>gcc</em> (see <a href="http://www.mingw.org/">http://www.mingw.org/</a>) even
though ActivePerl for Windows itself is built with the commercial
Microsoft Visual Studio 6 compiler.</p>
<p>The <code>ActivePerl::Config</code> module is not used directly.  It is
automatically loaded by <code>Config</code> if available and works behind the
scenes, overriding the values that are found in the %Config hash.  The
overriden values from <code>ActivePerl::Config</code> will also show when <code>perl
-V:foo</code> is invoked from the command line.</p>
<p>
</p>
<h2><a name="windows_overrides">Windows overrides</a></h2>
<p>For ActivePerl on Windows the following %Config overrides are provided:</p>
<dl>
<dt><strong><a name="item__config_make_">$Config{make}</a></strong>

<dd>
<p>This will be <code>nmake</code> by default, but if no <em>nmake</em> program can be
found and other compatible make programs are found, then this value
will reflect that.  Currently <em>dmake</em> is the only other make
implementation that is compatible enough to build perl extensions.</p>
</dd>
</li>
<dt><strong><a name="item__config_cc__">$Config{cc}, $Config{ccflags},...</a></strong>

<dd>
<p>The value of $Config{cc} will be <code>cl</code> by default, but if no <code>cl</code>
program can be found and <em>gcc</em> is found, then this value is <code>gcc</code>
and other values related to the compiler environment is adjusted
accordingly.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="mac_os_x_overrides">Mac OS X overrides</a></h2>
<p>For ActivePerl on Mac OS X the compilation flags (like
<code>$Config{ccflags}</code>) are adjusted to make it possible to compile
extentions even on 10.3 systems and systems that don't have the SDK
for generating Universal binaries installed.</p>
<p>
</p>
<h2><a name="hpux_and_solaris_overrides">HP-UX and Solaris overrides</a></h2>
<p>For ActivePerl on HP-UX and Solaris the following %Config overrides
are provided:</p>
<dl>
<dt><strong>$Config{make}</strong>

<dd>
<p>This will be <code>make</code> by default, but if <em>make</em> can't be found via the
PATH, then it's set to <em>/usr/ccs/bin/make</em> if that one is available.</p>
</dd>
</li>
<dt><strong>$Config{cc}, $Config{ccflags},...</strong>

<dd>
<p>The value of $Config{cc} will be <code>cc</code> by default and the other
compiler environment values are set up for compilation with the HP-UX
ANSI C compiler or the Sun Forte/WorkShop compiler respectively.  If
<em>cc</em> can't be found via the PATH and <em>gcc</em> is found, then
$Config{cc} is set to <code>gcc</code> and other values related to the compiler
environment is adjusted accordingly.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="environment">ENVIRONMENT</a></h1>
<p>The following environment variables can influence the operation of the
<code>ActivePerl::Config</code> module:</p>
<dl>
<dt><strong><a name="item_activeperl_config_disable">ACTIVEPERL_CONFIG_DISABLE</a></strong>

<dd>
<p>If set to a TRUE value (e.g. &quot;1&quot;), prevent <code>ActivePerl::Config</code> from
overriding any %Config value; the only values seen in %Config would be
those determined at perl build time.  Another way to disable
<code>ActivePerl::Config</code> permanently is to remove it using <a href="../../bin/ppm.html">ppm</a>
(<code>ppm remove ActivePerl-Config</code>)</p>
</dd>
</li>
<dt><strong><a name="item_activeperl_config_silent">ACTIVEPERL_CONFIG_SILENT</a></strong>

<dd>
<p>If set to a TRUE value (e.g. &quot;1&quot;), suppress warnings on STDERR when
new compilation environments are set up.  This happens when a
supported compiler is detected that is different from the one that
perl was originally built with.</p>
</dd>
</li>
<dt><strong><a name="item_activeperl_config_foo">ACTIVEPERL_CONFIG_<em>FOO</em></a></strong>

<dd>
<p>Override the $Config{<em>foo</em>} value.  For example if the
ACTIVEPERL_CONFIG_MAKE environment variable has the value <code>dmake</code>,
then so would $Config{make}.</p>
</dd>
<dd>
<p>If the ACTIVEPERL_CONFIG_DISABLE variable is set, all other
ACTIVEPERL_CONFIG_<em>FOO</em> variables are ignored.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="../../lib/Config.html">the Config manpage</a></p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?