<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
+<!-- $LastChangedRevision$ -->
<!--
- Copyright 2003-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
directive from <module>mod_so</module>.</p>
<p>So to use this extension mechanism your platform has to support the DSO
- feature and your Apache <code>httpd</code> binary has to be built with the
+ feature and your Apache <program>httpd</program> binary has to be built with the
<module>mod_so</module> module. The <code>apxs</code> tool automatically
complains if this is not the case. You can check this yourself by manually
running the command</p>
<module>mod_so</module> or perhaps even read the
<code>src/modules/standard/mod_so.c</code> source file.</p>
</summary>
-<seealso><a href="apachectl.html">apachectl</a></seealso>
-<seealso><a href="httpd.html">httpd</a></seealso>
+<seealso><program>apachectl</program></seealso>
+<seealso><program>httpd</program></seealso>
<section id="synopsis"><title>Synopsis</title>
<p><code><strong>apxs</strong> -<strong>g</strong>
-<strong>n</strong> <var>modname</var></code></p>
<p><code><strong>apxs</strong> -<strong>q</strong>
+ [ -<strong>v</strong> ]
[ -<strong>S</strong> <var>name</var>=<var>value</var> ]
<var>query</var> ...</code></p>
<section id="options.query"><title>Query Options</title>
<dl>
<dt><code>-q</code></dt>
- <dd>Performs a query for <code>apxs</code>'s knowledge about certain
- settings. The <var>query</var> parameters can be one or more of the
- following strings: <code>CC</code>, <code>CFLAGS</code>,
- <code>CFLAGS_SHLIB</code>, <code>INCLUDEDIR</code>, <code>LD_SHLIB</code>,
- <code>LDFLAGS_SHLIB</code>, <code>LIBEXECDIR</code>,
- <code>LIBS_SHLIB</code>, <code>SBINDIR</code>, <code>SYSCONFDIR</code>,
- <code>TARGET</code>.
-
- <p>Use this for manually determining settings. For instance use</p>
+ <dd>Performs a query for variables and environment settings used to
+ build <code>httpd</code>. When invoked without <var>query</var> parameters,
+ it prints all known variables and their values. The optional <code>-v</code>
+ parameter formats the list output.
+
+ <p>Use this to manually determine settings used to build the
+ <code>httpd</code> that will load your module. For instance use</p>
<example>
INC=-I`apxs -q INCLUDEDIR`
</example>
<dt><code>-Wc,<var>compiler-flags</var></code></dt>
<dd>This option passes <var>compiler-flags</var> as additional flags to
- the compiler command. Use this to add local compiler-specific options.</dd>
+ the <code>libtool --mode=compile</code> command. Use this to add local
+ compiler-specific options.</dd>
<dt><code>-Wl,<var>linker-flags</var></code></dt>
- <dd>This option passes <var>linker-flags</var> as additional flags to
- the linker command. Use this to add local linker-specific options.</dd>
+ <dd>This option passes <var>linker-flags</var> as additional
+ flags to the <code>libtool --mode=link</code> command. Use this
+ to add local linker-specific options.</dd>
</dl>
</section>
<example>
$ apxs -c mod_foo.c<br />
- gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c<br />
- ld -Bshareable -o mod_foo.so mod_foo.o<br />
+ /path/to/libtool --mode=compile gcc ... -c mod_foo.c<br />
+ /path/to/libtool --mode=link gcc ... -o mod_foo.la mod_foo.slo<br />
$ _
</example>
achieved by running:</p>
<example>
- $ apxs -i -a mod_foo.c<br />
- cp mod_foo.so /path/to/apache/modules/mod_foo.so<br />
+ $ apxs -i -a mod_foo.la<br />
+ /path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
+ /path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules
+ ...
chmod 755 /path/to/apache/modules/mod_foo.so<br />
- [activating module `foo' in /path/to/apache/etc/httpd.conf]<br />
+ [activating module `foo' in /path/to/apache/conf/httpd.conf]<br />
$ _
</example>
$ apxs -g -n foo<br />
Creating [DIR] foo<br />
Creating [FILE] foo/Makefile<br />
+ Creating [FILE] foo/modules.mk<br />
Creating [FILE] foo/mod_foo.c<br />
+ Creating [FILE] foo/.deps<br />
$ _
</example>
$ cd foo<br />
$ make all reload<br />
apxs -c mod_foo.c<br />
- gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c<br />
- ld -Bshareable -o mod_foo.so mod_foo.o<br />
- apxs -i -a -n "foo" mod_foo.so<br />
- cp mod_foo.so /path/to/apache/modules/mod_foo.so<br />
+ /path/to/libtool --mode=compile gcc ... -c mod_foo.c<br />
+ /path/to/libtool --mode=link gcc ... -o mod_foo.la mod_foo.slo<br />
+ apxs -i -a -n "foo" mod_foo.la<br />
+ /path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
+ /path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules
+ ...
chmod 755 /path/to/apache/modules/mod_foo.so<br />
- [activating module `foo' in /path/to/apache/etc/httpd.conf]<br />
+ [activating module `foo' in /path/to/apache/conf/httpd.conf]<br />
apachectl restart<br />
/path/to/apache/sbin/apachectl restart: httpd not running, trying to start<br />
[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module<br />
$ _
</example>
- <p>You can even use <code>apxs</code> to compile complex modules outside the
- Apache source tree, like PHP3:</p>
-
- <example>
- $ cd php3<br />
- $ ./configure --with-shared-apache=../apache-1.3<br />
- $ apxs -c -o libphp3.so mod_php3.c libmodphp3-so.a<br />
- gcc -fpic -DSHARED_MODULE -I/tmp/apache/include -c mod_php3.c<br />
- ld -Bshareable -o libphp3.so mod_php3.o libmodphp3-so.a<br />
- $ _
- </example>
-
- <p>because <code>apxs</code> automatically recognized C source files and
- object files. Only C source files are compiled while remaining object
- files are used for the linking phase.</p>
</section>
</manualpage>